Skip to main content

Vercel Functions

Use Firecrawl with Vercel Functions to search, scrape, and interact with web data in serverless deployments.
1 min read

Prerequisites#

  • Vercel project (Next.js, SvelteKit, Nuxt, or standalone)
  • A Firecrawl API key — get one free

Setup#

Add FIRECRAWL_API_KEY as an environment variable in your Vercel project settings, or in .env.local for local development:

Search the web#

Create api/search.ts (or app/api/search/route.ts for Next.js):

Scrape a page#

Create api/scrape.ts (or app/api/scrape/route.ts for Next.js):

Interact with a page#

Create api/interact.ts (or app/api/interact/route.ts for Next.js):

Deploy#

Test it#

Note

Vercel Functions have a default timeout of 10 seconds on the Hobby plan and 60 seconds on Pro. For large crawl jobs, use the Firecrawl async API with webhooks instead.

Next steps#