Providers
Context.dev
The Context.dev API for search with Markdown ranked by relevance and for scraping pages into Markdown or HTML.
Provider
Context.dev
- create("context")
- CONTEXT_DEV_API_KEY
- Auth
- Bearer header
- Results
- 10, up to 100 · one page
- Free tier
- credit based
Options
- Filters
includeDomains, excludeDomains - Fields
text, metadata - Read
markdown, html · format, targetSelector, removeSelector, timeout, noCache
Address it
import { create, readUrl } from "@agntn/web";
const context = await create("context"); // CONTEXT_DEV_API_KEY
const results = await context.search("nitro cloudflare preset", { includeDomains: ["nitro.build"] });
const page = await readUrl("https://nitro.build/deploy", { provider: "context", format: "markdown" });
Bearer auth against api.context.dev/v1.
What it reads
| Call | Endpoint |
|---|---|
search | POST /web/search |
read | GET /web/scrape/markdown?… |
What comes back
Each search result carries the page's Markdown in text when Context.dev has it, plus metadata.relevance (high, medium, low) and metadata.markdownCode. Domain filters work. No categories, sources or dates. Reads give markdown or html and take targetSelector, removeSelector, timeout and noCache.
Gotchas
- Spent credits are not a bad key. Context.dev returns 401 with
error_code: "USAGE_EXCEEDED"; the adapter reportsPaymentError, preserving the HTTP status and body. Automatic search and read can try the next configured provider. Other 401 responses remainAuthErrorand stop the chain; an explicit provider never switches. maxResultsgoes up to 100, default 10.- A sign in wall doesn't fail here. Context follows the redirect and returns the login form with a 200. Reddit did that to a thread read:
/login/?reason=lor2and a warm welcome in Spanish. Nice greeting, wrong page. A read that lands on a login path you didn't ask for (login,signin,authwall) throwsPageFetchError. An automatic read moves on to the next reader. Asked for/loginyourself? You get it.
Where it lives
src/providers/context.ts.