Firecrawl Python Agent Quickstart
Canonical quickstart for external agents. Generated from SDK source (firecrawl-py) and the v2 OpenAPI spec. Method names and parameters match the SDK public API.
Install
Authenticate
api_key (falls back to FIRECRAWL_API_KEY env var), api_url (default "https://api.firecrawl.dev"), timeout (seconds), max_retries (default 3), backoff_factor (default 0.5). 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 ascrape_idfrom a prior scrape.
Search
Why use it
Discover relevant pages from a query, then pick URLs to scrape or interact with. Constrain results to a site withsite: in the query.
Preferred SDK method
client.search(query, **options) → SearchData
Example
search() does not return { data: [...] }. Results are in results.web, results.news, results.images.
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 prior scrape. Use for clicks, form fills, code execution, or natural-language instructions. Requires ascrape_id from doc.metadata.scrape_id.
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 non-empty.
Example
Parameters
Stop the session with
client.stop_interaction(job_id).
Notes
- Deprecated aliases:
scrape_url→scrape,scrape_execute→interact,stop_interactive_browser/delete_scrape_browser→stop_interaction. - The top-level
Firecrawlclient exposes v2 methods directly. V1 remains underclient.v1. search()returnsSearchDatawith.web,.news,.images— not.data.- Python uses snake_case parameter names (
only_main_content,wait_for, etc.).
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

