POST /v1/search
Web search. Returns results with optional full-page markdown and an optional answer that cites the results it is based on.
Results come from licensed search data providers, not from an index of our own. Providers are tried in a fixed order; the first one that returns results answers, and source names it with a neutral label for its place in that order (provider_1, provider_2, ...; vendor names are not part of the response). When every provider that completed found nothing, source names the last of them. attempts[] lists every provider call, in order. When no search provider is available, the request fails with a 503 and costs nothing; results are never invented.
Search results are passed through to you and not stored on our side. With scrapeResults: true each result page is fetched and converted to markdown, which is where most of the value is. Your use of search and scraped results is subject to the Terms of Service, including the section on lawful use of results.
When include_answer is true, the top 5 results are summarised by an LLM. The answer is returned only when every citation [n] in it points at a result in results[]. Otherwise answer is null and answer_reason says why. The search itself never fails because of the answer step.
Request
POST /v1/search
Content-Type: application/json
x-api-key: YOUR_KEYBody
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | Search query string. | |
limit | number | No | 10 | Max results. Clamped to your plan's search_results cap: Free 20, Hobby 50, Pro and Scale 100. |
scrapeResults | boolean | No | false | Fully scrape each result URL to markdown. Billed as part of the search charge (2 credits per 10 results); no per-URL scrape credits are added. |
country | string | No | "us" | Two-letter country code for geo-localised results (e.g. "mx", "br"). A country the provider does not support returns worldwide results. |
include_answer | boolean | No | false | Generate an answer that cites the top results. See answer and answer_reason below. |
includeDomains | string[] | No | Restrict results to these domains (and their subdomains). Sent as site: operators, then applied again to the rows the provider returned. Up to 20, normalized to bare hosts. | |
excludeDomains | string[] | No | Drop these domains and their subdomains. Sent as -site: operators, then applied again to the returned rows. Wins over includeDomains. Up to 20. | |
categories | string | string[] | No | Content categories, translated to operators: github → site:github.com, research → arxiv/scholar, pdf → filetype:pdf. | |
sources | string | string[] | No | ["web"] | Only web has a backend. news, images and unknown values come back in unsupported[]; web results are never substituted for them. A request that names no supported source runs no search and costs nothing. |
tbs | string | No | Time filter: qdr:d (past day), qdr:w, qdr:m, qdr:y, or qdr:h. Sent to the provider as its own freshness setting, not added to the query text. Where a provider has no hour window, qdr:h returns the past day. | |
lang | string | No | Result language as an ISO 639-1 code, optionally with a region (e.g. "en", "es", "pt-br"). A language the provider does not support is ignored rather than failing the search. |
Operators you type in query (e.g. site:, filetype:) pass through verbatim. The response
echoes what actually ran in a search object (effectiveQuery plus the applied
categories/sources/tbs/lang/includeDomains/excludeDomains).
Example request: basic search
curl -X POST https://api.superscraper.dev/v1/search \
-H "x-api-key: ss_live_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"query": "best coffee roasters in Portland",
"limit": 5,
"country": "us"
}'Example request: with answer
curl -X POST https://api.superscraper.dev/v1/search \
-H "x-api-key: ss_live_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"query": "how to store coffee beans",
"limit": 10,
"include_answer": true
}'Response
HTTP 200 when a backend completed (even if zero hits).
Each backend gets about 6 seconds; one that does not answer in time is skipped for the next. Result urls are the real pages: search-engine redirect links are unwrapped (or dropped when no target can be read).
HTTP 503 with code: "search_unavailable" and provider_failed: true when no backend completed. When no search provider is configured at all, details.reason is no_provider_configured and attempts is empty. Neither case is charged.
Body
| Field | Type | Description |
|---|---|---|
query | string | The original query (operators applied are in search.effectiveQuery) |
results | array | Search result items (see below) |
source | string | null | Id of the backend that answered (with rows or empty). null when no backend ran. |
total | number | Number of results returned. When the first backend returns fewer rows than limit, one more backend (if configured) adds new rows, so total can still be below limit on a short result page. |
attempts | object[] | One entry per backend tried, in order: { provider, ok, latency_ms, error_class } |
zero_results | boolean | true when a backend completed and nothing matched |
provider_failed | boolean | false on a 200. A total backend failure is the 503 above. |
unsupported | object[] | undefined | { source, reason } for each requested source with no backend (reason: no_provider or unknown_source) |
answer | string | null | undefined | Present when include_answer: true: the cited answer, or null |
answer_reason | string | undefined | Why answer is null: no_results, summarizer_unavailable, no_citations or invalid_citation |
citations | object[] | undefined | { id, url, title } for each result the answer cites. id is the result's position. |
llm_fallback | boolean | undefined | true when the answer ran on the platform model because your account has no LLM key of its own |
search | object | What actually ran: effectiveQuery plus the applied categories/sources/tbs/lang/includeDomains/excludeDomains |
Result item
| Field | Type | Description |
|---|---|---|
url | string | Result URL |
title | string | Page title |
snippet | string | Short text snippet from the SERP |
position | number | Rank position (1-based) |
markdown | string | null | Full page markdown, only populated when scrapeResults: true |
Example response
{
"query": "best coffee roasters in Portland",
"results": [
{
"url": "https://www.example-directory.example/coffee-roasters/portland",
"title": "Best Coffee Roasters in Portland, OR",
"snippet": "Top 10 coffee roasters in Portland, OR: Northside Coffee Roasters, Hilltop Coffee and more.",
"position": 1,
"markdown": null
},
{
"url": "https://www.example-guide.example/portland/coffee",
"title": "Portland Coffee Guide: Where to Buy Fresh Beans",
"snippet": "Local roasters, cafes and where to buy beans roasted this week.",
"position": 2,
"markdown": null
}
],
"source": "provider_1",
"total": 5,
"attempts": [
{ "provider": "provider_1", "ok": true, "latency_ms": 640, "error_class": null }
],
"zero_results": false,
"provider_failed": false,
"search": { "effectiveQuery": "best coffee roasters in Portland" }
}Example response: with answer
{
"query": "how to store coffee beans",
"results": [ ... ],
"source": "provider_1",
"total": 10,
"answer": "Store whole beans in an airtight container, away from light, heat and moisture [1]. Grind them just before brewing for the best flavor [2].",
"citations": [
{ "id": 1, "url": "https://www.northside-roasters.example/blog/how-to-store-coffee", "title": "How to store coffee beans" },
{ "id": 2, "url": "https://www.example-guide.example/coffee/grinding", "title": "Grinding coffee at home" }
]
}When the answer cannot be bound to the results:
{ "answer": null, "answer_reason": "no_citations" }Errors
| Status | Error | Cause |
|---|---|---|
| 400 | `query` is required | query field missing or empty |
| 400 | Invalid JSON body | Malformed request body |
| 401 | API key required | Missing x-api-key header |
| 401 | Invalid or revoked API key. | Key not found or deactivated |
| 429 | Rate limit exceeded | Too many requests in the sliding window |
| 503 | search_unavailable | No search provider completed, or none is configured (details.reason: "no_provider_configured"). Not charged. |
| 503 | credential_required / credential_unavailable | The answer step needs a provider key your account has not stored, or the key store holding your stored keys could not be read |
Notes
- Credits: 2 per 10 results returned (or part of 10), counted on results actually returned, not on
limit. A search with no results costs nothing. - The
answerfield cites sources by[number], which is thepositionof a returned result. - All requests are logged to
usage_logs(endpoint/v1/search) regardless of whether results were found.