# Hosted search

With a site key, the `search_posts` tool answers from your site's hosted index instead of downloading your feeds into the agent's browser. It is faster, covers your whole archive and works on sites with thousands of posts.

## The API

```
GET https://agentprose.cloud/v1/search?key=pk_…&q=webmcp+security&limit=10
```

```json
{"query":"webmcp security","count":2,"mode":"bm25",
 "items":[{"url":"…","title":"…","summary":"…","published":"…","tags":["…"],"score":7.21}]}
```

It is open to any origin (CORS) and cached for 60 seconds. Ranking is BM25 over title, tags, summary and body. On Team, results are also ranked by meaning (semantic search), not only by matching words.

## Quotas

Free includes 1,000 searches a month, Pro 50,000 and Team 500,000. Over the quota the API answers `429` and the agentprose script quietly falls back to its own search in the browser, so agents still get results. Your dashboard shows when that happens.

## Keeping it fresh

The index is rebuilt by [crawling](/docs/content-discovery), by [CMS webhooks](/docs/cms-webhooks), or by uploading `agentprose.json` from CI:

```bash
npx agentprose build public --base-url https://blog.example/ --inline
curl -X PUT https://agentprose.cloud/v1/sites/SITE_ID/index \
  -H "Authorization: Bearer sk_…" -H "Content-Type: application/json" \
  --data-binary @public/agentprose.json
```

## Keeping search local

Add `data-cloud-search="false"` to the script tag to keep analytics but let the script search in the browser.
