Skip to main content
Canonical Firecrawl Node.js quickstart for agents. Generated from SDK source (firecrawl v4.38.0) and the v2 OpenAPI spec.

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 a scrapeId from a prior scrape.

Why use it

Discover relevant pages from a query, then pick URLs to scrape or interact with. Constrain results to a site with site: in the query string.

Preferred SDK method

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

Example

Results are grouped by source: results.web, results.news, results.images. Do not access results.data.

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 scrape job. Use for clicks, form fills, code execution, or natural-language browser instructions. Requires a scrapeId from a prior scrape response.

Preferred SDK method

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

Example

Parameters

client.stopInteraction(jobId) ends the browser session. Returns { success, sessionDurationMs?, creditsBilled?, error? }.

Notes

  • Deprecated aliases: scrapeExecuteinteract; stopInteractiveBrowser and deleteScrapeBrowserstopInteraction; scrapeUrlscrape.
  • The default Firecrawl export is the v2 client; v1 remains under client.v1.
  • Zod schemas in formats (for json or changeTracking) are converted to JSON Schema by the SDK.
  • "json" as a plain string in formats is rejected — use { type: "json", prompt?, schema? }.
  • 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