Web Search for AI
Extend Web Search with content enrichment: semantically scored passages (extra_snippets) and/or full page body (full_content). Results are reranked by relevance — built for RAG pipelines, LLM agents, and context-augmented generation.
Code
This is the same endpoint as Web Search — enrichment is activated by adding parameters. All base parameters (q, market, offset) apply here too, including domain filtering: site: / -site: operators in q on both methods, or include_domains / exclude_domains arrays on POST.
Quick start
Code
Code
You can restrict enriched results to trusted sources with domain filtering — either site: operators inside the query, or the include_domains array on POST:
Code
Code
Which one for AI workloads?
LLM agents naturally write Google-style operators — a generated query like pricing site:qdrant.tech works as-is, no parsing needed on your side. Use include_domains when your application decides the source list: a curated allowlist in your config acts as a guardrail, enforced regardless of the query the model generates.
Code
Enrichment parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
extra_snippets | boolean | false | Fetch result pages and return semantically scored chunks. Triggers reranking. |
full_content | "markdown" | "html" | — | Return the full page body. markdown is recommended for LLM prompts; html for raw markup. Also triggers reranking. |
max_snippets | number | 3 | Max scored chunks per URL (1–10). Only with extra_snippets=true. |
min_score | number | 0.1 | Minimum relevance score (0–1) for a chunk to be included. Only with extra_snippets=true. |
Start with min_score=0.2 and max_snippets=5 as a baseline. Raise min_score to reduce noise; increase max_snippets if you need more coverage per page.
How enrichment works
When extra_snippets=true or full_content is set, the API runs a post-search pipeline:
- SERP — initial ranked results from the search engine
- Fetch — parallel page downloads (3.5 s per URL, 4 s global timeout)
- Chunking — content split on Markdown structure (H1–H6); long sections split at ~1,200 characters with overlap, heading context preserved
- Reranking — all chunks scored against the query; URLs with the best chunks are promoted
- Filtering —
min_scoreandmax_snippetsapplied per URL; URLs with no qualifying chunks are moved to the end
Result order reflects reranking when enrichment is on — not raw SERP order. The snippet field always reflects the original search provider preview.
Enrichment fields
These fields appear on each result when enrichment is active:
| Field | When present | Description |
|---|---|---|
extra_snippets | extra_snippets=true | Array of { chunk, score }, ordered by descending relevance score. |
full_content | full_content set | { text, format, length } — full page body. |
published_date | Fetch occurred and date resolved | ISO 8601 publication date. |
extra_snippets
Code
chunk: text segment (~300–1,800 characters) with heading context preservedscore: relevance in[0, 1], descending
extra_snippets: [] is returned when the page could not be fetched (anti-bot, timeout) or no chunk scored above min_score. Such URLs remain in the response, placed after reranked results.
full_content
Code
Always check length > 0 before using text. On fetch failure, the field is present with "text": "" and "length": 0.
published_date
Code
Only present when a fetch occurred and the HTML extractor resolved a date. Check for presence before use.
Full response example
Code
Limits and latency
| Limit | Value |
|---|---|
| Rate limit | 20 req/s |
| Recommended client timeout | 8–10 s when enrichment is enabled |
Plain search (no enrichment) is significantly faster. Budget for extra latency when extra_snippets or full_content are set.
Best practices
- Use
extra_snippets=truefor RAG: targeted passages reduce prompt noise and improve answer quality. - Use domain filtering (
include_domainsonPOST, orsite:inq) to ground answers in a curated set of trusted sources. - Prefer
full_content=markdownoverhtmlfor LLM context unless you need raw markup. - Cite
url(and chunk text) in generated answers for traceability. - For end-to-end Q&A without managing retrieval yourself, consider Answer.