Firecrawl Node.js Agent Quickstart
Canonical quickstart for external agents. Generated from SDK source (firecrawl JS SDK) and the v2 OpenAPI spec. Method names and parameters match the SDK public API.
Install
Authenticate
apiKey (falls back to FIRECRAWL_API_KEY env var), apiUrl (falls back to FIRECRAWL_API_URL or https://api.firecrawl.dev), timeoutMs, maxRetries, backoffFactor.
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 ascrapeIdfrom 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?) → Promise<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?) → Promise<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 ascrapeId from document.metadata.scrapeId.
Preferred SDK method
client.interact(jobId, args) → Promise<ScrapeExecuteResponse>
Example
Parameters
Stop the session with
client.stopInteraction(jobId).
Notes
- Deprecated aliases:
scrapeUrl→scrape,scrapeExecute→interact,stopInteractiveBrowser/deleteScrapeBrowser→stopInteraction. - The default
Firecrawlexport is the v2 client. V1 remains underclient.v1. - Plain string
"json"informatsis rejected by the SDK — use{ type: "json", prompt: "..." }. search()returnsSearchDatawith.web,.news,.images— not.data.
Source Of Truth
firecrawl/apps/js-sdk/firecrawl/src/index.tsfirecrawl/apps/js-sdk/firecrawl/src/v2/client.tsfirecrawl/apps/js-sdk/firecrawl/src/v2/types.tsfirecrawl-docs/api-reference/v2-openapi.json

