Skip to main content

Get your API key

Sign in once at pre.dev/projects/key and copy your key. Set it as PREDEV_API_KEY before running any of the examples below.
Every example below:
  • uses your PREDEV_API_KEY env var
  • hits the live API at https://api.pre.dev
  • extracts the H1 from example.com as the simplest possible task

1. curl

2. TypeScript

3. Python

4. MCP (Claude Code, Cursor)

Add pre.dev as an MCP server. For Claude Code:
For Cursor and other editors, add the HTTP server to your MCP config:
On first use a browser tab opens — sign in to pre.dev to authorize. Then your agent gets a browser_agent tool it can call directly. Example prompt to the agent:
Use the browser_agent tool to extract the product title and price from https://www.apple.com/iphone-17-pro/ and return the JSON.
Full MCP reference: MCP Tool

What happens under the hood

  1. Your POST lands and your tasks are queued.
  2. Each task is dispatched to an isolated, sandboxed browser.
  3. An AI planner drives the browser through navigation, actions, and extraction.
  4. The result streams back as structured JSON, validated against your output schema.
  5. Billed per successful task. Failed tasks are free.

Streaming + async modes

The quickstart uses sync mode (one HTTP request, one JSON response). For long-running task sets, flip to async:
Or Server-Sent Events for live per-step updates:
Full wire format: Run a Task