Skip to main content
Browser actions change the rendered page before Context.dev captures its content. Use them for consent dialogs, “load more” buttons, tabs, lazy-loaded feeds, and scrollable panels.
Actions require a paid plan. A Markdown, HTML, or image request with actions costs 2 credits. An enriched image request costs 5 credits. Actions bypass the scrape cache.

Prerequisites

Export an API key from the dashboard:

Scroll a lazy-loaded page

Pass up to five actions in execution order. This request scrolls at most ten viewports and stops early when the page no longer grows.
TypeScript, Python, Ruby, and Go SDK 2.14.0 need an explicit JSON query value for actions. The examples use request options to preserve the action array.

Choose an action

A bare { "do": "scroll" } scrolls one viewport down. amount can be a pixel count, viewport, or max; maxScrolls accepts 1 to 50.

Combine click and wait

Use a specific instruction that can be verified from visible page state, then wait only as long as the resulting update needs.
For an inner panel, add a CSS selector:

Verify the outcome

Do not infer success only from the HTTP status. When action outcomes are returned, inspect actionsApplied in request order:
If a critical action is not applied, do not trust the captured content to represent the intended state.

Keep interactions robust

  • Describe visible text and intent, such as click the "Pricing" tab, instead of coordinates.
  • Prefer one perform action followed by a short wait over several vague instructions.
  • Use scroll for repeated movement; do not expand a simple scroll into multiple perform actions.
  • Keep a fallback for login walls, CAPTCHA challenges, and interactions that depend on a user account.

Supported endpoints

Actions are available on:

Scrape Markdown

Apply actions before reading a page as Markdown.

Scrape HTML

Apply actions before capturing rendered HTML.

Scrape images

Apply actions before collecting page images.

Extract structured data

Apply actions before extracting fields with a JSON Schema.
On Extract, actions run on the starting page before link discovery. Additional crawled pages do not repeat them. See the extraction guide for its pricing and crawl controls.

Next steps

Scrape a webpage

Combine actions with scraping and content-selection options.

Extract page images

Combine actions with image enrichment and deduplication.