web search

Google Search API

Real-time Google SERP data: organic results, ads, related searches, inline questions, knowledge graph, and answer boxes as structured JSON.

GET/api/public/v1/google-search
price
$0.005
atomic
5000
free tier
3 calls / agent
chain
base mainnet
asset
USDC
scheme
exact

agent brief

Give a query, get ranked organic results with title, link, snippet, plus knowledge graph and related searches.

engine: google · results key: organic_results · settlement: USDC / base / exact

use this when you need to

  • -Ground an answer in live web results
  • -Collect citations with URLs
  • -Competitive SERP monitoring

query parameters

nametyperequireddescription
networkbase | base-sepoliano · default "base"Payment network. base-sepolia returns mock data for testing.
qstringyesSearch query
locationstringnoLocalization, e.g. Austin,Texas,United States
glstringno · default "us"Country code for results
hlstringno · default "en"UI/interface language code
numintegerno · default "10"Number of results to return
pageintegernoPage number for pagination

call it — curl

bash
# Free tier — first 3 calls per agent identity, no payment header
curl "https://marketplaceforaiagents.com/api/public/v1/google-search?q=AI+agents"

# Sandbox — signed testnet USDC, mock response, no real spend
curl "https://marketplaceforaiagents.com/api/public/v1/google-search?q=AI+agents&network=base-sepolia" \
  -H "X-PAYMENT: <base64 signed base-sepolia USDC authorization>"

# Production — signed x402 payment header, real data
curl "https://marketplaceforaiagents.com/api/public/v1/google-search?q=AI+agents" \
  -H "X-PAYMENT: <base64 signed USDC authorization>"

call it — typescript + x402-fetch

typescript
import { wrapFetchWithPayment } from "x402-fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`);
const fetchWithPayment = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPayment(
  "https://marketplaceforaiagents.com/api/public/v1/google-search?q=AI+agents"
);
const data = await res.json();
console.log(data.organic_results);

response — 200 ok

application/json
{
  "search_metadata": {
    "id": "search_...",
    "status": "Success"
  },
  "search_parameters": {
    "engine": "google",
    "q": "x402 protocol"
  },
  "organic_results": [
    {
      "position": 1,
      "title": "x402 — an open protocol for internet payments",
      "link": "https://x402.org/",
      "snippet": "x402 is an open protocol..."
    }
  ],
  "related_searches": [
    {
      "query": "x402 usdc base"
    }
  ]
}

status codes

200data returned, response includes X-PAYMENT-RESPONSE receipt when paid
400missing or invalid required parameters
402free tier exhausted or invalid X-PAYMENT — body contains accepts[] payment requirements
404unknown endpoint slug
429upstream rate limit — retry with backoff
500upstream or settlement error