actions runs steps on the page, in order, before Scrape reads it. Use them to load more results, open a tab, fill a search box, or capture a screenshot at the right moment. Actions need an API key.
Make a request
Get an API key in the Quickstart. This request scrolls a news front page, clicks its “More” link, waits a second, takes a screenshot, and then reads the page it ends on.Read the response
The formats you asked for describe the page after the last action.actions holds what the capture steps produced. This real response is cut. The Markdown was 14,215 characters, and links held 197 URLs.
metadata.sourceURL is the URL you sent. metadata.url is where the page ended up, here the second page of results. Each screenshot is a link that works for 7 days.
Action types
Captures come back in the order the steps ran.
A failed action
When a step fails, you still get the page as it stood, and the actions after the failed one do not run. The response has awarning that names the step and says why. The call is still billed as one page. This request body clicks a button that does not exist.
warning when you send actions. To work out which selector to use, open the page in a browser session and try it there.
Options
Limits and errors
- Actions need an API key. Without one, the call returns
401 apiKeyRequired. - A step that does not fit the table returns
400 invalidRequestand names the step. - With
zeroDataRetention,screenshotandpdfsteps return400 invalidRequest, because they are kept as files. - A read with actions is always live. It is never answered from a stored copy.
- Waits count toward the call’s
timeout. See Timeouts and errors.
Price
$1 per 1,000 pages. The actions add nothing, and neither do their screenshots, captures and PDFs.Related
- Interact keeps working on a scraped page after the call.
- Waiting and rendering sets a plain wait without any step.
- Screenshot takes one picture of the page without actions.
- Scrape overview lists every format and option.