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"}'
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
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.