Skip to main content

Firecrawl Python Agent Quickstart

This is the canonical quickstart for external agents integrating with Firecrawl using the official Python SDK. Generated from SDK source and OpenAPI spec.

Install

Authenticate

Constructor parameters: An async client is also available: from firecrawl import AsyncFirecrawl.

When To Use What

  • search — Use when you start with a query and need to discover relevant pages. Returns search results grouped by source type, optionally with scraped content.
  • scrape — Use when you already have a URL and want its content. Returns markdown, HTML, structured data, screenshots, or other formats.
  • interact — Use when the page needs post-scrape browser actions like clicking, filling forms, or executing code in the browser sandbox.

Why use it

Search the web and optionally scrape each result in one call. Start here when you have a question or topic but not a specific URL.

Preferred SDK method

Example

Parameters

All parameters are keyword-only and optional unless noted.

Scrape

Why use it

Fetch and extract content from a single URL. Use when you have a specific page to read.

Preferred SDK method

Example

Parameters

All parameters are keyword-only and optional unless noted.

Interact

Why use it

Execute code or natural-language prompts in the browser sandbox associated with a scrape job. Use after a scrape to click buttons, fill forms, navigate, or extract additional data.

Preferred SDK method

Example

Parameters

Stops the interactive browser session and returns billing info.

Notes

  • Naming style: All parameters use snake_case.
  • Deprecated aliases:
    • scrape_url() → use scrape() instead.
    • scrape_execute() → use interact() instead.
    • stop_interactive_browser() and delete_scrape_browser() → use stop_interaction() instead.
    • FirecrawlApp → use Firecrawl instead (alias still works).
  • Async client: Use AsyncFirecrawl (aliased as AsyncFirecrawlApp) for async/await usage with the same method signatures.
  • ScrapeOptions model: The ScrapeOptions Pydantic model also includes min_age and redact_pii fields which are available when passing scrape_options to search() but are not direct kwargs on scrape().

Source Of Truth

  • 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