Skip to main content

Firecrawl Curl Agent Quickstart

This file is the canonical quickstart for external agents using the Firecrawl REST API directly. It is generated from the Firecrawl OpenAPI spec (v2-openapi.json).

Base URL

Authenticate

Pass your API key in the Authorization header:
The API key can be omitted for the keyless free tier (rate-limited per IP) on scrape, search, and interact.

When To Use What

  • POST /search — Use when you start with a query and need to discover relevant URLs. Returns search results and optionally scrapes each result page.
  • POST /scrape — Use when you already have a URL and want page content (markdown, HTML, screenshots, structured JSON, etc.).
  • POST /scrape/{jobId}/interact — Use when the page needs post-scrape browser actions: executing code in the live browser session.

Why use it

Search the web for a query and get back results with metadata. Optionally scrape each result page by passing scrapeOptions.

Endpoint

Example

Parameters

Response

Scrape

Why use it

Scrape a single URL and get back its content in one or more formats. Supports markdown, HTML, screenshots, structured JSON extraction, and more.

Endpoint

Example

Structured JSON extraction:

Parameters

Format types

Each item in formats is either a string or an object with a type field:

Action types

Response

Interact

Why use it

Execute code in the live browser session that was created by a prior scrape call. Use this for multi-step workflows: running scripts, navigating, or extracting additional data from the page.

Endpoint

Example

Parameters

Response

Stop interaction

Response: {"success": true, "sessionDurationMs": 12345, "creditsBilled": 1}.

Notes

  • code is required — The OpenAPI spec requires code for the interact endpoint. Some SDKs (Node.js, Python, Rust) additionally support a prompt parameter for natural-language interaction, but the REST API requires code.
  • scrapeOptions in search — The full set of scrape options can be passed inside search to scrape each result page.
  • Error responses — All errors return {"success": false, "error": "..."} with appropriate HTTP status codes (400, 402, 404, 408, 409, 410, 429, 500).

Source Of Truth

  • firecrawl-docs/api-reference/v2-openapi.json