Skip to main content
GET
Search the web
Runs a web search and returns ranked results, optionally scraping each result page in the same call. POST /search takes the same fields as a JSON body, with scrape_options. 2 credits per 10 results, plus what each scraped page costs. Failed requests are never charged.

Guide: Search

Narrowing a search, scraping results, partial failures and examples.

Authorizations

X-API-Key
string
header
required

Your Prefetch API key. Obtain one from the dashboard.

Query Parameters

query
string
required

What to search for, as you would type it into Google (1–400 characters). Search operators work ("exact phrase", -word, filetype:pdf). q is accepted too.

Example:

"best open source CRM"

limit
string

Results to return (1–50; 1–10 when results are scraped). Default: 10.

Example:

"10"

type
enum<string>

web (default) or news — recent articles with their publisher and date.

Available options:
web,
news
country
string

Two-letter country code to search from, e.g. us, de.

Example:

"us"

language
string

Two-letter language code for the results, e.g. en, de.

Example:

"en"

location
string

A city or region to search from, e.g. Berlin, Germany.

time_range
enum<string>

Only results from the past hour, day, week, month or year.

Available options:
hour,
day,
week,
month,
year
include_domains
string

Comma-separated domains to search within (up to 10).

Example:

"github.com,gitlab.com"

exclude_domains
string

Comma-separated domains to leave out (up to 10).

Example:

"pinterest.com"

formats
string

Scrape each result page into these formats (the /scrape formats: markdown, summary, html, raw_html, links, images, json, screenshot). Omit to return search results only.

Example:

"markdown"

only_main_content
string

With formats: strip navigation, sidebars and footers from each page. Default: true.

max_age
string

With formats: accept a stored copy of a page fetched at most this many milliseconds ago.

Example:

"86400000"

timeout
string

Give up after this many milliseconds (5,000–45000). Result pages still loading are returned with a scrape_error and not charged.

Example:

"30000"

Response

Results, best first.

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object
required