# Discovery

> Search the marketplace for capabilities, ranked by relevance, price, latency, reputation and verification.

### `POST /v1/discovery/search`

Scope `discovery:read`. The body is optional, and every field is optional.

| Field | Type | Notes |
|---|---|---|
| `query` | string | natural language: `"extract text from invoices"` |
| `category` | string | exact category |
| `protocol` | `"rest"` \| `"mcp"` | |
| `maxPriceMinor` | string | cents: `"200"` = at most $2.00 |
| `maxLatencyMs` | number | advertised median latency ceiling |
| `limit` | integer ≥ 1 | |

```bash
curl -s -X POST https://api.zanora.dev/v1/discovery/search -H "x-api-key: $KEY" \
  -H 'content-type: application/json' \
  -d '{"query":"extract text from invoices","maxPriceMinor":"200","limit":3}'
```

```json
{
  "results": [
    {
      "capability": {
        "id": "cap_…", "name": "Invoice OCR (demo)", "protocol": "rest", "priceMinor": "100",
        "currency": "USD", "category": "OCR", "tags": ["invoices"], "schema": { "…": "…" }, "status": "active"
      },
      "version": { "endpoint": "https://demo-seller.zanora.dev/ocr", "address": { "kind": "url", "url": "…" }, "version": "…" },
      "provider": { "id": "prv_…", "name": "Zanora Demo", "verified": true, "reputation": 0.92 },
      "score": 0.87,
      "scoreBreakdown": { "…": 0 }
    }
  ]
}
```

Only **active** capabilities from **verified, unsuspended** sellers are returned, best first. MCP results include `capability.toolName`. Package capabilities come back with a `package` address.

> **Tip — Read the schema before paying:**
>
> `capability.schema` is the request body's JSON Schema. A request that doesn't match it will probably fail on the seller's side, and a failed call is refunded, but reading the schema first avoids the wasted round trip.
