# Search

Source: https://grounder.net/docs/api/search

> POST /v1/search: the request, the two ways to reach a source, the response and what each field means.

## Request

Send `POST /v1/search` with JSON. Each question goes to sources chosen by hand, reached only where none of the source’s disallowed signals refuses it. A search returns up to 5 results; there is no count to set.

**request** (Shell)

```sh
curl https://api.grounder.net/v1/search \
  -H "Authorization: Bearer $GROUNDER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"How do I configure retries in the Python requests library?"}'
```

### Request fields

| Field | Type | What it does |
| --- | --- | --- |
| `query` | string | The question, 1 to 2,000 characters. |
| `include_text` | boolean | Includes result text by default. |
| `purpose` | string | What the answer will be used for, if the user supplied it. |
| `context` | object | Context about the search provided by your client. Put the user&rsquo;s own message, word for word, in `context.prompt_content`. Without it the search is recorded as having no user prompt. |
| `urls` | array | Up to five public HTTP or HTTPS addresses to read with Grounder direct. |
| `site` | string | A host on which Grounder direct finds the page from the words in `query`. Addresses in `urls` take precedence. |
| `format` | string | Grounder direct format: `summary`, `full-page` or `highlights`. |
| `user_agent` | string | Your user agent for a hosted Grounder direct read. |
| `signed_in` | boolean | Accepted, and changes nothing: every read is logged out, on the Mac and hosted. |
| `reader` | string | The Mac program sends `mac` to request addresses it reads locally. The default is `hosted`. |

Name your app with an `X-Grounder-Client` header, its name and, if you like, its version: `X-Grounder-Client: my-agent/1.2.0`. Your searches are then shown under that name. The same header works on the Tavily and Brave drop-ins and on the MCP server.

## Grounder direct requests

Send `urls`, or a `site` with a question, to find a page and read it from the source’s site. A Grounder direct search is one search, at the one price, even if its page could not be read.

