Skip to main content
Interact opens a browser session on a page you already scraped. Run code or a plain-words step on it, as many times as you need, then close it. Use it when browser actions are not enough: a form with several steps, a value you only see after clicking through, or a page you want to look at before you decide what to do.

Make a request

You need an API key and the id of a scrape from the last 24 hours. Scrape the page first, then send code to POST /v1/scrape/{id}/interact.
The first call opens the session on the page the scrape read. If that scrape ran actions, they run again first so the page is as the scrape left it. The same location and 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.
The call itself costs nothing. You pay for the time the session is open, when it closes.

Close the session

Send DELETE to the same path as soon as you are done. This is when the time is billed.
This real session was open for about 9 seconds and cost $0.004. The response is cut to the fields that matter.
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

Send code 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, returns 404 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.
  • zeroDataRetention on a call that reaches a session already open without it returns 400 invalidRequest. Close the session with DELETE, then send it on the first call.
  • A DELETE on a scrape with no open session returns 200 and bills nothing.