serp·base API Documentation

Google organic results

Google organic SERP: positions, titles, URLs, snippets, breadcrumbs.

$1.00 / 1,000 POST /v1/query x402 · USDC on Base

Overview

Single endpoint, predictable JSON. Send POST /v1/query with the tool field set to google_web.

curl -X POST https://api.serp-base.com/v1/query \
  -H "Content-Type: application/json" \
  -d '{"tool": "google_web", "query": "coffee shops San Francisco"}'

Parameters

FieldTypeRequiredDescriptionExample
querystringrequiredSearch phrasecoffee shops San Francisco
geoint|stringoptionalRegion code or name (see Regions)us, 84, new york
depthintoptionalResults count, 10..100 (multiples of 10)10, 30, 100
devicestringoptionaldesktop | mobile | tabletdesktop
langstringoptionalInterface/content languageen, de, fr
countrystringoptionalCountry code for the regionus, gb, de
blocksstring[]optionalExtra SERP blocks to include (see below)["sitelinks","faq"]

Extra SERP blocks optional

Request additional blocks in one call — pass an array in blocks:

{"tool": "google_web", "query": "...", "blocks": ["sitelinks"]}
sitelinksoneline_sitelinksknowledge_graphtopadsbottomadscache_linkextended_snippetfaqanswerboxinline_shoppingvideospodcastsnews_blockdiscussapponebox

Regions optional

Pass either a numeric code or a name. Common examples:

RegionCode
United Statesus / 2840
New York84 / new york
London1000000 / london
Berlin96 / berlin
Paris225 / paris

Code examples

cURL

curl -X POST https://api.serp-base.com/v1/query \
  -H "Content-Type: application/json" \
  -d '{"tool": "google_web", "query": "coffee shops San Francisco", "geo": "us", "depth": 10}'

Python

import requests

r = requests.post("https://api.serp-base.com/v1/query", json={
  "tool": "google_web",
  "query": "coffee shops San Francisco",
  "geo": "us",
  "depth": 10
})
print(r.json()["data"])

JavaScript

const r = await fetch('https://api.serp-base.com/v1/query', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
  "tool": "google_web",
  "query": "coffee shops San Francisco",
  "geo": "us",
  "depth": 10
})
});
const { data } = await r.json();

PHP

$ch = curl_init('https://api.serp-base.com/v1/query');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
  CURLOPT_POSTFIELDS => '{"tool": "google_web", "query": "coffee shops San Francisco", "geo": "us", "depth": 10}',
  CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);

Response

{
  "ok": true,
  "tool": "google_web",
  "paid_via": "x402",
  "network": "base",
  "data": {
    "found": 100,
    "count": 10,
    "results": [
      {
        "position": 1,
        "url": "https://...",
        "title": "...",
        "snippet": "...",
        "content_type": "organic"
      }
    ]
  }
}

Payment

Pay per request with USDC on Base via the x402 protocol. Gas is paid by the facilitator — you only need USDC in your wallet.

No payment is taken when a service fails. We run the work first and settle afterwards.

Errors

CodeMeaningAction
402Payment requiredSign the payment and retry with X-PAYMENT
400Bad parametersCheck required fields above
422Data could not be producedNothing charged — retry later
429Rate limitedBack off and retry
503Tool temporarily unavailableRetry later — nothing charged

Related tools

Yandex organic results · Google images · Yandex images · News · Shopping · Suggestions

Pay-per-request data APIs. Built for agents and developers.