Guides

The CrawlNode API, from first call to production

Every endpoint is a POST with a Token header. After start, every call also carries X-Session-Id. Bodies are JSON objects; send {} when there is nothing to say.

Quickstart

Three steps from nothing to a screenshot on your disk: get a key, make four calls, check what came back.

1. Get a key

  1. Create an account and confirm your email address.
  2. By card: on the billing page, choose how many physical nodes you want and subscribe. When the payment goes through you land on the API keys page; press Generate API key.
  3. By invoice: on the API keys page, open “Prefer to pay by invoice?”, choose your nodes and send the request. We confirm the order with you, usually within one business day, and the key appears on that page for you to reveal.
  4. Your key is shown once, with these same calls beside it and the key already filled in.

Then put it in your environment, which is where every sample here reads it from:

export CRAWLNODE_TOKEN='paste-your-key-here'

2. Make the four calls

The base URL is https://api1.crawlnode.com. Start a browser, navigate, take a screenshot, destroy.

# 1. start a browser (warm pool, managed proxy)
SESSION=$(curl -s -X POST https://api1.crawlnode.com/api/start \
  -H "Token: $CRAWLNODE_TOKEN" -H "Content-Type: application/json" \
  -d '{"proxy":"auto"}' | sed -n 's/.*"session_id":"\([^"]*\)".*/\1/p')

# 2. navigate
curl -s -X POST https://api1.crawlnode.com/api/go \
  -H "Token: $CRAWLNODE_TOKEN" -H "X-Session-Id: $SESSION" \
  -H "Content-Type: application/json" -d '{"url":"https://example.com"}'

# 3. screenshot of the page (WebP bytes); drop "area" for the whole window
curl -s -X POST https://api1.crawlnode.com/api/screenshot \
  -H "Token: $CRAWLNODE_TOKEN" -H "X-Session-Id: $SESSION" \
  -H "Content-Type: application/json" -d '{"area":"viewport"}' -o page.webp

# 4. always destroy
curl -s -X POST https://api1.crawlnode.com/api/destroy \
  -H "Token: $CRAWLNODE_TOKEN" -H "X-Session-Id: $SESSION" \
  -H "Content-Type: application/json" -d '{}'

The session_id comes back both in the body and in the X-Session-Id response header.

3. Check it worked

You now have page.webp in the directory you ran the calls from: the page as the browser painted it. If a call failed instead, its body says why, and Errors and retries says what to do about each status.

To check a key on its own, without starting a browser, ask what it has used. This is the one call that needs no session:

curl -s -X POST https://api1.crawlnode.com/api/usage \
  -H "Token: $CRAWLNODE_TOKEN" -H "Content-Type: application/json" -d '{}'

It answers with the limits on the key and what has been spent against them this period. A 401 here means the key itself is wrong, before you have spent any time on a session. Usage and limits goes through every field.

Endpoints

All are POST /api/<name>. The ones marked session need X-Session-Id.

EndpointWhat it does
startCreate a session. Options: proxy (auto, a pool type, or your own), proxy_country, proxy_region, node, target, extension for network capture.
go sessionNavigate to a URL. Options for waiting out or solving challenges and for falling back to another exit.
html sessionThe rendered DOM after JavaScript, with a quiet window or a selector to wait for.
screenshot sessionWebP by default, or PNG and JPEG. area: viewport captures the page alone; the default is the whole browser window. Re-grabs until the page has painted, up to settle_ms; X-Capture-Area says what you got.
screenshots sessionA low-fps MJPEG stream of the window until you disconnect.
pdf sessionPrint the page to PDF.
wait sessionBlock until the page settles or a selector appears, instead of polling.
extract sessionPull named targets out of the page by selector in one call.
script sessionRun a list of steps (go, wait, extract, click, input, and more) as one round trip, buffered or streamed.
view, click, input, drag sessionInspect the accessibility tree and interact with elements.
eval, dom, console, state sessionRun JavaScript, query the DOM, read console output, read page state.
network, download sessionList captured requests and download any request or response body. Needs extension: true on start.
fetch, upload sessionFetch a URL with the session's cookies; upload a file into a form.
solve sessionRun the challenge solver ladder against what is on screen.
proxy, egress sessionSwitch the upstream proxy without restarting Chrome; read the current exit IP.
sessionsList your live sessions.
destroy, clear sessionRelease the browser; wipe browsing data and keep the session.

Usage and limits

/api/usage takes no session and no parameters: send GET, or POST with {}. A one-node key answers like this (trimmed):

{
  "token": "your-key-name",
  "limits": {
    "plan": "node",
    "rate": 5.0,
    "max_sessions": 1,
    "idle_ttl_sec": 1800,
    "quotas": {
      "sessions": 5000, "requests": 100000, "provider_solves": 300,
      "bytes": {"dc": 10737418240, "isp": 4294967296,
                "residential": 25769803776, "mobile": 2147483648}
    },
    "quota_action": "record",
    "features": {"network": true, "fetch": true, "eval": true}
  },
  "usage": {
    "sessions_started": 812, "browser_seconds": 149203,
    "requests": 5140, "provider_solves": 3,
    "bytes_dc": 0, "bytes_residential": 91238841, "bytes_isp": 0,
    "bytes_mobile": 0, "bytes_byo": 0, "bytes_direct": 44120
  },
  "period_start": "2026-11-01T00:00:00Z",
  "resets_at": "2026-12-01T00:00:00Z",
  "live_sessions": 1,
  "metering": true
}
FieldWhat it tells you
limitsWhat the key may take, as the API enforces it. rate is calls per second, max_sessions is how many browsers it can hold at once (one per node), idle_ttl_sec is how long an untouched session lives. A null means no limit.
limits.quotasThe monthly allowances: session starts, API calls, paid challenge solves, and bytes per exit class. They grow with the number of nodes on the key.
limits.quota_actionrecord: use past an allowance is counted and the call goes through. block: the call is refused with 429 quota_exceeded until resets_at.
usageThis period's counters, beside the allowances above. browser_seconds grows while a session is open, not only when it ends. A script counts as one request however many steps it runs. Bytes are split by exit class; byo is your own proxy and direct is no proxy, and neither is counted against an allowance.
period_start, resets_atThe counting window, in UTC. The counters go back to zero at resets_at, which is 00:00 UTC on the 1st.
live_sessionsHow many browsers the key holds right now. When it equals max_sessions, a start is refused until one is destroyed.
meteringfalse means usage is not being recorded at the moment, so zeros are not real zeros.

