# Batch Search

> Run up to 20 searches in one request, in parallel.

Source: http://localhost:3000/docs/endpoints/search-batch

## Batch Search: `POST /v1/search/batch`

Up to many queries in one request; one credit per non-empty query. Cost: 1 credit / query.

```bash
curl -X POST https://api.hushsearch.io/v1/search/batch \
  -H "X-API-Key: hs_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "queries": [
    "rust async runtimes",
    "python asyncio tutorial"
  ],
  "num_results": 5
}'
```

Send several queries at once and get one result set per query. Queries run in parallel, so the whole batch usually returns in about the time of the slowest query.

## Parameters

| Field | Type | Default | Notes |
|---|---|---|---|
| `queries` | string[] | — | **Required.** 1–20 queries. |
| `num_results` | integer | `10` | Results per query, 1–50. |
| `vertical` | string | — | Optional vertical: `academic`, `news`, `code`, `legal`, `medical`. |

## Response

```json
{
  "items": [
    {
      "query": "postgres MVCC",
      "results": [{ "title": "…", "url": "https://…", "snippet": "…" }],
      "instant_answer": null,
      "suggestions": [],
      "error": null,
      "response_time_ms": 640
    }
  ],
  "credits_used": 2,
  "credits_remaining": 498,
  "response_time_ms": 702
}
```

Each query costs 1 credit. A query that fails reports its `error` without failing the batch; if every query fails, the charge is refunded.
