Skip to content

SerpApi

SerpApi provides real-time search engine results from Google, Bing, Yahoo, Yandex, Baidu, and more. It handles proxies, solves CAPTCHAs, and returns structured JSON.

Official SerpApi Search API · Account API · Locations API

KeyPool Base URL

{YOUR_KEYPOOL_BASE_URL}/v1/serpapi

Authentication

Authenticate to KeyPool with a team token:

Authorization: Bearer ${KEYPOOL_TOKEN}

Do NOT pass api_key yourself. Use only your KeyPool team token.

Quick Start

curl -G "${KEYPOOL_BASE_URL}/v1/serpapi/search.json" \
  -H "Authorization: Bearer ${KEYPOOL_TOKEN}" \
  --data-urlencode "engine=google" \
  --data-urlencode "q=coffee shops near me" \
  --data-urlencode "num=5"

Python (httpx)

import httpx
import os

KEYPOOL_BASE_URL = os.environ["KEYPOOL_BASE_URL"]
KEYPOOL_TOKEN = os.environ["KEYPOOL_TOKEN"]

response = httpx.get(
    f"{KEYPOOL_BASE_URL}/v1/serpapi/search.json",
    headers={"Authorization": f"Bearer {KEYPOOL_TOKEN}"},
    params={"engine": "google", "q": "coffee shops near me", "gl": "us"},
)
data = response.json()
for result in data.get("organic_results", []):
    print(result["title"], result["link"])

TypeScript (fetch)

const KEYPOOL_BASE_URL = process.env.KEYPOOL_BASE_URL;
const KEYPOOL_TOKEN = process.env.KEYPOOL_TOKEN;

const params = new URLSearchParams({
  engine: "google",
  q: "coffee shops near me",
  gl: "us",
  num: "5",
});

const response = await fetch(
  `${KEYPOOL_BASE_URL}/v1/serpapi/search.json?${params}`,
  {
    headers: { Authorization: `Bearer ${KEYPOOL_TOKEN}` },
  }
);

const data = await response.json();
for (const result of data.organic_results ?? []) {
  console.log(result.title, result.link);
}

Supported Engines

Engine Description
google Google Search
bing Bing Search
yahoo Yahoo Search
yandex Yandex Search
baidu Baidu Search
duckduckgo DuckDuckGo Search

Common Parameters

Parameter Type Description
engine string Search engine (required)
q string Search query
num integer Results per page (default 10)
start integer Result offset for pagination
device string desktop, tablet, or mobile
gl string Country code (e.g. us, gb, de)
hl string Language code (e.g. en, fr, de)
location string Location string for geo-targeting
tbm string Search type: isch (images), nws (news), shop (shopping), vid (video)
tbs string Time filter: qdr:h (past hour), qdr:d (past day), qdr:w (past week)
no_cache boolean Bypass SerpApi cache for fresh results
output string json, html, or md response format

Search Types

curl -G "${KEYPOOL_BASE_URL}/v1/serpapi/search.json" \
  -H "Authorization: Bearer ${KEYPOOL_TOKEN}" \
  --data-urlencode "engine=google" \
  --data-urlencode "tbm=isch" \
  --data-urlencode "q=puppies"
curl -G "${KEYPOOL_BASE_URL}/v1/serpapi/search.json" \
  -H "Authorization: Bearer ${KEYPOOL_TOKEN}" \
  --data-urlencode "engine=google" \
  --data-urlencode "tbm=nws" \
  --data-urlencode "q=bitcoin" \
  --data-urlencode "tbs=qdr:d"
curl -G "${KEYPOOL_BASE_URL}/v1/serpapi/search.json" \
  -H "Authorization: Bearer ${KEYPOOL_TOKEN}" \
  --data-urlencode "engine=google" \
  --data-urlencode "tbm=shop" \
  --data-urlencode "q=mechanical keyboard"

Account & Usage

Check account status and remaining searches:

curl "${KEYPOOL_BASE_URL}/v1/serpapi/account.json" \
  -H "Authorization: Bearer ${KEYPOOL_TOKEN}"

Locations

List available geo-targeting locations. The provider documents a maximum limit of 10:

curl "${KEYPOOL_BASE_URL}/v1/serpapi/locations.json?q=Austin&limit=3" \
  -H "Authorization: Bearer ${KEYPOOL_TOKEN}"

The official API also supports Markdown output and more search engines than the examples above. The KeyPool public spec remains intentionally curated around the verified routed surface; no provider-published OpenAPI schema is currently exposed.

API Reference

See the SerpApi API Reference for full parameter documentation per engine.