Home/Tools/firecrawl-aisdk

searchTool

firecrawl-aisdk

Search the web for URLs, titles, and snippets matching a query. Best for: Discovering relevant pages when you don't know the exact URL. Returns full page content per result — use limit: 2-3 to keep responses small. If a scrape tool is available, prefer search with limit: 2 for discovery, then scrape individual URLs. Supports search operators: site:, inurl:, intitle:, related:, etc. Do NOT pass scrapeOptions unless you specifically need to customize scraping behavior.

by firecrawl

search
v0.10.0
MIT

Interactive Playground

Test firecrawl-aisdk (searchTool) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install firecrawl-aisdk
pnpm add firecrawl-aisdk
yarn add firecrawl-aisdk
bun add firecrawl-aisdk
deno add npm:firecrawl-aisdk

2. Import the tool

import { searchTool } from 'firecrawl-aisdk';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { searchTool } from 'firecrawl-aisdk';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { searchTool },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Signature

(query: string, tbs?: string, limit?: number, country?: string, sources?: { tbs: string; type: string; location: string }[], timeout?: number, location?: string, categories?: { type: string }[], scrapeOptions?: { proxy: string; maxAge: number; mobile: boolean; actions: { key: string; text: string; type: string; script: string; fullPage: boolean }[]; formats: {  }[] }, ignoreInvalidURLs?: boolean) => Promise<unknown>

Tags

ai
ai-sdk
aisdk
best
discovering
firecrawl
llm
matching
query
relevant
search
snippets
titles
urls
vercel
web
web-scraping
web-search

Parameters

Available configuration options

Auto-extracted
query
Required
Type: string

The search query. Supports operators like site:, inurl:, intitle:, etc.

limit
Optional
Type: integer

Maximum number of search results to return. Default: 5

sources
Optional
Type: array

Sources to search: web, images, news. Each source can have its own tbs and location filter

categories
Optional
Type: array

Filter by categories: github (repositories), research (academic), pdf (PDFs)

tbs
Optional
Type: string

Time-based search: qdr:h (hour), qdr:d (day), qdr:w (week), qdr:m (month), qdr:y (year)

location
Optional
Type: string

Location for search results (e.g., "San Francisco,California,United States")

country
Optional
Type: string

ISO country code for geo-targeting (e.g., "US", "DE"). Default: "US"

timeout
Optional
Type: number

Timeout in milliseconds. Default: 60000

ignoreInvalidURLs
Optional
Type: boolean

Exclude invalid URLs from results. Default: false

scrapeOptions
Optional
Type: object

Options for scraping the search results

Schema extracted: 3/1/2026, 1:19:34 AM

Statistics

Downloads/month

8,908

GitHub Stars

0

Quality Score

84%

Bundle Size

NPM Keywords

ai
ai-sdk
vercel
firecrawl
web-scraping
web-search
tools
llm

Maintainers

hello_sideguide(hello@sideguide.dev)

Frameworks

vercel-ai
searchTool | TPMJS | TPMJS