Send `urls` to read pages you know by address. Send `site` and `query` to find a page on a named site. Reads of pages named by address are free. [Read a page](https://grounder.net/docs/direct#request) shows a complete request.

A hosted read uses [your user agent](https://grounder.net/docs/direct#user-agent) when you send or save one, and Grounder’s own otherwise. The Mac program can ask for addresses with `reader: "mac"`, then read them locally. A live feed answers from its own feed in either way.

## Searching without a key

Where anonymous search is enabled, `POST /v1/search` can run without `Authorization`. Each visitor can make 50 free searches a UTC day and 10 a minute, and all visitors without a key together share 10,000 a UTC day. Grounder routes each question to its own source. MCP, the [drop-in endpoints](https://grounder.net/docs/drop-in), the cited report and account routes require a key or sign-in.

When a visitor’s searches for the day are used, the answer is `429 daily_limit_reached` with `details.signup_url` and `details.billing_url`: sign up free, and add credit to search past an account’s 50 free searches. `Retry-After` is the seconds until midnight UTC. The minute’s limit is `429 rate_limited` and carries neither link. When the day’s 10,000 searches with no key, or every free search, reach the limit across Grounder, the answer is `503 capacity_reached`, with the same two links. Where Grounder takes payment with x402, the 429, the 503 and the 400 for a `profile` or `routing_settings` are `402 payment_required` instead, with the same links and the price: [Pay per search with x402](https://grounder.net/docs/api/search#x402).

## Pay per search with x402 (no account)

A search with no key can pay for itself in USDC on Base with [x402](https://docs.x402.org), in place of the free searches. `GET /v1/x402` says whether it is on and, if it is, the network, the token, the address to pay and the search price; it needs no key, and answers `{"enabled": false}` where payment is off. The price is the rate of the search’s type, the same rate a search paid from credit takes ([Pricing](https://grounder.net/pricing)), and it is fixed by the request before the search runs.

Where it is on, a search with no key that the free searches don’t cover is answered `402 payment_required` in place of the 429 or the 503: the day’s 50 are used, the day’s searches with no key or every free search have reached the limit, or it asks for a `profile`, `routing_settings`, a deep-research mode or a provider above a free search’s price. The `PAYMENT-REQUIRED` header holds what that search costs, `details.x402` repeats it, and `signup_url` and `billing_url` are there if you would rather have an account.

Sign a USDC transfer for that price and send the same search again with it in `PAYMENT-SIGNATURE`; an x402 client library does both steps for you, and the older `X-PAYMENT` header is read too. The search then runs as a paid search: none of a free search’s limits, so it may take a profile, `routing_settings`, deep-research modes and any provider, at 120 a minute. `usage.cost_usd` is its price.

You pay only for a search that was served. One that fails is not charged, and the same signed payment can be sent again until it expires. If a served search’s payment does not go through, the answer is `402` with no results. One payment pays for one search, and sending it again is refused. The answer to a paid search carries `PAYMENT-RESPONSE`, the receipt: `success`, `transaction`, `network` and `payer`. MCP needs you to sign in and pays from your credit; it takes no x402 payment.

A Grounder direct search is one search, at the one price, even if its page could not be read. A read of pages you name by their addresses requires no payment.

## Response

The response includes your `query`, `results`, `topics`, `routing`, `usage` and `request_id`.

- `topics` has one row for each source the search used: its ID and name, the source host and the `server` that answered, and whether it was reached as `provider`, `direct`, `feed` or `none`. It also gives the `status` and `result_count`, plus an error code or ignored date filter where applicable.
- Each result includes its rank, title, address and provenance. `provenance.source` shows where it came from, with `provenance.topic` naming the area the question was matched to, and `licensed_basis` says why it can be served. When a source's terms ask for credit or a licence notice, a result also has `provenance.licence` with the `credit` line to give, and the licence `name` and `url`. The same `licence` is on that source's row in `topics`.
- `server` is a grounding server ID. It reads `api` when the source’s own API answered and `publisher-license` when a page was bought from the publisher. When the chosen source cannot answer, another source Grounder chose answers, and its row names it.
- `routing.mode` gives the way that answered. `routing.calls` lists the servers called for each source, including a finding call for a Grounder direct search.
- `direct.pages` lists page reads. The Mac program gets `direct.candidates` to read locally.
- `ignored` lists older request fields the search did not use, `top_k` among them. When a Grounder provider search goes to the wider web and it answers, its row in `topics` reads `id: "web"` and the `note` says so. When nothing answers, the wider web included, the response has `no_topic: true` and empty `topics` and `results`, and no search is charged.
- `closed` lists sites the question named that Grounder did not reach because their owners do not allow it, each with `site` and `reason`. When no source fits and the best-fitting source is closed to Grounder, `note` says so and why. Tell the person.

See [what a search can return](https://grounder.net/docs/routing#outcomes) for the outcome of empty, failed or unread results.

## Report the sources you cited

POST `/v1/search/{request_id}/cited` names which of a search’s results your answer cited, by the `request_id` the search returned and the `rank` of each result the answer used. Since 2 November 2026 Grounder does not record the report: the call is accepted and answered as described below and nothing is stored, so there is no need to make it. Send the same key or token as the search.

**cited.sh** (Shell)

```sh
curl https://api.grounder.net/v1/search/$REQUEST_ID/cited \
  -H "Authorization: Bearer $GROUNDER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ranks": [1, 3]}'
```

The body is `ranks`, required and up to 100 long: the `rank` of each result the answer cited, `[]` for none. Optionally `urls` names the same results by address, instead of or beside their ranks.

It answers `request_id`, `sent` (the results the search sent), `cited` (the ranks named that the search sent, ascending) and `ignored` (anything named that the search did not send). A repeat gets the same answer, so a retry is safe. Only the account that made the search can report on it: any other `request_id` returns `404 invalid_request`. It is not a search and counts toward no limit of one.
