Skip to main content

Firecrawl Node.js Agent Quickstart

This file is the canonical quickstart for external agents integrating with Firecrawl using the Node.js/TypeScript SDK. It is generated from SDK source and OpenAPI spec.

Install

Authenticate

The API key can also be set via the FIRECRAWL_API_KEY environment variable. Omitting the key uses the keyless free tier (rate-limited per IP). Client options:

When To Use What

  • search: Use when you start with a query and need to discover relevant pages. Returns ranked results with optional scraping of each result.
  • scrape: Use when you already have a URL and want its content in markdown, HTML, JSON, or other formats.
  • interact: Use when a page needs post-scrape browser actions — clicking, filling forms, running code, or prompting an AI agent in the browser.

Why use it

Search the web for a query and get back ranked results. Optionally scrape each result page inline by passing scrapeOptions.

Preferred SDK method

Example

Parameters

Returns: SearchData with optional .web, .news, and .images arrays depending on sources.

Scrape

Why use it

Scrape a single URL and get its content as markdown, HTML, structured JSON, screenshots, or other formats.

Preferred SDK method

Example

Parameters

Returns: Document with fields like markdown, html, rawHtml, links, images, screenshot, metadata, etc.

Interact

Why use it

Execute code or send a natural-language prompt in the browser session of a previous scrape job. Use this for clicking buttons, filling forms, navigating multi-step flows, or running arbitrary JavaScript/Python/Bash in the browser sandbox.

Preferred SDK method

Example

Parameters

Returns: ScrapeExecuteResponse with success, stdout, stderr, result, exitCode, killed, error, and optional liveViewUrl / interactiveLiveViewUrl. Stop the session:

Notes

  • All parameter names use camelCase (e.g. onlyMainContent, skipTlsVerification, scrapeOptions).
  • includeDomains and excludeDomains on search are mutually exclusive.
  • The SearchData return type has .web, .news, and .images arrays. Accessing .data throws a helpful migration error.
  • Deprecated aliases (use the preferred names instead):
    • scrapeUrl()scrape()
    • scrapeExecute()interact()
    • stopInteractiveBrowser() / deleteScrapeBrowser()stopInteraction()

Source Of Truth

  • 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