# Searchwire

Search and SEO data for agents: keyword search volume, Google results, App Store
and Google Play keywords and rankings, domain registration status and name checks. Answers come from several suppliers and public
registries behind one key, one shared cache and one daily budget per key.

Auth: `Authorization: Bearer <key>`. Without a key, domain and name checks and
answers already in the cache work for 20 calls a day per IP, 10 keywords a call. API calls are `POST`
with a JSON body and return JSON.

## MCP

The same calls are tools on an MCP server at `https://searchwire.dev/mcp` (Streamable HTTP):
`keyword_volume`, `google_results`, `check_domains`, `check_name`, `app_keywords`,
`app_search`, `app_competitors`, `app_keyword_volume`, `account` and `buy_credit`. Send the
key as the `Authorization: Bearer <key>` header; without one the free allowance applies.
In Claude Code: `claude mcp add --transport http searchwire https://searchwire.dev/mcp`.

## Calls

### POST /v1/keywords/volume
`{"keywords": ["ai wiki", "living docs"], "country": "us", "language": "en"}`
Up to 1,000 keywords. `language` is a two-letter code; Chinese is `"zh-TW"` (traditional)
or `"zh-CN"` (simplified), and `"zh"` picks by country. Optional `"origins": ["clickstream"]` restricts which kind of
data may answer (see Provenance). Each item: `keyword, volume, cpc, competition (0-1),
monthly[]`, plus provenance.

### POST /v1/serp
`{"keyword": "ai wiki", "country": "us", "language": "en", "depth": 10, "source": "any"}`
Organic Google results as `items[]: {rank, url, domain, title}` and `observed_at`.
`source`: `"index"` = results already collected earlier (no live query is made),
`"live"` = fetched now, `"any"` (default) = collected results first, live if none.

### POST /v1/domains/check
`{"domains": ["example.dev", "example.com"]}` (up to 50). Registry data over RDAP:
`registered`, and when registered `registrar, created, expires, status[]`. Not registered
does not guarantee it can be bought at the standard price (reserved or premium names).

### POST /v1/names/check
`{"name": "pagenta", "tlds": ["com", "dev", "ai"], "country": "us"}`
One call for a product or brand name: domain status per TLD (default com, dev, ai,
io, app, co), GitHub account, npm package, and the name's search volume.

### POST /v1/apps/keywords
`{"app_id": "964220645", "store": "apple", "limit": 100, "max_rank": 10}`
The keywords an app ranks for in its store's search, each with its monthly search
volume and the app's rank: `items[]: {keyword, volume, rank, updated_at}`, plus `app`
(title, url, rating, reviews, price) and `total` (how many keywords match).
`app_id` is the number in an App Store link (`apps.apple.com/us/app/.../id964220645`), or
with `"store": "google"` the package name on Google Play (`org.telegram.messenger`).
Optional: `limit` (default 100, up to 1,000), `offset`, `order` (`"volume"` highest first,
the default, or `"rank"` best first), `max_rank` (only keywords where the app ranks this
high or higher), `min_volume`.

### POST /v1/apps/search
`{"keyword": "pixelate image", "store": "apple", "country": "us", "depth": 10}`
The apps a store's search returns for a keyword, in order:
`items[]: {rank, app_id, title, url, rating, reviews, free, price}`, with `observed_at` and
`total`. `depth` up to 100 on the App Store, 30 on Google Play. Fetched from the store when we do not hold it, which takes
5 to 20 seconds; if it is not ready within a minute the answer is an `error` that says
so, nothing is charged, and the same call a minute later returns it.

### POST /v1/apps/competitors
`{"app_id": "964220645", "store": "apple", "limit": 20}`
The apps that rank for the same keywords, most shared keywords first:
`items[]: {app_id, title, rating, reviews, shared_keywords, avg_rank, shared_volume,
keywords, volume}`. `shared_keywords` is how many keywords both rank for, `avg_rank` the
competitor's average rank on them, `shared_volume` their monthly searches; `keywords`
and `volume` describe everything the competitor ranks for. The top-level `keywords` and
`volume` are the app's own. `limit` up to 100. Very large apps rank for almost
everything, so read `shared_keywords` next to `keywords`. Naming apps we have not
seen before can add 5 to 20 seconds; `title: null` means the app has left the store.

### POST /v1/apps/keywords/volume
`{"keywords": ["pixelate image", "blur photo", "redact"], "store": "apple"}`
Monthly store search volume for up to 25 keywords of your choosing:
`items[]: {keyword, volume, updated_at}`. No supplier sells this directly, so for each
keyword we do not hold yet we look at which apps the store returns for it and read the
volume from those apps' keyword data; a first lookup takes up to a minute. `volume: null`
with a `note` means no volume is on record for the keyword (usually: too few searches).

