Skip to main content

Firecrawl Python Agent Quickstart

Canonical quickstart for external agents integrating Firecrawl with Python. Generated from SDK source and OpenAPI spec.

Install

Requires Python 3.8+.

Authenticate

Or set the FIRECRAWL_API_KEY environment variable and omit api_key:
Constructor parameters: An async client is also available: from firecrawl import AsyncFirecrawl.

When To Use What

  • search: Start with a query, discover relevant URLs, and get their content in one call.
  • scrape: You already have a URL and want its page content as markdown, HTML, JSON, or other formats.
  • interact: The page needs clicks, form fills, or post-scrape browser actions on a live session.

Why use it

Search the web for a query and get scraped content from the top results. Combines discovery and content extraction in one call.

Preferred SDK method

search(query, **kwargs)

Example

Parameters

Response groups results by source: results.web, results.news, results.images, results.developer.

Scrape

Why use it

Get the content of a single URL as markdown, HTML, JSON, screenshots, or other formats.

Preferred SDK method

scrape(url, **kwargs)

Example

Parameters

Interact

Why use it

Control a live browser session tied to a scrape job. Click buttons, fill forms, navigate, and extract dynamic content using code or natural-language prompts.

Preferred SDK method

interact(job_id, code=None, *, prompt=None, language="node", timeout=None, origin=None)

Example

Parameters

Stop the session when done:

Notes

  • Parameter names use snake_case (e.g. only_main_content, include_tags, scrape_options).
  • include_domains and exclude_domains on search are mutually exclusive.
  • FirecrawlApp is a deprecated alias for Firecrawl. Use Firecrawl.
  • AsyncFirecrawlApp is a deprecated alias for AsyncFirecrawl.
  • Deprecated method aliases (do not use in new code):
    • scrape_execute() → use interact()
    • stop_interactive_browser() / delete_scrape_browser() → use stop_interaction()
    • scrape_url() → use scrape()
    • crawl_url() → use crawl()
    • map_url() → use map()

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