SerpBase
POST only

API Documentation

Structured web results, documented request parameters and explicit response status.

Base URL
https://api.serpbase.dev
Auth header
X-API-Key: <API_KEY>
Billing
Per-request catalog price; executed failures may be charged
Authentication

Send POST JSON requests and pass your API key in the X-API-Key header. The response body is JSON for both success and failure cases.

elapsed_ms

Common response envelope

credits_charged

Per-request catalog price; executed failures may be charged

request_id

support trace id

Minimal request
bash
curl -X POST https://api.serpbase.dev/google/search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key" \
  -d '{"q":"openai realtime api","hl":"en","gl":"us","device":"default"}'

Automatic account QPS upgrades

After an eligible top-up is confirmed as credited, cumulative USD thresholds raise account QPS to at least: $3 → 2, $50 → 5, $200 → 15, $1,000 → 50, $10,000 → 500. Below $3, your current account limit is unchanged. Upgrades only raise the limit; they never lower an existing higher limit. This is not unlimited QPS.

Cumulative eligible top-ups (USD)Upgrade to at least (QPS)
≥ $32 QPS
≥ $505 QPS
≥ $10010 QPS
≥ $20015 QPS
≥ $1,00050 QPS
≥ $10,000500 QPS

Only USD credit-pack (credit_pack) and automatic top-up (auto_topup) payments confirmed as credited count. Subscriptions (including Starter Boost), gifts and gift codes do not count. Credit balances are not cumulative USD payments. Non-USD payments are not counted as USD without currency conversion.

All API keys, products and gateways for the same account share one QPS limit. Creating more keys does not increase it.

Eligible top-ups automatically raise account QPS after confirmed crediting, not merely after returning from checkout. The current limit is the server-reported value shown in your account; API key synchronization may briefly lag.

Agent integrations

Use the open-source MCP server or portable agent skill when you want Claude, Codex, Cursor, Cline/Roo, opencode, or other agents to call SerpBase directly with your API key.

MCP config
json
{
  "mcpServers": {
    "serpbase": {
      "command": "python",
      "args": ["-m", "serpbase_mcp"],
      "env": {
        "SERPBASE_API_KEY": "your_api_key"
      }
    }
  }
}
Skill prompt
text
Use $serpbase-skill to search Google through SerpBase and return cited structured results.
Account balance

Retrieve the current credit balance for the account that owns an active API key. This request does not consume search credits.

GET
0 credits
/account/credits

Pass the key in the X-API-Key header. API keys in URL query parameters are not accepted.

bash
curl https://api.serpbase.dev/account/credits \
  -H "X-API-Key: your_api_key"
json
{
  "status": 0,
  "credits": 12345,
  "permanent_credits": 10000,
  "expiring_credits": 2345,
  "expiring_expires_at": 1798761600
}

The endpoint is limited to 60 requests per minute per account. expiring_expires_at is a Unix timestamp in seconds and is 0 when no limited-time credits are active.

Common response envelope

Successful endpoint responses return the same top-level metadata. Endpoint-specific data lives in one result key such as organic, images, news, videos, places, or place.

status
required
number

required

Business status code. 0 means success.

request_id
required
string

required

Stable request identifier for support, retries, and log correlation.

elapsed_ms
required
number

required

Gateway-observed execution duration in milliseconds.

credits_charged
required
number

required

Credits charged after refund logic is applied.

search_type
required
string

required

Resolved type: search, images, news, videos, maps_search, or maps_detail.

Endpoints
POST
/google/image/search

Images

Image result URLs, thumbnails, source pages, and domains.

type
images
result
images
Billing
2 credits
Parameters
q
required
string

required

Search query string.

hl
optional
string

optional

Language code. Defaults to en.

gl
optional
string

optional

Country code. Defaults to us.

page
optional
number

optional

1-based page number. Defaults to 1.

Response fields
query
required
string

required

Normalized query from the request.

page
required
number

required

Current 1-based page number.

images
optional
ImageResult[]

When image results are parsed.

Google Images results.

ImageResult Result item schema
rank
required
number

required

1-based ranking position in this response.

position
optional
number

Alias for rank when available.

Normalized rank alias for clients that expect position.

title
optional
string

When image title or alt text is parsed.

Result title.

link
required
string

required

Primary link returned by the parser.

url
optional
string

Present for normalized result links.

Canonical target URL, usually the same value as link.

source_url
optional
string

Only when Google redirect/source URL is observed.

Original Google URL kept for debugging and provenance.

display_url
optional
string

When Google display text or a domain can be derived.

Display URL or source domain.

image_url
required
string

