Make a request
You need an API key and theid of a scrape from the last 24 hours. Scrape the page first, then send code to POST /v1/scrape/{id}/interact.
blockAds choice carry over. Send url to open another URL instead.
In your code, page is the session’s browser page. It has Playwright-style methods such as page.title() and page.locator(selector). Code runs as Node.js by default. Send language as python or bash to change that.
Read the response
result is the value your code returned, as text. output is what it printed. The links let you connect your own tools or watch the session. They are cut here.
Close the session
SendDELETE to the same path as soon as you are done. This is when the time is billed.
sessionDurationMs is how long the session was open. A session also ends by itself after 5 minutes without a call, and after 10 minutes at most. You are billed for the time it was open either way, so close it yourself.
Options
Sendcode or prompt. A body with neither returns 400 invalidRequest with the message Send code or a prompt.
Price
$0.06 per hour while the session is open, billed when you close it, one minute at least. Once a `prompt` has run in a session, it is $0.84 per hour for the rest of that session. Traffic through the session costs $5 per GB on the default network and $0.20 per GB direct or through your own proxy. See Pricing.Limits and errors
- A scrape id that is more than 24 hours old, or a scrape sent with
zeroDataRetention, returns404 notFound. Scrape the page again. - A free account can have 3 sessions open at once, and a paid account 10. Over that, the call returns
429 rateLimited. Close one and send it again. - Once a session has ended, the next call on the same scrape opens a new one, and it is billed on its own.
zeroDataRetentionon a call that reaches a session already open without it returns400 invalidRequest. Close the session withDELETE, then send it on the first call.- A
DELETEon a scrape with no open session returns200and bills nothing.
Related
- Browser actions run steps before the read, with no session to close.
- Browser overview opens a session on any URL, not only a scraped one.
- Browser execute runs code in a session you opened yourself.
- Freshness and caching explains the scrape id and its 24 hours.