Batch Search
Run up to 20 searches in one request, in parallel.
Request
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
{
"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.