# Google Autocomplete & keyword research API for AI agents (suggestions, Trends & live SERP JSON, no API key)

Keyword research for Grok Bot, Claude Cowork and Cursor agents: Google Autocomplete suggestions, Google Trends interest and live Google results as JSON, paid per call in USDC on Base via x402 — no account or API key.

One-line answer: call GET /api/public/v1/google-autocomplete?q=... for suggestions, GET /api/public/v1/google-trends for interest over time, and GET /api/public/v1/trend-then-serp for the trend plus current Google results in one call. Pay per call with x402 USDC on Base — no signup, no API key.

## The task agents actually get

Grok Bot, Claude Cowork and Cursor agents get handed SEO and content tasks with no human watching: "find what people search around X", "pick a title or keyword for this post", "is this topic rising or dead?". Each needs three facts: what people type, whether demand is growing, and who already ranks.

Scraping Google suggest and Trends breaks for unattended agents: the unofficial suggest endpoint is undocumented and can change or be rate-limited without notice, Trends pages are script-rendered and throttle automated clients, and SERP scraping hits CAPTCHAs. An agent that fails silently at 3am writes a brief on nothing. These endpoints return the same data as stable JSON with a documented contract.

## Endpoint contracts

| Endpoint | Required | Optional | Results key | Listing |
| --- | --- | --- | --- | --- |
| GET /api/public/v1/google-autocomplete | q | gl, hl | suggestions | https://marketplaceforaiagents.com/listings/google-autocomplete |
| GET /api/public/v1/google-trends | q (comma-separated to compare up to 5 terms) | geo, date, data_type (TIMESERIES | GEO_MAP | RELATED_QUERIES | RELATED_TOPICS) | interest_over_time (plus related rising queries) | https://marketplaceforaiagents.com/listings/google-trends |
| GET /api/public/v1/trend-then-serp | q | geo, date, gl, hl | results (google-trends, google-search) | https://marketplaceforaiagents.com/listings/trend-then-serp |
| GET /api/public/v1/google-search | q | gl, hl | organic_results | https://marketplaceforaiagents.com/listings/google-search |

trend-then-serp is an intent: it runs google-trends then google-search server-side (2 steps) and one invocation consumes one free-tier call, not one per step.

## Agent workflow: seed to brief

- Seed: take the user's topic as q.
- Expand: call google-autocomplete with the seed (and variants like "seed for", "seed vs") and collect suggestions.
- Rank: call google-trends with up to 5 candidates comma-separated in q; compare interest_over_time to separate rising from flat terms. Use data_type=RELATED_QUERIES for rising adjacent queries.
- Check competition: call trend-then-serp (or google-search) on the top candidates to see who ranks today.
- Write the brief: chosen keyword, trend evidence, ranking pages, and suggested angles from the suggestions list.

The first 3 calls per agent identity are free across the whole marketplace and return 200 with an X-Free-Calls-Remaining header. After that, the same unpaid request returns HTTP 402 with payment requirements:

```bash
curl -i "https://marketplaceforaiagents.com/api/public/v1/google-autocomplete?q=ai+agent+payments&gl=us&hl=en"

HTTP/1.1 402 Payment Required
{
  "x402Version": 1,
  "error": "payment_required",
  "accepts": [
    {
      "scheme": "exact",
      "network": "base",
      "maxAmountRequired": "<live amount>",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0x05e82e03753c7bc99fb24d10a876cce53f24b7b7",
      "resource": "https://marketplaceforaiagents.com/api/public/v1/google-autocomplete"
    }
  ]
}
```

Sign the EIP-3009 USDC authorization for the accepts entry, base64-encode the x402 payload, and resend the same URL with an X-PAYMENT header. The settlement receipt comes back in the X-PAYMENT-RESPONSE header.

```bash
curl -i "https://marketplaceforaiagents.com/api/public/v1/google-autocomplete?q=ai+agent+payments&gl=us&hl=en"   -H "X-PAYMENT: <base64 x402 payload>"

HTTP/1.1 200 OK
X-PAYMENT-RESPONSE: <base64 settlement receipt>
```

```ts
import { wrapFetchWithPayment } from "x402-fetch";
const pay = wrapFetchWithPayment(fetch, wallet);

const base = "https://marketplaceforaiagents.com/api/public/v1";
const ac = await (await pay(`${base}/google-autocomplete?q=ai+agent+payments`)).json();
const tr = await (await pay(`${base}/google-trends?q=${encodeURIComponent(ac.suggestions.slice(0, 5).map((s: any) => s.value ?? s).join(","))}&date=today+12-m`)).json();
const serp = await (await pay(`${base}/trend-then-serp?q=ai+agent+payments&geo=US`)).json();
```

## Paying with x402: budgeting a keyword run

x402 USDC on Base is the no-account rail: the agent needs a funded wallet, not a signup, API key or monthly plan, so it can buy exactly the calls a task needs and stop. Charges settle only when the upstream call succeeds.

Regular price is $0.005 USDC per step. Promotional pricing, when active, is advertised in the live 402 (extra.perStep and extra.total) and the site banner — always trust the live 402 amount rather than a hard-coded number.

| Run | Calls | Steps | At regular $0.005 per step |
| --- | --- | --- | --- |
| 1 autocomplete + 1 trends compare + 1 trend-then-serp | 3 | 1 + 1 + 2 = 4 | $0.020 |
| 3 autocomplete expansions + 2 trends + 3 google-search | 8 | 8 | $0.040 |

Budget formula: total steps × live per-step price. Set a per-task USDC cap and stop when it is reached.

## MCP

The same endpoints are available through the site's MCP server at https://marketplaceforaiagents.com/mcp (no auth), as documented in https://marketplaceforaiagents.com/learn/mcp-x402-marketplace. Use list_apis to discover them.

## Agent playbook

| User ask | Call |
| --- | --- |
| "Find what people search around X" | google-autocomplete?q=X |
| "Is this topic rising?" | google-trends?q=X&date=today+12-m |
| "Compare these keywords" | google-trends?q=a,b,c |
| "Pick a keyword and show who ranks" | trend-then-serp?q=X |
| "Who ranks for this today?" | google-search?q=X |

## FAQ

Do I need a Google API key? No. Calls are paid per call with x402 USDC on Base; no account or key.

Are Trends values search volumes? No. interest_over_time is relative interest on Google's scale, useful for rising-vs-flat comparisons, not absolute volume.

How many free calls do I get? 3 per agent identity in total across all endpoints; an intent like trend-then-serp counts as one.

What price should my agent expect? Regular $0.005 USDC per step; read the live 402 for the current amount.

## Related entrypoints

- Marketplace: https://marketplaceforaiagents.com/marketplace
- Docs: https://marketplaceforaiagents.com/docs
- llms.txt: https://marketplaceforaiagents.com/llms.txt
- Google Trends API for agents: https://marketplaceforaiagents.com/learn/google-trends-api-for-agents
- Google Search API for agents: https://marketplaceforaiagents.com/learn/google-search-api-for-agents
- How agents budget x402 API calls: https://marketplaceforaiagents.com/learn/budget-x402-api-calls
- x402 protocol explained: https://marketplaceforaiagents.com/learn/x402-protocol-explained

Capability first, payment second: expand, rank and check keywords with live JSON, and settle with x402 USDC on Base only when the free tier is spent.

Canonical HTML: https://marketplaceforaiagents.com/learn/google-autocomplete-keyword-research-api-for-agents