Deep Search API for RAG

SERP and page bodies in one round-trip. Built for RAG.

POST /v1/search/deep 5 + 5 / page Search & Discovery

Same multi-engine SERP as /v1/search, but with the top-N pages fetched, anti-bot-cleared, and parsed into readable text in the same response. Stop bolting a fetcher onto every search call.

The hard part

Search-then-fetch is a two-step pattern that gets brittle in production: one slow site holds up the whole batch, retries pile up, and you end up paying for failed fetches that came back blocked. One round-trip with a per-page deadline, and failed pages don't bill.

Deep search API: what you get

  • Single round-trip: SERP plus body text in one JSON.
  • Per-page fetch budget scales with depth (~2.5s fast → ~12s stealth; default ~3.5s) so slow news sites don't block the response.
  • Returns extracted text, final URL, status, and elapsed time per page.
  • Pages that fail fetching don't bill. You pay only for what you got.
  • depth=stealth allows full anti-bot escalation on page fetches for hard sites (slower, maximum coverage).

Deep search API use cases

  • RAG retrieval in one round-trip

    Search and read the top pages in one call, then chunk pages[].text straight into your embeddings or prompt.

  • Agent research steps

    Give an agent one tool that returns sources and their contents, with error set on any page it couldn't use.

  • Market and competitor research

    Pull the top results for a list of queries and compare what each page says, with final_url and status recorded for every fetch.

Deep search API quickstart: Python, Node and curl

Install the SDK with pip install scrapenest (PyPI) or npm install scrapenest (npm), or send the raw HTTP call with your key in the Authorization: Bearer header. No key yet? Sign up free, verify your email, then create a key in your dashboard.

import os
from scrapenest import Client

client = Client(os.environ["SCRAPENEST_API_KEY"])
res = client.search_deep("fastapi vs litestar 2026", num_results=8, fetch_top=5)
print(res.fetched_count, "pages,", res.credits_charged, "credits")
for page in res.pages:
    print(page.url, page.status, len(page.text or ""), page.error)

Deep search API request and response

Request body

{
  "query": "fastapi vs litestar 2026",
  "num_results": 8,
  "fetch_top": 5,
  "render": "auto"
}

Response JSON

{
  "query": "fastapi vs litestar 2026",
  "results": [
    {
      "position": 1,
      "url": "https://blog.litestar.dev/comparison",
      "title": "FastAPI vs Litestar in 2026",
      "snippet": "A side-by-side look at routing, DI, and performance …",
      "engine": "bing",
      "engines": ["bing", "duckduckgo"],
      "score": 0.92
    }
  ],
  "pages": [
    {
      "url": "https://blog.litestar.dev/comparison",
      "final_url": "https://blog.litestar.dev/comparison",
      "status": 200,
      "method": "fetch",
      "elapsed_ms": 812,
      "title": "FastAPI vs Litestar in 2026",
      "text": "Litestar 3.0 ships … (cleaned readable text)"
    }
  ],
  "took_ms": 2110,
  "fetched_count": 5,
  "cache_hit": false,
  "credits_charged": 30,
  "unresponsive_engines": [],
  "partial": false
}

Fields with no value are left out of the JSON rather than sent as null, so read optional fields defensively.

Deep search API pricing

5 credits base for the SERP, plus 5 credits per page actually fetched. Pages that fail (timeout, block, 4xx) do not bill, and neither do bot walls, consent or login pages, not-found pages, pages under 200 characters, or pages off the query's subject.

Plans and pay-as-you-go rates are on the pricing page.

Deep search API limits

  • fetch_top: 1 to 10 pages, default 5. num_results: 1 to 50.
  • Per-page fetch budget follows depth: about 2.5 s at fast, 3.5 s at balanced (the default), 6 s at thorough and 12 s at stealth.
  • Whole-call budget: about 4.5 s, 10 s, 11 s and 18 s by depth. timeout_seconds (0.1 to 20) can only lower it.
  • A page bills only when it is usable: at least 200 characters, on the query's subject, and not a bot wall, consent gate, login redirect or not-found page.
  • page is accepted but ignored: deep search always reads the first page of results.

Deep search API error codes

HTTPCodeMeaning
422validation_errorA field is out of range, for example fetch_top above 10.
503upstream_failedThe search engines failed inside the time budget. Not billed.
200 (in body)search_deadline_exceededThe budget ran out before any result arrived: partial: true, 0 credits.
200 (per page)blocked, not_found, no_contentSet as a page's error when that page couldn't be used. It isn't billed or counted in fetched_count.

Every endpoint can also return 401 unauthorized (missing or wrong key), 402 insufficient_credits (balance used up), 403 email_not_verified (an email signup must verify its address before its key works) and 429 rate_limited or concurrency_limit_exceeded. All errors share one JSON envelope; see the error reference.

questions

Deep search API FAQ

What is the difference between search and deep search?

/v1/search returns the SERP only. /v1/search/deep returns the same SERP plus the cleaned text of the top fetch_top pages, fetched in parallel inside the same request, so you skip a second round of scraping.

How is deep search billed?

5 credits for the search plus 5 for each page that came back usable. Pages that time out, are blocked, run under 200 characters or are off the query's subject bill nothing, and a call that delivers nothing at all is free.

How do I get past bot walls on the result pages?

Set depth to thorough or stealth. Those tiers escalate blocked pages through a real-browser bypass with a longer per-page budget (about 6 s and 12 s). fast and balanced skip escalation and fall back to the search snippet.

What happens when a page can't be used?

A blocked, missing or empty page stays in pages with an error (blocked, not_found or no_content) and no text, and while the budget allows, the next on-subject result is fetched in its place. If the fetch phase runs out of time you still get the search results, billed as a plain search.

Page updated