Firecrawl Python Agent Quickstart
Canonical quickstart for external agents integrating Firecrawl with Python. Generated from SDK source and OpenAPI spec.Install
Authenticate
FIRECRAWL_API_KEY environment variable and omit api_key:
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.
Search
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_domainsandexclude_domainson search are mutually exclusive.FirecrawlAppis a deprecated alias forFirecrawl. UseFirecrawl.AsyncFirecrawlAppis a deprecated alias forAsyncFirecrawl.- Deprecated method aliases (do not use in new code):
scrape_execute()→ useinteract()stop_interactive_browser()/delete_scrape_browser()→ usestop_interaction()scrape_url()→ usescrape()crawl_url()→ usecrawl()map_url()→ usemap()
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

