Skip to main content

Prerequisites

  • Next.js 14+ project (App Router)
  • A Firecrawl API key — get one free

Install the SDK

Set your API key

Add your API key to .env.local:

Search the web

The SDK should only run server-side since it requires your API key.

Route Handler

Create app/api/search/route.ts:

Server Action

Create app/actions.ts for use from Client Components:

Scrape a page

Route Handler

Create app/api/scrape/route.ts:

Server Component

Fetch data directly in a Server Component at app/page.tsx:

Interact with a page

Use interact to control a live browser session — click buttons, fill forms, and extract dynamic content.

Route Handler

Create app/api/interact/route.ts:

Next steps

Scrape docs

All scrape options including formats, actions, and proxies

Search docs

Search the web and get full page content

Interact docs

Click, fill forms, and extract dynamic content

Node SDK reference

Full SDK reference with crawl, map, batch scrape, and more