Skip to main content

Firecrawl Node.js Agent Quickstart

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

Install

Authenticate

Or set the FIRECRAWL_API_KEY environment variable and omit apiKey:

When To Use What

  • search — Use when you start with a query and need to discover relevant pages. Returns web results, news, images, and optionally scraped page content.
  • scrape — Use when you already have a URL and want structured page content (markdown, HTML, JSON extraction, screenshots, etc.).
  • interact — Use when a page needs browser automation after scraping — clicks, form fills, or post-scrape dynamic content extraction.

Why use it

Search the web for a query and get results with titles, URLs, descriptions, and optionally full page content. Supports filtering by domain, time range, category, and source type.

Preferred SDK method

Example

Parameters

Scrape

Why use it

Scrape a URL and get its content in your chosen format — markdown, HTML, JSON (with schema-based extraction), screenshots, and more. Supports browser actions, caching, proxies, and PDF parsing.

Preferred SDK method

Example

Parameters

Interact

Why use it

After scraping a page, interact with it in a live browser session — execute code or natural-language prompts to click buttons, fill forms, navigate, and extract dynamic content.

Preferred SDK method

Example

Parameters

Stopping an interaction

Call app.stopInteraction(jobId) to close the browser session and stop billing.

Notes

  • Deprecated aliases: scrapeUrl → scrape, scrapeExecute → interact, stopInteractiveBrowser / deleteScrapeBrowser → stopInteraction. Always use the preferred names.
  • Parameter naming: All parameters use camelCase.
  • Package name: firecrawl (npm).
  • Import: import { Firecrawl } from "firecrawl".
  • Base URL: Defaults to https://api.firecrawl.dev. Override with apiUrl in the constructor for self-hosted instances.

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/v2/methods/scrape.ts
  • firecrawl/apps/js-sdk/firecrawl/src/v2/methods/search.ts
  • firecrawl-docs/api-reference/v2-openapi.json