Skip to main content

POST /v1/scrape — Reference

Complete spec for the Web Unlocker endpoint. For usage examples and how-to explanations, see Web Unlocker.

POST https://api.omniscrape.io/v1/scrape

Headers required on every request:

HeaderValue
X-API-KeyYour API key
Content-Typeapplication/json

Request body

Only url is required. All other fields default to the values shown.

Core

FieldTypeDefaultDescription
urlstringRequired. Target URL including scheme (https://).
methodstringGETHTTP method to use on the target: GET or POST.
bodyobject/stringRequest body sent to the target when method is POST.
modestringautoauto, fast, or js_rendering.
output_formatstringhtmlhtml, markdown, plain_text, autoparse, or screenshot.
timeoutinteger30Max seconds to wait for the target (10–90).
enable_solverbooleantrueAuto-solve anti-bot challenges.

Extraction

FieldTypeDefaultDescription
css_selectorsobjectMap of key → CSS selector. Results in data.css_extracted.
templatesarray[]Built-in extractors: links, images, headings, emails, phone_numbers, metadata, tables. Results in data.template_extracted.

JavaScript rendering

These fields force browser rendering even if mode is fast.

FieldTypeDefaultDescription
js_wait_selectorstringWait until this CSS selector appears before returning.
js_wait_timeoutinteger5000Max ms to wait for js_wait_selector (1000–60000).
capture_xhrbooleanfalseCapture background XHR/fetch calls. Results in data.xhr_requests.
js_actionsarray[]Browser steps before returning. Forces js_rendering. Each step: { "action", "selector?", "value?" }. Actions: click, fill, select, check, uncheck, wait, wait_for, scroll_y, scroll_x, scroll_depth, load_more, next_page.

Screenshots

FieldTypeDefaultDescription
screenshotbooleanfalseReturn base64 PNG in data.screenshot.
screenshot_typestringviewportviewport, fullpage, or element.
screenshot_selectorstringCSS selector for screenshot_type: element.

Network & identity

FieldTypeDefaultDescription
proxystringFormat: residential:<cc> or residential:<cc>:<mode>. Modes: sticky (default), rotate, smart.
session_idstringPin same IP and cookies across requests.
custom_headersobject{}Extra headers sent to the target.
custom_cookiesobject{}Cookies sent with the request.

Unknown fields are silently ignored. Invalid values (e.g. bad mode) return 400.


Response body

{
"success": true,
"data": {
"content": "<html>...</html>",
"extracted_data": { "title": "Example" },
"css_extracted": { "price": "$99.99" },
"template_extracted": { "links": ["..."] },
"xhr_requests": [{ "url": "...", "body": "..." }],
"screenshot": "iVBORw0KGgo...",
"status_code": 200,
"final_url": "https://example.com",
"headers": { "content-type": "text/html" },
"cookies": { "session": "abc123" }
},
"metadata": {
"method_used": "js_rendering",
"output_format": "html",
"elapsed_time": 5.23,
"solver_used": true,
"challenge_solved": true,
"timestamp": "2026-06-23T10:30:00Z"
},
"billing": {
"charged": 0.0035,
"cost_per_request": 0.0035,
"balance_after": 49.91
}
}

data fields

FieldPresent whenDescription
contentAlways (unless extractor-only)Page body in the requested output_format.
extracted_dataoutput_format: autoparseAuto-detected structured data.
css_extractedcss_selectors providedYour mapped selector results.
template_extractedtemplates providedBuilt-in extractor results.
xhr_requestscapture_xhr: trueBackground XHR/fetch payloads captured during render.
screenshotscreenshot: trueBase64-encoded PNG.
status_codeAlwaysHTTP status returned by the target.
final_urlAlwaysURL after redirects.
headersAlwaysResponse headers from the target.
cookiesAlwaysCookies set by the target.

metadata fields

FieldTypeDescription
method_usedstringWhich lane ran: fast or js_rendering.
output_formatstringFormat applied to content.
elapsed_timefloatTotal processing time in seconds.
solver_usedbooleanWhether the anti-bot solver ran.
challenge_solvedbooleanWhether a challenge was successfully solved.
timestampstringISO 8601 completion time.

billing fields

FieldTypeDescription
chargedfloatAmount billed (USD). 0 on failed unlocks.
cost_per_requestfloatStandard price — 0.0035.
balance_afterfloatRemaining balance after the charge.

Error response

{
"success": false,
"error": "Target returned 403 after solver attempts",
"code": "UNLOCK_FAILED",
"metadata": { "elapsed_time": 12.4, "solver_used": true }
}
HTTPWhen
400Bad parameter. Fix the request body.
401Missing or invalid X-API-Key.
402Balance exhausted, trial expired, or quota exceeded. Check code.
429Concurrency limit. Back off and retry.
500/503/504Server error or timeout. Retry with backoff.
502Unlock failed. Not billed.

See Errors for the full list of code values and retry strategy.


Async variant

To submit without holding a connection open:

POST /v1/scrape/async → { "job_id": "..." }
GET /v1/jobs/{job_id} → { "status": "completed", "result": { ... } }

Same request body. See Async Jobs.