---
title: "Context.dev"
description: "The Context.dev API for search with Markdown ranked by relevance and for scraping pages into Markdown or HTML."
canonical_url: "https://web.agntn.dev/providers/context"
---
# Context.dev

> The Context.dev API for search with Markdown ranked by relevance and for scraping pages into Markdown or HTML.

<provider-facts provider="context">



</provider-facts>

## Address it

```ts
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 reports `PaymentError`, preserving the HTTP status and body. Automatic search and read can try the next configured provider. Other 401 responses remain `AuthError` and stop the chain; an explicit provider never switches.
- `maxResults` goes 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=lor2` and 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`) throws `PageFetchError`. An automatic read moves on to the next reader. Asked for `/login` yourself? You get it.

## Where it lives

`src/providers/context.ts`.


## Sitemap

See the full [sitemap](https://web.agntn.dev/sitemap.md) for all pages.
