Install Firecrawl from the Vercel Marketplace, attach it to a project, and use the injected FIRECRAWL_API_KEY in your Vercel app.
Firecrawl is available as a native Vercel Marketplace integration. Installing it provisions Firecrawl for your Vercel project and adds FIRECRAWL_API_KEY to the project’s environment variables automatically.Use this guide when you want Firecrawl billing, API key setup, and project configuration to happen through Vercel.
When you install Firecrawl from the Vercel Marketplace, Vercel connects Firecrawl to a selected project and makes the API key available as an environment variable.
Provisions a Firecrawl account and API key through the Marketplace flow
Adds FIRECRAWL_API_KEY to your Vercel project environment
Keeps Firecrawl billing on your Vercel invoice
Lets you open Firecrawl from Vercel after the integration is connected
If you already have a Firecrawl API key and want to configure Vercel manually, use the Vercel Functions quickstart instead.
Use interact when your app needs to click, scroll, or fill forms before extracting content.
import { NextResponse } from "next/server";import { Firecrawl } from "firecrawl";const firecrawl = new Firecrawl({ apiKey: process.env.FIRECRAWL_API_KEY,});export async function POST() { const result = await firecrawl.scrape("https://news.ycombinator.com", { formats: ["markdown"], }); const scrapeId = result.metadata?.scrapeId; if (!scrapeId) { return NextResponse.json( { error: "No interactive scrape session was created" }, { status: 500 } ); } const response = await firecrawl.interact(scrapeId, { prompt: "Open the first story and summarize the page.", }); await firecrawl.stopInteraction(scrapeId); return NextResponse.json({ output: response.output });}
Longer interactions can exceed short serverless timeouts. For production workflows that may take longer, run the work in a background job or use Firecrawl’s async APIs with webhooks.
If you are building an agent with the Vercel AI SDK, install the Firecrawl AI SDK tools:
npm install firecrawl-aisdk ai
Then pass Firecrawl tools to your model. The Marketplace-installed FIRECRAWL_API_KEY is read from the environment.
The example below uses the Vercel AI Gateway model string format. Configure your AI SDK model provider or AI Gateway credentials separately.
import { generateText, stepCountIs } from "ai";import { FirecrawlTools } from "firecrawl-aisdk";const { text } = await generateText({ model: "anthropic/claude-sonnet-4-5", tools: FirecrawlTools(), stopWhen: stepCountIs(20), prompt: "Search for recent Vercel AI SDK examples, scrape the best sources, and summarize them.",});console.log(text);