Skip to main content
Canonical Firecrawl Python quickstart for agents. Generated from SDK source (firecrawl-py v4.22.1) and the v2 OpenAPI spec.

Install

Authenticate

An async client is available as AsyncFirecrawl.

When To Use What

  • search: use when you start with a query and need discovery.
  • scrape: use when you already have a URL and want page content.
  • interact: use when the page needs clicks, forms, or post-scrape browser actions. Requires a scrape_id from a prior scrape.

Why use it

Discover relevant pages from a query, then pick URLs to scrape or interact with. Constrain results to a site with site: in the query string.

Preferred SDK method

client.search(query, **options)SearchData

Example

Results are grouped by source: results.web, results.news, results.images. Do not access results.data.

Parameters

Scrape

Why use it

Get structured content from a URL in one or more formats.

Preferred SDK method

client.scrape(url, **options)Document

Example

Parameters

Interact

Why use it

Control the browser session tied to a scrape job. Use for clicks, form fills, code execution, or natural-language browser instructions. Requires a scrape_id from a prior scrape response.

Preferred SDK method

client.interact(job_id, code=None, *, prompt=None, language="node", timeout=None) prompt is keyword-only. At least one of code or prompt must be provided.

Example

Parameters

client.stop_interaction(job_id) ends the browser session. Returns BrowserDeleteResponse with success, optional session_duration_ms, credits_billed, error.

Notes

  • Deprecated aliases: scrape_executeinteract; stop_interactive_browser and delete_scrape_browserstop_interaction; scrape_urlscrape.
  • The top-level Firecrawl client exposes v2 methods directly; v1 remains under client.v1.
  • FirecrawlApp is a deprecated alias for Firecrawl; AsyncFirecrawlApp is a deprecated alias for AsyncFirecrawl.
  • Format strings accept both camelCase ("rawHtml") and snake_case ("raw_html").
  • "json" as a plain string in formats is allowed in Python (unlike Node.js), but an object form {"type": "json", "prompt": ...} is preferred for extraction.

Source Of Truth

  • firecrawl/apps/python-sdk/pyproject.toml
  • firecrawl/apps/python-sdk/firecrawl/client.py
  • firecrawl/apps/python-sdk/firecrawl/v2/client.py
  • firecrawl/apps/python-sdk/firecrawl/v2/types.py
  • firecrawl-docs/api-reference/v2-openapi.json