Core
Search

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_KEY

Body

FieldTypeRequiredDefaultDescription
querystringYesSearch query string.
limitnumberNo10Max results. Clamped to your plan's search_results cap: Free 20, Hobby 50, Pro and Scale 100.
scrapeResultsbooleanNofalseFully 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.
countrystringNo"us"Two-letter country code for geo-localised results (e.g. "mx", "br"). A country the provider does not support returns worldwide results.
include_answerbooleanNofalseGenerate an answer that cites the top results. See answer and answer_reason below.
includeDomainsstring[]NoRestrict 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.
excludeDomainsstring[]NoDrop these domains and their subdomains. Sent as -site: operators, then applied again to the returned rows. Wins over includeDomains. Up to 20.
categoriesstring | string[]NoContent categories, translated to operators: github → site:github.com, research → arxiv/scholar, pdf → filetype:pdf.
sourcesstring | 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.
tbsstringNoTime 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.
langstringNoResult 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

FieldTypeDescription
querystringThe original query (operators applied are in search.effectiveQuery)
resultsarraySearch result items (see below)
sourcestring | nullId of the backend that answered (with rows or empty). null when no backend ran.
totalnumberNumber 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.
attemptsobject[]One entry per backend tried, in order: { provider, ok, latency_ms, error_class }
zero_resultsbooleantrue when a backend completed and nothing matched
provider_failedbooleanfalse on a 200. A total backend failure is the 503 above.
unsupportedobject[] | undefined{ source, reason } for each requested source with no backend (reason: no_provider or unknown_source)
answerstring | null | undefinedPresent when include_answer: true: the cited answer, or null
answer_reasonstring | undefinedWhy answer is null: no_results, summarizer_unavailable, no_citations or invalid_citation
citationsobject[] | undefined{ id, url, title } for each result the answer cites. id is the result's position.
llm_fallbackboolean | undefinedtrue when the answer ran on the platform model because your account has no LLM key of its own
searchobjectWhat actually ran: effectiveQuery plus the applied categories/sources/tbs/lang/includeDomains/excludeDomains

Result item

FieldTypeDescription
urlstringResult URL
titlestringPage title
snippetstringShort text snippet from the SERP
positionnumberRank position (1-based)
markdownstring | nullFull 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

StatusErrorCause
400`query` is requiredquery field missing or empty
400Invalid JSON bodyMalformed request body
401API key requiredMissing x-api-key header
401Invalid or revoked API key.Key not found or deactivated
429Rate limit exceededToo many requests in the sliding window
503search_unavailableNo search provider completed, or none is configured (details.reason: "no_provider_configured"). Not charged.
503credential_required / credential_unavailableThe 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 answer field cites sources by [number], which is the position of a returned result.
  • All requests are logged to usage_logs (endpoint /v1/search) regardless of whether results were found.