Firecrawl Python Agent Quickstart
This file is the canonical quickstart for external agents integrating with Firecrawl using the Python SDK. It is generated from SDK source and OpenAPI spec.Install
Authenticate
FIRECRAWL_API_KEY environment variable. Omitting the key uses the keyless free tier (rate-limited per IP).
Client options:
When To Use What
search: Use when you start with a query and need to discover relevant pages. Returns ranked results with optional scraping of each result.scrape: Use when you already have a URL and want its content in markdown, HTML, JSON, or other formats.interact: Use when a page needs post-scrape browser actions — clicking, filling forms, running code, or prompting an AI agent in the browser.
Search
Why use it
Search the web for a query and get back ranked results. Optionally scrape each result page inline by passingscrape_options.
Preferred SDK method
Example
Parameters
Returns:
SearchData with optional .web, .news, and .images attributes.
Scrape
Why use it
Scrape a single URL and get its content as markdown, HTML, structured JSON, screenshots, or other formats.Preferred SDK method
Example
Parameters
Returns:
Document with attributes like markdown, html, raw_html, links, images, screenshot, metadata, etc.
Interact
Why use it
Execute code or send a natural-language prompt in the browser session of a previous scrape job. Use this for clicking buttons, filling forms, navigating multi-step flows, or running arbitrary JavaScript/Python/Bash in the browser sandbox.Preferred SDK method
Example
Parameters
Returns:
BrowserExecuteResponse with success, stdout, stderr, result, exit_code, killed, error.
Stop the session:
Notes
- All parameter names use snake_case (e.g.
only_main_content,skip_tls_verification,scrape_options). include_domainsandexclude_domainson search are mutually exclusive.- The
SearchDatareturn type has.web,.news, and.imagesattributes. Accessing.dataraises anAttributeErrorwith migration guidance. - An async client is available:
from firecrawl import AsyncFirecrawl. - Deprecated aliases (use the preferred names instead):
scrape_url()→scrape()scrape_execute()→interact()stop_interactive_browser()/delete_scrape_browser()→stop_interaction()FirecrawlApp→Firecrawl
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

