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
Createapp/api/search/route.ts:
Server Action
Createapp/actions.ts for use from Client Components:
Scrape a page
Route Handler
Createapp/api/scrape/route.ts:
Server Component
Fetch data directly in a Server Component atapp/page.tsx:
Interact with a page
Use interact to control a live browser session — click buttons, fill forms, and extract dynamic content.Route Handler
Createapp/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

