Skip to main content

POST /v1/scrape

Read one page and return it, with no session to create, drive or release. The page is read on a browser session of its own that is destroyed with the request. Auth: Bearer API key. Request: Request:
Response: The answer (text fields cut):
Redirect detection: compare requested_url and final_url yourself; scrape has no redirected flag. Errors: Notes:
  • Timing: 1 to 2 seconds for a plain page, more for a heavy one. The whole call must finish inside 57 seconds; there is no async_mode.
  • Billing: the session charge (2) plus 1 action plus egress per MB of markdown plus the session’s browser time, prorated. A non-ok page is still charged the session.

POST /v1/crawl

Walk a site from a starting URL and return every page reached, in one call on one session of its own. Auth: Bearer API key. Request: Rules: only HTTP or HTTPS links on the same host are followed; links can switch between those schemes, but a different subdomain is another site. Fragments are dropped, /index.html and a trailing slash are folded into the same page, and each page contributes up to 300 links, breadth first. A page that fails to load or comes back blocked is skipped and does not count towards max_pages. Pages are read one at a time. Response: {"url": "https://www.iana.org/help/example-domains", "max_pages": 3} (markdown cut):
A crawl of https://example.com with max_pages: 3 returns count: 1, because its only link points at iana.org, which is another origin. Errors: as /v1/scrape (400 unsafe url, 402, 422 on a bad field or empty formats, 429, 504 deadline_exceeded past 57 seconds). Notes:
  • Timing: about a second per page on a fast site. The whole crawl must finish inside the 57 second limit and there is no async_mode, so keep max_pages to what the site can serve in under a minute; the pages read before the cut are lost with the 504.
  • Billing: the session charge (2) plus 1 credit per page plus egress per MB of markdown plus prorated browser time. A crawl is always charged at least one action.