POST /v1/extract
Load a page in the session’s browser and return its main content as Markdown. Output removes navigation, consent banners, share bars, related content, footers, and hidden elements. Links are absolute, and code blocks include their language. Optional formats include plain text, links, metadata, and rendered HTML. Likefetch, extraction can attempt challenge solving and exit recovery for protected pages. Custom-proxy sessions keep their proxy exit. Disconnect the main CDP client and any native Playwright or VNC client before calling these routes. CDP observers can remain connected; coordinate their commands with extraction.
Auth: Bearer API key.
Request:
A plain request:
The Wikipedia page (markdown cut):
{"session_id": "...", "url": "https://www.bbc.com/news", "formats": ["markdown", "text", "links", "metadata"], "links": "footnote", "max_chars": 3000, "include_images": false} (markdown, text and the links list cut):
{"session_id": "...", "url": "https://example.com/", "async_mode": true} answers with status: "pending" and a job_id. The poll on GET /v1/job/{job_id} reports kind: "extract" and, once done, the extract fields in result.
Residential unlock escalation. When the page comes back challenged, hard_blocked, rate_limited or requires_login, the read is retried through residential egress with server-side CAPTCHA solving before you see the typed status. If that reaches the content, the response is ok with self_healed: true. If your plan has no premium egress left, or the balance cannot cover a solve, the typed status is returned with premium_required set to a sentence that says which of the two it was. A source_empty page is not escalated: it is a hydration problem, so raise wait_ms instead.
Errors:
Notes:
- Timing: a plain page returns in 1 to 3 seconds. The synchronous ceiling is 43 seconds for the navigation and the read together;
wait_msabove that has no effect on a synchronous call. As a job the ceiling iswait_msplus a margin for the read. - The tab the extract opened stays open on the session, so a following
/actor/elementsacts on the page you just read. - Billing: 1 credit per successful extract plus 1 credit per MB of markdown; nothing for a typed non-
okoutcome. When the residential escalation delivered the page, its bytes are billed as premium egress and the solve as 20 credits. Billing is on the full markdown even whenmax_charscuts what is returned.