Skip to main content
Extract the main heading from a page and read it as structured data. This example uses https://example.com and an output schema with one required field: heading. Want your coding agent to work in your own Chrome, with your logins? See Browser Agents Local.

Before you start

Copy your pre.dev API key from Integrations → Built-in in the dashboard: pre.dev/projects/integrations for your personal workspace, or the Integrations page of a team workspace. Workspace keys start with pdk_. Store it as PREDEV_API_KEY. You need available credits to submit a task; see authentication and account access.

Run the task

Choose curl, Node.js, or Python. The default request waits for the result.

Read the response

A successful task has status: "SUCCESS" and, for this example, data shaped like { "heading": "Example Domain" }. The run also has an id, lowercase batch status, results, and totalCreditsUsed. An illustrative response excerpt:
A batch marked completed can contain failed tasks. Check results[0].status before reading results[0].data; the SDK examples above include this check. Explore the run and task states for failure cases.

Use async for longer work

Add "async": true to the REST request body, { async: true } to Node options, or run_async=True to the Python call. Set BATCH_ID to the actual id returned by your request, then poll:
Stop when batch status becomes completed or failed. You can also watch an existing run with SSE or submit with stream: true for a submission stream.

Use MCP

Follow MCP setup, then ask your assistant:

Make it your own

Replace the URL and instruction, then describe the data your application needs in output. For a workflow with several actions, make the desired end state explicit. Continue with task modes and limits, streaming results, or safe retries.