Skip to main content

Firecrawl Node.js Agent Quickstart

Canonical quickstart for external agents integrating Firecrawl with Node.js. Generated from SDK source and OpenAPI spec.

Install

Requires Node.js 22+.

Authenticate

Or set the FIRECRAWL_API_KEY environment variable and omit apiKey:
Constructor options:

When To Use What

  • search: Start with a query, discover relevant URLs, and get their content in one call.
  • scrape: You already have a URL and want its page content as markdown, HTML, JSON, or other formats.
  • interact: The page needs clicks, form fills, or post-scrape browser actions on a live session.

Why use it

Search the web for a query and get scraped content from the top results. Combines discovery and content extraction in one call.

Preferred SDK method

search(query, options?)

Example

Parameters

Response groups results by source: results.web, results.news, results.images, results.developer.

Scrape

Why use it

Get the content of a single URL as markdown, HTML, JSON, screenshots, or other formats.

Preferred SDK method

scrape(url, options?)

Example

Parameters

Format config objects

Interact

Why use it

Control a live browser session tied to a scrape job. Click buttons, fill forms, navigate, and extract dynamic content using code or natural-language prompts.

Preferred SDK method

interact(jobId, args)

Example

Parameters

Stop the session when done:

Notes

  • Parameter names use camelCase (e.g. onlyMainContent, includeTags, scrapeOptions).
  • includeDomains and excludeDomains on search are mutually exclusive.
  • Deprecated aliases (do not use in new code):
    • scrapeExecute() → use interact()
    • stopInteractiveBrowser() / deleteScrapeBrowser() → use stopInteraction()
    • scrapeUrl() → use scrape()
    • crawlUrl() → use crawl()
    • mapUrl() → use map()

Source Of Truth

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