API reference

One endpoint. JSON in, data out.

Send a URL; get the page, structured data, or what your browser steps collected. Requests that hit an anti-bot wall are never charged.

Quick start

Create a key in the dashboard, then:

curl "https://stealthasf.com/v1/scrape" \
  -H "x-api-key: sasf_live_…" \
  -H "content-type: application/json" \
  -d '{"url": "https://example.com/", "engine": "auto", "extract": "links"}'

Authenticate with x-api-key: <key> or Authorization: Bearer <key>. Use a client timeout of 600 s for these examples; processing time varies.

Request: POST /v1/scrape

fieldtypemeaning
urlstring, requiredhttp(s) URL, up to 2048 chars. Internal/private addresses are refused.
engineauto · http · browser · stealth · ultraauto (default) starts on plain HTTP; when an anti-bot block is detected it retries the plain request through a residential IP (returned engine residential, 5 base credits), then steps up to protected mode, and to Ultra if protected mode is blocked too; it also remembers sites that needed protected mode. Steps and plans without Ultra stop at protected mode. http: plain request. browser: JavaScript rendering. stealth: protected request. ultra: our strongest mode for the hardest protected sites, 50 base credits. Browser and stealth requests may escalate to Ultra when needed; the returned engine determines the charge. Ultra supports page rendering and extraction, but not browser steps. Use browser mode explicitly for JavaScript content that returns an unblocked but empty HTML shell.
countrystring, optionalISO 3166-1 alpha-2 code (case-insensitive), e.g. US or de. Pro and Scale only; Free/Hobby return 403 plan_feature.
extractlinks · text · meta · images · headings · tableReturn structured data instead of parsing HTML yourself.
stepsarray, up to 40Browser actions run in order on the page (see below). Requires JavaScript rendering.
randomize{delays, motion, order}Human-like pauses, mouse and scroll between steps.
repeat, repeat_gap_msint, int (≤ 60000)Run the steps N times in one browser session with a pause between (e.g. read a price every 10 s). Stops after ~14 min.

Browser steps

Each step is a one-key object. Selectors start with css: or xpath:; append ::text or ::attr(href) to read text or an attribute.

stepexample
crawl{"crawl": {"links": "css:a.item", "next_page": "css:a.next", "fields": {"title": "css:h1::text"}, "max_items": 500}}: opens detail links on each list page and extracts fields there, following next_page up to the configured limit. Without links, extracts item_selector rows from the list pages.
scrape{"scrape": {"item_selector": "css:.row", "fields": {"name": "css:.name::text"}}}
click · hover · scroll · wait_for{"click": "css:button.more"}
type{"type": {"selector": "css:input[name=q]", "text": "boots"}}
press_key{"press_key": "Enter"}
goto · wait{"goto": "https://example.com/page/2"} · {"wait": 1500}
find_and_click{"find_and_click": {"text": "Load more"}}: scrolls until the text appears, then clicks.
collect_links{"collect_links": {"selector": "css:a.result"}}
capture{"capture": {"name": "price", "selector": "css:.price"}}: stores a value; use it later as {{price}}.
js_eval{"js_eval": {"name": "items", "code": "return (await fetch('/api/items')).json()"}}: runs in the cleared page with its cookies.
if_exists · try{"if_exists": {"selector": "css:.cookie-ok", "then": [{"click": "css:.cookie-ok"}]}} · {"try": {"steps": [...]}} (failures inside are ignored)

Response: 200

{
  "ok": true,
  "job_id": "cm…",
  "engine": "stealth",            // the tier that produced the result
  "status": 200,                  // the target's HTTP status
  "html": "<!doctype html>…",
  "data": { "kind": "table", "columns": [...], "rows": [[...]] },   // with "extract"
  "records": [ {"type": "crawl", "url": "…", "data": {...}} ],      // with "steps"
  "discovered_api": { "kind": "json_api", "url": "…", "method": "GET" },  // when the page called its own data API
  "usage": { "engine": "stealth", "bytes": 3145728, "proxy_mb": 3.1, "ms": 53210 },
  "credits_charged": 45,
  "balance": 249955
}

Errors

statusmeaningcharged
400Invalid body, URL, engine, extract or stepno
401Missing or invalid API keyno
402Not enough credits (balance included). If work already completed, the remaining balance may be charged.possible; check job history
403Country targeting requires Pro or Scale (plan_feature)no
422The site's anti-bot blocked the request (job_id, balance included)no
429Rate limit (120 requests/min per IP), or concurrency_limit with the plan’s limit in the bodyno
502The target could not be reached, or a processing errorno

Concurrency

Per organisation: Free: 1 · Hobby: 3 · Pro: 8 · Scale: 20 concurrent requests. Requests over the limit return 429 and never consume credits.

Credits

whatcredits
http request1 (+ response bytes / 2 MB, rounded to the nearest whole credit)
browser request5 (+10 per MB of transfer beyond the first MB, rounded up to a whole credit)
stealth request25 (+10 per MB of transfer beyond the first MB, rounded up to a whole credit)
ultra request50 (+10 per MB of transfer beyond the first MB, rounded up to a whole credit)
solved captcha+25
blocked request0

MB means 1,048,576 bytes. Country-targeted HTTP requests also use the transfer charge: 10 credits per MB beyond the first MB, rounded up.

With engine: auto you pay only for the tier that succeeded. Check credits_charged in the response to measure actual usage.