Skip to main content
Canonical Firecrawl Node.js quickstart for external agents. Aligned with firecrawl v4.32.0 (firecrawl/apps/js-sdk/firecrawl) and the v2 OpenAPI spec. Method names, parameters, and types match the SDK public API.

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 other browser actions after a scrape has created a session. For multi-step interactive flows, prefer interact over scrape-time actions.

Why use it

Use search to discover relevant pages from a query, then pick URLs to scrape or interact with. You can constrain results to a site with site:, for example site:docs.firecrawl.dev crawl webhooks.

Preferred SDK method

client.search(query, options?)Promise<SearchData>

Example

Parameters

Return value: SearchData with optional arrays web, news, images, developer. Do not access result.data — it throws an error directing you to use result.web, result.news, etc.

Scrape

Why use it

Use scrape when you already have a URL and want structured content in one or more formats.

Preferred SDK method

client.scrape(url, options?)Promise<Document>

Example

Parameters

Interact

Why use it

Use interact for code or natural-language control of the browser session tied to a scrape job (via metadata.scrapeId). The SDK requires at least one of code or prompt. For flows that go beyond quick pre-scrape tweaks, prefer interact over scrape-time actions.

Preferred SDK method

client.interact(jobId, args)Promise<ScrapeExecuteResponse>

Example

Parameters

Stop session

client.stopInteraction(jobId)Promise<ScrapeBrowserDeleteResponse> Ends the scrape-bound browser session. Response includes success, sessionDurationMs, creditsBilled.

Notes

  • Deprecated aliases: scrapeExecuteinteract; stopInteractiveBrowser and deleteScrapeBrowserstopInteraction; scrapeUrlscrape.
  • The default Firecrawl export is the v2 client; v1 remains under client.v1.
  • Zod schemas passed to formats (for json or changeTracking) are converted to JSON Schema by the SDK.
  • The package declares Node.js >= 22 in engines.

Source Of Truth

  • firecrawl/apps/js-sdk/firecrawl/package.json
  • firecrawl/apps/js-sdk/firecrawl/src/index.ts
  • firecrawl/apps/js-sdk/firecrawl/src/v2/client.ts
  • firecrawl/apps/js-sdk/firecrawl/src/v2/types.ts
  • firecrawl-docs/api-reference/v2-openapi.json