What does a Web Search API response contain?
An instant-answer abstract (abstractText with its source and URL), a relatedTopics array, and a results array of web links. All fields are structured JSON, so agents can consume them without parsing HTML.
Abstracts, related topics, and web results from the DuckDuckGo Instant Answer API in a clean JSON shape, with batch queries and built-in caching.
This calls the live Web Search API. Type a query or pick a preset; the response includes an instant-answer abstract, related topics, and web results.
Caps relatedTopics and results independently, from 1 to 10 each.
Why Web Search API
Built for agents
A stable JSON shape with abstracts, topics, and results that LLM tools can consume directly, without HTML parsing or SERP scraping.
Instant answers
Encyclopedic queries return an abstract with its source and URL, often enough to answer without visiting a single result.
Batch queries
POST up to 10 queries in one request. Each entry returns independently with its own success flag and a roll-up summary.
5-minute cache
Identical query and limit pairs are served from an in-memory cache, cutting latency and upstream load for repeated lookups.
Structured, predictable output
relatedTopics and results arrays with text, url, and result fields. Empty arrays are valid for niche queries, never surprise shapes.
No upstream keys
Backed by the DuckDuckGo Instant Answer API. No third-party search subscription or key management on your side.
/api/v1/web-search
Single query
One query in, abstract plus related topics and web results out. Cap section sizes with limit.
Batch queries
Up to 10 queries per request. Returns per-query results and a summary with total, succeeded, and failed counts.
Service health
Status, service name, version, timestamp, and correlationId.
Prometheus metrics
Request counts and latency histograms in Prometheus exposition format.
| Parameter | Type | Required | Description |
|---|---|---|---|
| q | string | GET | Search query, 1 to 256 characters. |
| queries | string[] | POST | 1 to 10 non-empty queries, max 256 characters each, in the JSON body. |
| limit | integer | no | Max related topics and results per section, from 1 to 10. Default 10. |
Error reference
Batch entries fail independently, and every response carries a correlationId. Empty result arrays are valid responses, not errors.
Missing or invalid q, queries, or limit. Queries must be 1 to 256 characters; batches hold at most 10.
Missing or invalid API key at the gateway. Send x-api-key or api_key with every request.
More than 120 requests in a 15-minute window. Back off and retry.
DuckDuckGo did not respond. Retry shortly; cached queries keep working during outages.
Unexpected service failure. Include the correlationId when reporting the issue.
Example error response
{
"success": false,
"error": "Invalid query parameters",
"details": ["\"q\" length must be less than or equal to 256 characters long"],
"correlationId": "req_abc123"
}FAQ
An instant-answer abstract (abstractText with its source and URL), a relatedTopics array, and a results array of web links. All fields are structured JSON, so agents can consume them without parsing HTML.
Yes. POST the same /search path with a queries array of up to 10 entries. Each query resolves independently with its own success flag, and a summary reports total, succeeded, and failed counts.
Identical query and limit pairs are cached in memory for 5 minutes. Cached responses set fromCache to true and return faster while reducing upstream load.
The service uses the DuckDuckGo Instant Answer API, which favors encyclopedic queries. Niche or long-tail queries can return empty relatedTopics or results arrays; that is a valid response, not an error.
Send your Datpaq API key as an x-api-key header or an api_key query parameter. Keys are created in the Datpaq dashboard and a free tier is included.
Structured abstracts, topics, and results from one endpoint, with batching and caching built in. No SERP scraping, no upstream keys.