Find the right pages.
Bring back the content.
Search the live web for relevant pages, then get their content as Markdown in the same request. Give your agent somewhere useful to start.
Building a RAG pipeline with web data
docs.example.com / guides / rag
Build a RAG pipeline from web content
Collect pages, split the content, and keep a source URL with each chunk.
example.com / engineering / fresh-content
Keep your knowledge base up to date
Refresh changed documents and give your agent current context.
Page content included
Markdown
Teams build with Context.dev
- Search in your own words
- Use a natural-language query or familiar search operators to find relevant pages across the web.
- Read the results
- Optionally include Markdown with each search result. Inspect its scrape status before adding content to your workflow.
- Keep the search focused
- Include or exclude domains, choose a country, and filter by freshness to narrow the results.
One search.
Ready to read.
Set markdownOptions.enabled to collect content with your results. Each result keeps its title, URL, description, relevance, and Markdown status together.
npm install context.devimport ContextDev from 'context.dev';
const client = new ContextDev({ apiKey: 'YOUR_API_KEY' });
const { results } = await client.web.search({
query: 'building a RAG pipeline with web data',
numResults: 5,
markdownOptions: { enabled: true },
});
for (const result of results) {
console.log(result.title, result.url);
if (result.markdown.code === 'SUCCESS') {
console.log(result.markdown.markdown);
}
}From your first requestto a working feature.
Describe what you need
Send a query and set the number of results your application needs.
Choose your sources
Narrow the search by domain, freshness, or country. Enable Markdown when your agent needs to read the pages.
Build on the results
Pass successful page content to your agent, or use Answers when you want a research task completed for you.
A few things
to know.
More details in the API documentation.
How is Search different from Answers?
Search returns relevant pages and optional page content for your application to work with. Answers researches a task and returns structured findings with source URLs.
Can I search only certain websites?
Yes. Use includeDomains or excludeDomains to control which domains appear. Search operators such as site: and quoted phrases are also supported.
Does every result include Markdown?
Enable markdownOptions.enabled to request it. Each result includes a Markdown status code; read the Markdown only when that code is SUCCESS. A page that could not be scraped can still appear as a search result.
Can I search for recent content?
Yes. The freshness parameter narrows results to a supported time window. You can also localize the search with country.
Start with your next request.
One API key for scraping, research, brand data, batches, and monitoring.