Did the page load?

A 200 from go means the navigation finished, not that the site showed you its content. A bot challenge, an "access denied" page or a "too many requests" page also arrives with a normal title and, often, a 200. A screenshot taken then is a picture of that wall. The go answer says which one you got:

{"url": "https://www.example.com", "title": "Example Domain",
 "document_status": 200, "refused_by": null, "content_length": 14820}
  • refused_by is null when the page is content. Otherwise it names what stood in the way: a challenge vendor (cloudflare, akamai, imperva, perimeterx, datadome, hcaptcha, or challenge for an unbranded one), or an error page (rate_limited, access_denied, geo_blocked, http_<status>).
  • document_status is the HTTP status the site sent for the page. Treat 400 and above as the site's answer even when refused_by is null.
  • content_length is how much text the page holds. A clean verdict with a length near 0 is an empty page, not a loaded one.

Check these before you take a screenshot or extract anything. When a challenge comes up, solve runs the solver against it, and "await_challenge": true on go waits for one that passes on its own. Another exit often gets through where one was refused (see Proxies and targeting). wait answers with the same three fields.

Proxies and targeting

Every session leaves through an exit you choose on start. Managed exits are part of every node and are in the United States today. A proxy of your own is used as given and never counted, and is the way to arrive from anywhere else.

Send on startWhat you get
"proxy": "auto"An exit drawn from the whole managed pool. The right choice until a site gives you a reason to be specific.
"proxy": "rotating_residential"Only that pool type. The others are static_residential, isp and mobile. Use one when a site refuses datacenter traffic.
"proxy_country": "US"The country of the exit, as an ISO code, beside auto or a pool type. Every managed exit is in the United States today, so US is the only value that finds one.
"proxy_region": "..."A region inside the country, when the vendor exposes one.
"proxy": "user:pass@host:port"Your own proxy. host:port and the host:port:user:pass export format work too. SOCKS is not supported and is rejected on start rather than silently dialled.

A residential exit, for a site that blocks hosting ranges:

SESSION=$(curl -s -X POST https://api1.crawlnode.com/api/start \
  -H "Token: $CRAWLNODE_TOKEN" -H "Content-Type: application/json" \
  -d '{"proxy":"rotating_residential"}' \
  | sed -n 's/.*"session_id":"\([^"]*\)".*/\1/p')

Then ask the session where it is leaving from, before you trust what the site shows you. egress answers with the address the site sees:

curl -s -X POST https://api1.crawlnode.com/api/egress \
  -H "Token: $CRAWLNODE_TOKEN" -H "X-Session-Id: $SESSION" \
  -H "Content-Type: application/json" -d '{}'

proxy on a live session switches the exit without restarting Chrome, so one browser can look at the same page from two addresses.

Errors and retries

Success is 200. Errors carry a JSON body, {"error": {"code": "...", "message": "...", "status": 503}}, or {"detail": "..."} for an action the browser could not carry out. Branch on error.code, not the text.

StatusCommon codesWhat to do
400session_id_required, invalid_body, url_malformed, unknown_proxy_typeFix the request; it fails the same way on a retry.
401token_missing, token_invalidCheck the Token header and the key.
403feature_not_allowed, target_not_allowed, url_banned_rangeThe key may not do this, or the address is private. Retrying will not change it.
404session_not_foundThe session ended (destroyed, idle, or never yours). Call start again.
429rate_limit_exceeded, quota_exceededWait the Retry-After seconds, then retry.
429session_limit_exceededThe key holds all the browsers it may. No Retry-After: nothing frees on its own, so destroy a session first.
500{"detail": ...}The browser could not do it, often because of the page (a load that failed, an element that is not there). The text says which.
501endpoint_unsupported_on_nodeStart a new session and try again.
502, 510bad_node_response (502), a forwarding error on the node (510)A fault on our side. Retry once.
503no_available_node, no_available_proxyNo free browser or exit right now. Wait the Retry-After seconds, then retry.
504node_timeout, agent_timeoutThe browser did not answer in time. Retry once; the session is still valid.

A script answers 200 even when a step fails, and puts the failure on that step, so check each step's status.

Good practice

  • Always destroy, including on failure. A leaked session holds a Chrome and a node slot until the idle timer reclaims it after 30 minutes.
  • Send JSON objects, never arrays. An empty body is {}.
  • Use wait instead of polling view. A view walks the whole accessibility tree; wait answers the same question without shipping the page.
  • Read X-Screenshot-Settled. It is present with value 0 only when the page never painted. Absent is the good case.
  • Prefer script for multi-step work. One round trip instead of one per step, and a failing step does not fail the run.