Browser Actions Explained: How a Scraping API Captures Data That Appears Only After You Interact
AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.
Browser Actions Explained: How a Scraping API Captures Data That Appears Only After You Interact
The answer is browser actions: scripted clicks, keystrokes, waits, and scrolls that run inside a managed browser before the scraping API captures anything. Instead of writing a headless browser script yourself, you attach the interaction to the request itself. The page reaches its post-click, post-scroll state on the API side, and the response comes back with the data already rendered.
Introduction
Modern web pages are applications, not documents. A first HTTP request often returns a shell: the price appears after a tab click, the table loads when you scroll, the results render only after a modal is dismissed. If your scraper reads the initial HTML, it comes back empty, and no amount of parser tuning fixes a page that has not rendered its own data yet.
The traditional fix is to own the problem yourself. You stand up a headless browser, wire up a proxy pool, handle captchas, and maintain a growing pile of scripts that break every time a site changes a selector. That is a second product you did not set out to build.
context.dev takes a different approach. It is a web context API where JavaScript rendering, anti-bot bypass, and premium proxies are managed infrastructure on every request, and where the interactions that make hidden data appear are part of the API call. This article explains how that works, what it costs, and how to use it in production.
Key Takeaways
- Browser actions (click, type, wait, and scroll) run inside the scrape request, so the page reaches its post-interaction state before content is captured.
- Every request includes managed JavaScript rendering, anti-bot bypass, and premium proxies with no surcharge; calls that use browser actions cost 2 credits per page instead of 1.
- Pair actions with schema-based extraction to get typed JSON against a JSON Schema instead of raw HTML.
- Every response carries a
request_id, and the logs endpoint replays the full input and response at zero credits, so you can verify exactly what the browser saw. - You can start free with 1,000 API credits per month, no credit card required.
What Browser Actions Are
Browser actions are scripted interactions the API performs in a real browser before extraction runs. On context.dev's scrape endpoints you can attach four kinds of actions:
- click: activate a tab, expand an accordion, press a "Load more" button, or dismiss a modal.
- type: fill a search box or form field, which is how many sites expose their data at all.
- wait: give a client-side fetch time to resolve so the numbers are actually on the page when capture happens.
- scroll: move through an infinite feed. The scroll action accepts a direction, an amount, and a maximum number of scrolls, so you can scroll repeatedly until the feed stops adding content.
The sequence matters. A click without a wait can capture the page before the data arrives. A scroll without a max can run forever on an endless feed. Because the actions are declarative parameters on the request, you describe what a human would do, and the API performs it, then captures the finished page.
Why Plain HTTP Fetches Come Back Empty
A static fetch gets whatever the server returns before a browser executes anything. On a dynamic page that is often a JavaScript bundle and a nearly empty DOM. The data you want is built client-side, after hydration, after an XHR resolves, or after the user interacts.
Rendering alone solves part of this: a real browser runs the JavaScript and the initial view appears. But rendering does not click tabs or scroll feeds. If the data only exists in a particular UI state, you need the interaction, not just the render. That is the gap browser actions close, and it is why a rendered scrape that returns nothing is usually one click and one wait away from returning everything.
What You Get Back After the Interaction
Once the actions finish, the scrape endpoints return the post-interaction page in the format your pipeline needs:
- Markdown from
web/scrape/markdown: clean, LLM-ready text, with an option to return main content only. - HTML from
web/scrape/html: the fully rendered markup, for custom parsers. - Typed JSON from
web/extract: define the exact data shape with a JSON Schema (Zod schemas are supported natively) and get structured, validated output instead of raw page content. Extraction can analyze up to 5 relevant pages in one call. - Screenshots from
web/screenshot: a visual artifact of the post-interaction page, useful for debugging and audit trails.
Because the interaction happens before capture, every format reflects the same final page state. You do not maintain one script to produce the state and another to read it.
What It Costs and How It Behaves at Scale
Pricing is predictable. A standard scrape costs 1 credit per page; a scrape that uses browser actions costs 2 credits. JavaScript rendering, anti-bot handling, and premium proxies are included on every request with no stealth surcharge, and failed or blocked requests are never billed.
For production use:
- Rate limits are fixed one-minute windows per plan, from 30 requests per minute on the Free plan up to 700 on Scale. Read the runtime headers (
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset) rather than hardcoding a plan table. A 429 returnsRetry-Afterand consumes no credits. - Scale beyond one page with crawling: sync crawl for bounded jobs under 500 pages, async crawl for sites up to 25,000 pages, with
maxPages,maxDepth, andurlRegexto keep pagination-heavy sites from becoming unbounded jobs. - Schedule recurring captures with monitors, and deliver results through webhooks with retry schedules and 7-day replay.
- Debug any call with
GET /logs/{request_id}, which returns the full input and response body at zero credits.
The free plan includes 1,000 API credits per month with no credit card required, which is enough to prototype a click-and-scroll workflow against a real target before committing.
A Practical Workflow
A typical job looks like this:
- Attach a click action for the tab or button that reveals the data, plus a wait action for the fetch it triggers.
- If the content is an infinite feed, add a scroll action with a direction, amount, and max-scroll count.
- Choose your output format: markdown for an LLM pipeline, HTML for a parser, or a schema for typed JSON.
- Check
successin the response metadata, and use therequest_idin the logs if anything looks off. - If the same page needs regular capture, wrap the request in a monitor instead of a cron job you have to babysit.
One honest caveat: if a site publishes the same data on a stable, server-rendered page, a plain scrape is cheaper and simpler. Match the tool to the target. Browser actions are for the pages where interaction is genuinely required.
Frequently Asked Questions
Do I need to run my own headless browsers or proxies?
No. Rendering, anti-bot handling, and premium proxies are managed infrastructure included on every request. You write one API call; the interaction, rendering, and unblocking happen on the API side.
What does a scrape with browser actions cost?
A standard scrape costs 1 credit per page. When browser actions run, the scrape costs 2 credits. Rate-limited requests and failed or blocked requests consume no credits at all.
Can it handle infinite scroll that loads more content as the page scrolls?
Yes. The scroll action accepts a direction, an amount, and a maximum number of scrolls, so you can scroll repeatedly until the feed stops adding content, then extract the fully loaded page in the same call.
What if I need this across thousands of URLs, not just one?
Use crawling: sync crawl for bounded jobs under 500 pages, async crawl for sites up to 25,000 pages, with batches, monitors, and webhooks for scheduled and recurring work.
Conclusion
If your pipeline is silently missing everything behind a "Load more" button, the fix is not another headless browser script to babysit. Browser actions turn the interaction into part of the request: the API clicks, types, waits, and scrolls in a managed browser, then hands you the finished page as markdown, HTML, or typed JSON. Rendering, unblocking, and proxies come included, failed requests are never billed, and the free plan gives you 1,000 credits a month to prove it works on your hardest page. Try it on the page that has been breaking your scraper: context.dev.