App keyword data (`/v1/apps/keywords`, `/v1/apps/competitors`, `/v1/apps/keywords/volume`)
covers the United States in English, on both stores; `/v1/apps/search` takes `country`
and `language` like `/v1/serp`. Store search volumes are the supplier's estimates:
neither Apple nor Google publishes them. They are refreshed weekly, and the ranks in
`/v1/apps/keywords` are from that weekly collection, so they can differ by a few
places from what `/v1/apps/search` sees today.

### GET /v1/account
Your balance, daily budget, and today's (UTC) spend, cache hits and misses.
`POST /v1/account` with `{"daily_budget_usd": 2}` sets your own daily spending cap.

### Getting a key and credit
`POST /v1/billing/checkout` with `{"amount_usd": 10}` (10, 25, 50, 100 or 250) returns
`checkout_url` and `claim_url`. A person pays at `checkout_url`; then `GET claim_url`
returns the key (it keeps returning the same key, so keep it private). Send the
request with your key to add credit to that key instead. Credit never expires.

Save the key where it outlives your session, for example as `SEARCHWIRE_KEY` in a
secret store or an untracked `.env`, and tell the person where it is. The email
address used at checkout is the person's account: at https://searchwire.dev/account they sign in
with a mailed link and see the key, the balance and the spend.

Example:

    curl -s "https://searchwire.dev/v1/keywords/volume" \
      -H "Authorization: Bearer $KEY" -H "content-type: application/json" \
      -d '{"keywords":["ai wiki","living docs"],"country":"us"}'

## How to use it well

1. Collect your candidate keywords first, then ask for all of them in one
   `/v1/keywords/volume` call per country and language (up to 1,000). One call with
   200 keywords costs $0.06; 200 calls with one cost $4.04.
2. Narrow down by volume, then call `/v1/serp` only for the few keywords worth a look.
3. Read `observed_at` on SERP answers: collected results can be weeks old. Ask
   `"source": "live"` only when you need today's ranking.
4. For an app (ASO): start from apps, not keywords. `/v1/apps/search` for one or two
   seed keywords shows who ranks; `/v1/apps/keywords` for those apps gives each one's
   keywords with volume, 100 of them for $0.04; `/v1/apps/competitors` finds more apps to
   read. Use `/v1/apps/keywords/volume` only for the few keywords still missing: it is
   $0.02 a keyword.
5. Reuse answers you already have; volumes change monthly. Set a daily budget on your
   key (`POST /v1/account`) before running agents in a loop.

## Provenance

Every answer carries `source` (the provider), `origin` (what kind of data it is),
`fetched_at` and `cached`. Origins: `google_ads` (Google Ads keyword data),
`clickstream` (clickstream or Bing Ads based volume, no Google data), `serp_index`
(Google results collected earlier), `live_scrape` (Google results fetched for this
request), `app_index` (app-store rankings and keyword volumes collected weekly),
`app_search` (a store's search results fetched on request), `registry` (public
registries: RDAP, GitHub, npm).

Which providers can answer depends on your key's licence scope: external keys only
receive public data and data from suppliers that allow resale.

## Price

| Call | Price |
|---|---|
| `/v1/keywords/volume` | $0.02 a call, plus $0.0002 for each keyword answered |
| `/v1/serp`, collected results | $0.002 |
| `/v1/serp`, live results (`"source": "live"`, or `"any"` when nothing is collected) | $0.005 |
| `/v1/apps/keywords` | $0.02 a call, plus $0.0002 for each keyword listed |
| `/v1/apps/competitors` | $0.02 a call, plus $0.002 for each competitor listed |
| `/v1/apps/search` | $0.005 a keyword |
| `/v1/apps/keywords/volume` | $0.02 for each keyword answered |
| `/v1/domains/check`, GitHub and npm | free |
| `/v1/names/check` | free; with a key it adds the name's search volume, at the keyword price |

One keyword costs $0.0202, 100 keywords in one call $0.04. The price is for what you
get, so an answer from the cache costs the same as one fetched for you; `fetched_at`
says how old it is. A call that answers nothing costs nothing. Each response's `cost`
is what the call cost you.

## Cache

Answers are cached and shared by every key. Freshness: keyword volume 30 days, Google
results 7 days, app keywords, competitors and store search results 7 days, app keyword
volume 30 days, registered domains and names 1 day, unregistered domains 1 hour.
Search volumes are monthly figures, so refetching inside the month returns the same
numbers; `?fresh=1` refetches anyway. Live Google results are always fetched for the
call. Keywords are compared trimmed and lowercased.

## Limits and errors

Each key has a daily budget in USD (UTC day), $5 unless you set it. Past it, or with
no credit left, priced calls answer each item with an `error` saying so and charge
nothing; the free checks still work. An
item that no provider could answer carries `error` with the reason from each provider
tried; do not invent a value for it. HTTP 400 = bad request, 401 = unknown key,
429 = free limit without a key reached.