required

Full image URL.

thumbnail_url
optional
string

When Google exposes a thumbnail.

Thumbnail URL.

thumbnail
optional
string

Alias for thumbnail_url when available.

Normalized thumbnail alias.

source
optional
string

When source text is parsed.

Image source label.

domain
optional
string

When source page domain can be derived.

Source page domain.

Multi-Language Code & Response Examples
bash
curl -X POST https://api.serpbase.dev/google/image/search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key" \
  -d '{
    "q": "iphone 15 pro blue",
    "hl": "en",
    "gl": "us",
    "page": 1
  }'
Notes

Visual search, product monitoring, image source discovery.

Some Google Images payload shapes expose rank/link but not every normalized alias. Treat url, display_url, source_url, position, and thumbnail as optional.

POST
/google/news/search

News

News articles with publisher, time text, snippets, and thumbnails.

type
news
result
news
Billing
1 credits
Parameters
q
required
string

required

Search query string.

hl
optional
string

optional

Language code. Defaults to en.

gl
optional
string

optional

Country code. Defaults to us.

page
optional
number

optional

1-based page number. Defaults to 1.

Response fields
query
required
string

required

Normalized query from the request.

page
required
number

required

Current 1-based page number.

news
optional
NewsResult[]

When news results are parsed.

Google News results.

NewsResult Result item schema
rank
required
number

required

1-based ranking position in this response.

position
optional
number

Alias for rank when available.

Normalized rank alias for clients that expect position.

title
required
string

required

Result title.

link
required
string

required

Primary link returned by the parser.

url
optional
string

Present for normalized result links.

Canonical target URL, usually the same value as link.

source_url
optional
string

Only when Google redirect/source URL is observed.

Original Google URL kept for debugging and provenance.

display_url
optional
string

When Google display text or a domain can be derived.

Display URL or source domain.

source
optional
string

When publisher text is parsed.

Publisher/source label.

time
optional
string

When Google exposes time text.

Raw published time text.

published_at
optional
string

Alias for parsed time when available.

Normalized published time alias.

snippet
optional
string

When a snippet is parsed.

Article summary snippet.

thumbnail_url
optional
string

When Google exposes a thumbnail.

Thumbnail URL.

thumbnail
optional
string

Alias for thumbnail_url when available.

Normalized thumbnail alias.

Multi-Language Code & Response Examples
bash
curl -X POST https://api.serpbase.dev/google/news/search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key" \
  -d '{
    "q": "apple event",
    "hl": "en",
    "gl": "us",
    "page": 1
  }'
Notes

Brand monitoring, trend tracking, media discovery.

Source and time are parsed from compact Google metadata text, so clients should treat both as optional.

POST
/google/videos/search

Videos

Video result links with source, duration, time, and thumbnails.

type
videos
result
videos
Billing
1 credits
Parameters
q
required
string

required

Search query string.

hl
optional
string

optional

Language code. Defaults to en.

gl
optional
string

optional

Country code. Defaults to us.

page
optional
number

optional

1-based page number. Defaults to 1.

Response fields
query
required
string

required

Normalized query from the request.

page
required
number

required

Current 1-based page number.

videos
optional
VideoResult[]

When video results are parsed.

Google Videos results.

VideoResult Result item schema
rank
required
number

required

1-based ranking position in this response.

position
optional
number

Alias for rank when available.

Normalized rank alias for clients that expect position.

title
required
string

required

Result title.

link
required
string

required

Primary link returned by the parser.

url
optional
string

Present for normalized result links.

Canonical target URL, usually the same value as link.

source_url
optional
string

Only when Google redirect/source URL is observed.

Original Google URL kept for debugging and provenance.

display_url
optional
string

When Google display text or a domain can be derived.

Display URL or source domain.

source
optional
string

When source/channel can be parsed.

Video source or channel label.

duration
optional
string

When duration appears in result text.

Video duration text.

time
optional
string

When posted time can be parsed.

Raw posted time text.

published_at
optional
string

Alias for parsed time when available.

Normalized posted time alias.

thumbnail_url
optional
string

When Google exposes a thumbnail.

Thumbnail URL.

thumbnail
optional
string

Alias for thumbnail_url when available.

Normalized thumbnail alias.

Multi-Language Code & Response Examples
bash
curl -X POST https://api.serpbase.dev/google/videos/search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key" \
  -d '{
    "q": "python asyncio tutorial",
    "hl": "en",
    "gl": "us",
    "page": 1
  }'
Notes

Video search, tutorial discovery, media monitoring.

If no dedicated video cards are parsed, the parser falls back to news-style extraction for compatible Google layouts.

