Skip to main content
Context.dev is a web data API for agents: search, scrape, crawl, brand and company data, and research answers with sources, over one API with SDKs, a CLI and a hosted MCP server. The two products split the work:
  • Context handles search and reading pages. It finds pages, reads them as Markdown or typed JSON against a schema, and returns company and brand data. No browser session to manage.
  • Anchor takes over when a real browser has to act. Use it for logins with MFA or a CAPTCHA, sessions that must stay signed in, form filling, checkout, and long multi-step flows.
This guide builds one agent that does both: Context finds a vendor’s pricing page and extracts its plans, then an Anchor browser signs in to an internal portal and files a purchase request with the numbers Context found. No payment step, anywhere. You can run it as code in Python or TypeScript, or as a single prompt in an MCP client.

Prerequisites

This guide uses Net Sweet (netsweet.co), the demo app that ships with every Anchor account, and its demo.admin identity. You can run every step below against it with no third-party account. Find the identity ID under Identities.
The Identities page in the Anchor dashboard showing the Net Sweet application and its demo.admin identity.
In Context.dev, open API Keys and click Create API key.
The API Keys page in the Context.dev dashboard, with the Create API key button outlined.
In Anchor, create a key under API Keys.
The API Keys page in the Anchor dashboard, with the Create key button outlined.

Setup

  1. Set your API keys:
  1. Install dependencies:
The Python package is context.dev and imports as from context.dev import ContextDev. You don’t run playwright install or launch a browser locally. The browser runs in Anchor’s cloud, and the SDK drives it over Anchor’s API.

Choose your browser power

Not every page needs the same browser. Pick the session configuration for the target and move up only when a site fights back. The task is identical in each tier; only the session changes. Agent-vpn is session.proxy. Captcha solving needs an active proxy or a browser profile, and extra stealth needs an active proxy. Set session.timeout so a forgotten session ends itself. The example below reads the tier from an env var (ANCHOR_TIER=light|standard|max, default standard).
If you call perform-web-task over REST, pass an existing session as the sessionId query parameter, not in the request body. In the body it is ignored and Anchor opens a second, unconfigured browser for the task. The SDK calls in this guide send it as a query parameter for you.

Part 1: Research with Context

Search the vendor’s own site, then scrape its pricing page into typed JSON with a schema. No browser session yet.
include_domains (includeDomains in TypeScript) keeps the search on the vendor’s site. Without it, the top result for “Context.dev pricing” in our test was a third-party blog with outdated prices. json_params.instructions tells the extraction to list every plan and use only facts on the page. Check success on the JSON output before you read data.

Part 2: Act on it with Anchor

Start a session signed in with your identity, then hand the chosen plan to perform-web-task. Anchor fills and submits the request in the portal, and the finally block ends the session so it stops billing. The full, runnable script:
Run it. The first argument is the vendor name, the second is the domain to search:

Expected output

This output is from the Python script. Session IDs differ on every run, and the agent may take a different number of steps.
Anchor signs in, fills the New Request form with the plan Context found, and submits it:
The New Request form in the Net Sweet demo app, filled by Anchor with the Context.dev Pro plan, its credits, price and pricing URL. The Title and Description fields are outlined.
The Net Sweet Operations page with a Request Submitted confirmation toast, outlined.
Every run shows up on the session’s page in the Anchor dashboard, with its status, credits, steps and task runs:
An Anchor session page for the run: status Completed, 0.852 credits and 14 steps, and a successful task run for the Context.dev Pro request. The summary cards and the task run are outlined.
The Context search and scrape calls appear under Usage:
The Context.dev Usage page showing API calls, credits used and the split by API between Search Web, Scrape and Retrieve Brand. The totals and the By API panel are outlined.

Use it from an MCP client instead

Both products run hosted MCP servers, so you can do the same thing from one prompt in Claude Code, Cursor, Codex or any MCP client, with no glue code. You add two server URLs and two API keys. Keep the keys in your environment, as in Setup, and start the client from that shell. Each configuration below reads them by name, so no key is written into a config file.
Add a .mcp.json file to the project root. Claude Code expands ${VAR} in headers when it starts.
.mcp.json
Start claude in that folder, approve the two project servers, and run /mcp. Both servers show as connected.
Both servers also support OAuth sign-in. Give the client only the two URLs and sign in to each account when the client asks. Use API keys for CI, headless runs, or an Anchor project other than your default.
Paste this prompt into the client. Replace the identity ID with your own.
The agent uses each server for its own half of the job:
  1. Context web-scrape reads the pricing page. If the agent does not know the URL, it calls web-search first.
  2. Anchor create_session opens a cloud browser that is already signed in with the identity, with the proxy and captcha settings from the prompt.
  3. Anchor perform_web_task fills the form in that session and returns a workflow_id. get_web_task_status polls it until it completes.
  4. Anchor end_session closes the browser, so billing stops.
Pass the sessionId from create_session to perform_web_task. Without it, the task starts a new browser that is not signed in.
A session stays open until end_session or its max_duration. If the agent stops before it ends the session, for example in a headless run that exits when the turn ends, the 10 minute limit in the prompt caps the cost. To check one, ask the agent to call get_session with the session id it reported, or check the Anchor dashboard.
From a test run in Claude Code, with the agent’s summary shortened:
That run used 1 Context.dev credit for the scrape and 0.94 Anchor credits for the session and task. The plan differs from the code run because the prompt asks for the cheapest paid plan, without a credit threshold.

Next steps