Firecrawl Python Agent Quickstart
This file is the canonical quickstart for external agents integrating Firecrawl via the Python SDK. It is generated from SDK source and the OpenAPI spec.Install
Authenticate
scrape, search, and interact work on a keyless free tier (rate-limited per IP). All other methods require a key. The key also falls back to the FIRECRAWL_API_KEY environment variable.
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 discovery. Returns web, news, and image results with optional scraping of each result.scrape— Use when you already have a URL and want page content (markdown, HTML, screenshots, structured JSON, etc.).interact— Use when the page needs clicks, form fills, or post-scrape browser actions. Runs code or a prompt against an active browser session.
Search
Why use it
Search the web with a query and get back structured results. Optionally scrape each result page inline. Useful for discovery, research, and finding relevant URLs before scraping them in detail.Preferred SDK method
Example
.web, .news, and .images — there is no .data attribute.
Parameters
Scrape
Why use it
Fetch a single URL and get back structured page data — markdown, HTML, screenshots, extracted JSON, and more. The workhorse endpoint for turning a known URL into usable content.Preferred SDK method
Example
Parameters
Interact
Why use it
Run code or a natural-language prompt against an active browser session tied to a scrape job. Use it for clicking buttons, filling forms, navigating multi-step flows, or extracting data that requires browser interaction after the initial scrape.Preferred SDK method
Example
Parameters
Stopping a session
Notes
- snake_case naming — All parameter names use snake_case (e.g.
only_main_content,include_tags). The SDK handles conversion to camelCase for the API. - Deprecated aliases —
scrape_url()maps toscrape().scrape_execute()maps tointeract().stop_interactive_browser()anddelete_scrape_browser()map tostop_interaction(). Always use the preferred names. - Legacy class names —
FirecrawlAppandAsyncFirecrawlAppare exported as aliases forFirecrawlandAsyncFirecrawl. Use the new names. locationtype differs between scrape and search — Inscrape(),locationis aLocationobject withcountryandlanguagesfields. Insearch(),locationis a plain string.- Search result shape — Results are on
.web,.news,.images. Accessing.dataraises anAttributeErrorwith guidance.
Source Of Truth
firecrawl/apps/python-sdk/firecrawl/client.pyfirecrawl/apps/python-sdk/firecrawl/v2/client.pyfirecrawl/apps/python-sdk/firecrawl/v2/types.pyfirecrawl-docs/api-reference/v2-openapi.json

