Use case · RAG pipelines
Fresh, pruned context for retrieval pipelines
Turn search results or your own URL list into clean Markdown, ranked against the question, ready to embed or put straight into the prompt.
How does retrieval-augmented generation reduce hallucinations?
{ "urls": ["en.wikipedia.org/wiki/Retrieval-augmented_generation"], "highlights": { "query": "how does retrieval-augmented generation reduce hallucinations" }, "pruned_context": true }
Retrieval-augmented generation - Wikipedia
en.wikipedia.org/wiki/Retrieval-augmented_generation
Retrieval-augmented generation (RAG) enhances large language models (LLMs) by incorporating an information-retrieval mechanism that allows models to access and utilize additional data beyond their original training set. Ars Technica notes that "when new information becomes available, rather than having to retrain the…
Contents
Clean Markdown in, not HTML
Pages are fetched, error pages are rejected, and the main content is extracted as Markdown with tables kept. Your chunker sees text, not navigation and scripts.
Send up to 10 URLs per call, or pass the results of a search straight through.
Retrieval-augmented generation
Retrieval-augmented generation (RAG) is a technique that enables large language models (LLMs) to retrieve and incorporate new information from external data sources. With RAG, LLMs first refer to a specified set of documents, then respond to user queries. These documents supplement information from the LLM's pre-existing training data. This allows LLMs to use domain-specific and/or updated information that is not…
15,521 characters of Markdown, recorded 17 Oct 2026
Highlights
Chunks ranked against your question
A cross-encoder scores every chunk of the page against your query. Keep the top highlights for a tight prompt, or the pruned context when you want everything relevant in reading order.
In the recorded call, pruned context kept 4,539 of 15,521 characters.
Retrieval-augmented generation (RAG) enhances large language models (LLMs) by incorporating an information-retrieval mechanism that allows models to access and…
0.958One way to mitigate this is to do a traditional text search (aka full text search), combine those results to the text chunks linked to the retrieved vectors…
0.874Retrieval-augmented generation (RAG) is a technique that enables large language models (LLMs) to retrieve and incorporate new information from external data…
0.868
Private by default
Your URLs never enter our index
Only pages found by web search are added to the shared index. URLs you send to Contents, the Reader or findSimilar are fetched for you and never indexed, since they may carry private tokens.
Every fetch goes through an SSRF guard: public http(s) addresses only, re-checked on each redirect.
- /v1/search results
- /tavily/search results
- findSimilar results
- /v1/contents URLs
- /r/ Reader URLs
- findSimilar source URL
Code
Retrieve, rank, then embed
Fetch a batch of URLs with exa_py's get_contents on a new base URL, or call the HTTP API. Highlights come back ranked with their scores.
- Up to 10 URLs per call
- 1 credit per page that loads, failures free
- Pruned context in original reading order
# pip install exa-pyfrom exa_py import Exa exa = Exa(api_key="YOUR_API_KEY", base_url="https://api.contextfetch.dev") res = exa.get_contents( ["https://en.wikipedia.org/wiki/Retrieval-augmented_generation"], text=True, highlights={"query": "how does retrieval-augmented generation reduce hallucinations"},)for r in res.results: chunks = r.highlights # ranked passages, ready to embed scores = r.highlight_scores # 0 to 1# Up to 10 URLs per call, 1 credit per page that loadscurl -s https://api.contextfetch.dev/v1/contents \ -H "Content-Type: application/json" \ -d '{"urls":["https://en.wikipedia.org/wiki/Retrieval-augmented_generation"], "text":true, "highlights":{"query":"how does retrieval-augmented generation reduce hallucinations"}, "pruned_context":true}'# One URL as Markdown, pruned to a question (headers report the token savings)curl -si "https://api.contextfetch.dev/r/https://en.wikipedia.org/wiki/Retrieval-augmented_generation?q=how+does+retrieval-augmented+generation+reduce+hallucinations"Pricing
ContextFetch Contents
$1.00per 1,000 pages
One credit per page that loads, with Markdown, highlights and pruned context included. 25 requests a day are free with no key. One-time payment. Credits never expire. Full Markdown and pruning included.
Common questions
Should I use Contents or the Reader?
Contents (POST /v1/contents) takes up to 10 URLs and returns JSON with text, highlights and pruned context per page. The Reader (GET /r/<url>) returns one page as Markdown, pruned when you add ?q=, with the token savings in its response headers. Both cost 1 credit per page.
How are chunks scored?
Each page is split into chunks of roughly 400 to 700 characters, and a cross-encoder (ms-marco-MiniLM-L-6-v2) scores every chunk against your query from 0 to 1. Highlights are the best chunks; pruned context keeps the chunks that pass, in their original order.
Are the URLs I send kept private?
URLs you pass to Contents, the Reader or as the findSimilar source are never added to our shared search index, because they may carry private tokens. A fetched page can sit in a content cache for up to 48 hours to answer repeat requests. URLs with a username or password in them are rejected.
What are the limits per page?
Up to 10 URLs per call, public http(s) addresses only, a 5 MB cap and 15-second timeout per fetch, and only the first 100,000 characters of a page are scored for pruning.
What does a failed page cost?
Nothing. Contents bills one credit per page that loads; a page that fails comes back in statuses with the reason and is not charged.
Does ContextFetch create embeddings?
No. ContextFetch returns clean, ranked text; embed it with the model your vector store already uses.
Read more
Feed your pipeline only what answers the question
Start with no key: 25 free requests a day.