Firecrawl Python Agent Quickstart
Canonical quickstart for external agents. Generated from SDK source (firecrawl-py v4.41.0) and the v2 OpenAPI spec. Method names, parameters, and types match the v2 client.
Install
Authenticate
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:, for example site:docs.firecrawl.dev crawl webhooks.
Preferred SDK method
client.search(query, **options) → SearchData
Example
search() does not return { data: [...] }. Web results are in result.web, news in result.news, images in result.images.
Parameters
Scrape
Why use it
Fetch structured content from a URL in one or more formats. Use when you already have the URL.Preferred SDK method
client.scrape(url, **options) → Document
Example
Parameters
Format options:
String formats:
"markdown", "html", "rawHtml" (or "raw_html"), "links", "images", "screenshot", "summary", "changeTracking" (or "change_tracking"), "attributes", "branding", "audio", "video".
Object formats:
{"type": "json", "prompt": "...", "schema": {...}}— at least one ofpromptorschemarequired.{"type": "question", "question": "..."}— question-answer extraction.{"type": "highlights", "query": "..."}— relevant source-text extraction.{"type": "screenshot", "full_page": True, "quality": 80, "viewport": {"width": 1280, "height": 720}}{"type": "changeTracking", "modes": ["git-diff"], "tag": "..."}—modesrequired.{"type": "attributes", "selectors": [{"selector": "a", "attribute": "href"}]}
Interact
Why use it
Control the browser session tied to a scrape job. Use for clicks, form fills, code execution, or natural-language instructions after a scrape creates a session. Requiresscrape_id from document.metadata.scrape_id.
Preferred SDK method
client.interact(job_id, code=None, *, prompt=None, language="node", timeout=None)
Example
Parameters
At least one of
code or prompt must be provided.
Stop session: client.stop_interaction(job_id) ends the browser session.
Notes
- Deprecated aliases:
scrape_execute→interact;stop_interactive_browser/delete_scrape_browser→stop_interaction. - The top-level
Firecrawlclient exposes v2 methods directly; v1 remains underclient.v1. FirecrawlAppis a direct alias forFirecrawl.search()location is a plainstr, not aLocationobject (unlikescrape()).SearchRequestmodel defaults:limit=5,timeout=300000.
Source Of Truth
firecrawl/apps/python-sdk/pyproject.tomlfirecrawl/apps/python-sdk/firecrawl/__init__.pyfirecrawl/apps/python-sdk/firecrawl/v2/client.pyfirecrawl/apps/python-sdk/firecrawl/v2/types.pyfirecrawl-docs/api-reference/v2-openapi.json

