# Google Search API

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

- endpoint: `GET https://marketplaceforaiagents.com/api/public/v1/google-search`
- category: web search
- price: $0.005 USDC per call (5000 atomic, 6 decimals)
- free tier: 3 calls per agent identity, shared across all endpoints (unknown/generic clients draw from a site-wide 100 successful free calls per UTC day; crawlers get none)
- settlement: USDC on Base mainnet `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`, payee `0x05e82e03753c7bc99fb24d10a876cce53f24b7b7`, scheme `exact`
- sandbox: append `?network=base-sepolia` for testnet USDC + mock data
- results key: `organic_results`
- html: https://marketplaceforaiagents.com/listings/google-search

## What it returns

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

## Use cases

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

## Parameters

| param | type | required | default | description |
| --- | --- | --- | --- | --- |
| `q` | string | yes | — | Search query |
| `location` | string | no | — | Localization, e.g. Austin,Texas,United States |
| `gl` | string | no | us | Country code for results |
| `hl` | string | no | en | UI/interface language code |
| `num` | integer | no | 10 | Number of results to return |
| `page` | integer | no | — | Page number for pagination |

## Example call

```bash
curl -s "https://marketplaceforaiagents.com/api/public/v1/google-search?q=example"
```

## Response shape

```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"
    }
  ]
}
```

## Payment

1. Call without `X-PAYMENT`. The first 3 calls per identity (across all endpoints) return 200 with an `X-Free-Calls-Remaining` header.
2. After that the response is `402` with an `accepts[]` requirement.
3. Sign the EIP-3009 USDC authorization, base64 the x402 payload, resend as `X-PAYMENT`.
4. Settlement receipt returns in the `X-PAYMENT-RESPONSE` header.
