Skip to main content

Firecrawl Python Agent Quickstart

This file is the canonical quickstart for external agents integrating with Firecrawl via the official Python SDK. It is generated from SDK source and the OpenAPI spec.

Install

Authenticate

Or set the FIRECRAWL_API_KEY environment variable and omit api_key:

When To Use What

  • search — Use when you start with a query and need to discover relevant pages. Returns web results, news, images, and optionally scraped page content.
  • scrape — Use when you already have a URL and want structured page content (markdown, HTML, JSON extraction, screenshots, etc.).
  • interact — Use when a page needs browser automation after scraping — clicks, form fills, or post-scrape dynamic content extraction.

Why use it

Search the web for a query and get results with titles, URLs, descriptions, and optionally full page content. Supports filtering by domain, time range, category, and source type.

Preferred SDK method

Example

Parameters

Scrape

Why use it

Scrape a URL and get its content in your chosen format — markdown, HTML, JSON (with schema-based extraction), screenshots, and more. Supports browser actions, caching, proxies, and PDF parsing.

Preferred SDK method

Example

Parameters

Interact

Why use it

After scraping a page, interact with it in a live browser session — execute code or natural-language prompts to click buttons, fill forms, navigate, and extract dynamic content.

Preferred SDK method

Example

Parameters

Stopping an interaction

Call app.stop_interaction(job_id) to close the browser session and stop billing.

Notes

  • Deprecated aliases: scrape_url → scrape, scrape_execute → interact, stop_interactive_browser / delete_scrape_browser → stop_interaction. Always use the preferred names.
  • Backward-compat class names: FirecrawlApp is an alias for Firecrawl. Use Firecrawl.
  • Parameter naming: All parameters use snake_case. The SDK automatically converts to camelCase for the API.
  • Package name: firecrawl (PyPI).
  • Async support: Use AsyncFirecrawl for async/await patterns.
  • Base URL: Defaults to https://api.firecrawl.dev. Override with api_url in the constructor for self-hosted instances.

Source Of Truth

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