import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.web.search({ query: 'x' });
console.log(response.query);{
"results": [
{
"url": "<string>",
"title": "<string>",
"description": "<string>",
"markdown": {
"markdown": "<string>"
}
}
],
"query": "<string>"
}Search the web and optionally scrape each result to Markdown in one round-trip.
import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.web.search({ query: 'x' });
console.log(response.query);{
"results": [
{
"url": "<string>",
"title": "<string>",
"description": "<string>",
"markdown": {
"markdown": "<string>"
}
}
],
"query": "<string>"
}Documentation Index
Fetch the complete documentation index at: https://docs.context.dev/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Natural-language search query.
1 - 500Allowlist — only return results from these domains. Example: ["arxiv.org", "github.com"].
Blocklist — drop results from these domains. Example: ["pinterest.com", "reddit.com"].
Restrict results to content published within this window.
last_24_hours, last_week, last_month, last_year Expand the query into multiple parallel variants for broader recall.
Inline Markdown scraping for each result. Set enabled: true to activate.
Show child attributes
Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
1000 <= x <= 300000Was this page helpful?