POST
/google/maps/detail

Maps Detail

Single place details by Google Maps feature_id.

type
maps_detail
result
place
Billing
2 credits
Parameters
feature_id
required
string

required

Use the feature_id field returned by Maps Search place results. It is formatted like 0x...:0x....

hl
optional
string

optional

Language code. Defaults to en.

gl
optional
string

optional

Country code. Defaults to us.

Response fields
feature_id
required
string

required

Feature id resolved from the Maps detail request.

page
required
number

required

Always 1 for maps detail.

place
optional
MapsPlace

When place details are parsed.

Single place detail object.

MapsPlace Result item schema
position
optional
number

Maps Search only.

Place rank in the local result list.

name
required
string

required

Place name.

title
required
string

required

Alias for name.

feature_id
required
string

required

Google Maps feature id.

place_id
optional
string

When Google exposes it.

Google place id.

data_id
optional
string

Alias for feature_id.

Maps data id.

cid
optional
string

Derived from feature_id when possible.

Google CID.

kgmid
optional
string

When present in Maps payload.

Knowledge graph machine id.

google_maps_url
optional
string

When Google exposes a Maps URL.

Google Maps URL.

url
optional
string

google_maps_url or website fallback.

Primary place URL.

rating
optional
number

When rating is present.

Google rating.

types
optional
string[]

When categories are present.

Place type labels.

category
optional
object

When category block is parsed.

Structured category data.

address
optional
string

When address is present.

Formatted address.

address_components
optional
object

When components are present.

Street, city, postal code, country code.

plus_code
optional
object

When plus code is present.

Global and compound plus codes.

phone
optional
string

When phone is present.

Local phone number.

phone_international
optional
string

When present.

International phone number.

phone_uri
optional
string

When present.

Telephone URI.

website
optional
string

When website is present.

Business website.

website_domain
optional
string

When website domain is present.

Business website domain.

latitude
optional
number

When coordinates are present.

Latitude.

longitude
optional
number

When coordinates are present.

Longitude.

image
optional
string

When image is present.

Primary place image.

thumbnail
optional
string

Alias for image when available.

Primary image alias.

photos
optional
MapsPhoto[]

When photos are parsed.

Photo id, URL, size, and optional coordinates.

hours
optional
Record<string,string>

When hours are parsed.

Opening hours by day.

open_status
optional
object

When status is present.

Open status text and current hours.

attributes
optional
object[]

When attributes are parsed.

Grouped place attributes.

related_places
optional
object[]

When related places are present.

Related places from Maps payload.

short_description
optional
string

When description block is present.

Short place description.

description
optional
string

When description block is present.

Longer place description.

snippet
optional
string

short_description or description fallback.

Normalized text summary.

timezone
optional
string

When present.

Place timezone.

region
optional
string

When present.

Region label.

country_code
optional
string

When present.

Country code.

language
optional
string

When present.

Language code from Maps payload.

Multi-Language Code & Response Examples
bash
curl -X POST https://api.serpbase.dev/google/maps/detail \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key" \
  -d '{
    "feature_id": "0x8085809c2c6fdc63:0x4b3f2d70e4f5a123",
    "hl": "en",
    "gl": "us"
  }'
Notes

Place enrichment, local CRM data, detail pages.

Use the feature_id field from a Maps Search place result to request a detail record. A well-formed but unknown feature_id returns status 1004.

Errors
error
required
string

required

Human-readable failure message.

0
SUCCESS

Request completed successfully.

1000
INVALID_REQUEST

Missing or invalid body or parameters.

1001
UNAUTHORIZED

Missing, invalid, or revoked API key.

1004
NOT_FOUND

Resource not found. For Maps Detail, the feature_id is well-formed but no place was found.

1020
INSUFFICIENT_CREDITS

Account balance is not enough.

1029
RATE_LIMITED

QPS or concurrency limit exceeded.

1500
INTERNAL_ERROR

Unexpected internal server error.

1502
UPSTREAM_FAILED

Worker returned an upstream fetch or parse error.

1503
SERVICE_UNAVAILABLE

No worker session is available.

1504
UPSTREAM_TIMEOUT

Gateway timed out waiting for a worker result.

json
{
  "status": 1001,
  "error": "unauthorized",
  "request_id": "0f3576b2-6e2e-4f1e-bb0e-8cb0d4a60195",
  "elapsed_ms": 0,
  "credits_charged": 0
}
Privacy and retention
Search queries may be logged for billing, debugging, abuse prevention, and account logs. See the privacy page for retention details.
API Documentation | SerpBase