How do I choose a web search API for grounding an LLM?
Short answer
Choose by what one call gives the model. A search API that returns only links and snippets forces a second scraping pass before the model can read anything; one that returns ranked results with query-relevant passages or full page Markdown grounds the answer in a single round trip. Then check freshness filters, whether every result keeps a citable URL, MCP availability, and the price per 1,000 results once content is included. Context.dev Search returns ranked results with relevance labels plus highlights or full Markdown in the same call, for 1 credit per 10 results, which is $0.20 per 1,000 results on the Developer plan.
Grounding works when the model sees evidence, not a list of URLs. Most search APIs return titles, URLs, and short snippets, so an agent built on them makes a second call to fetch and clean each page before it can quote anything. That doubles latency and cost and adds a scraper to maintain. Prefer an API whose results carry the passages that match the query, or the whole page as Markdown, and that labels how relevant each result is so the agent can drop the weak ones before they reach the prompt.
Context.dev Search is built around that single round trip. POST /v1/web/search takes the question in plain language (or Google-style operators such as site: and quoted phrases), returns 1 to 100 ranked results with a relevance label on each, and can attach highlights or full page Markdown to every result in the same response. Freshness filters limit results to the last 24 hours, week, month, or year; includeDomains and excludeDomains constrain sources; and a country code localizes results. Pricing is 1 credit per 10 results, plus 1 credit per 10 results for highlights and 1 credit per page for Markdown, so 10 results with Markdown cost at most 11 credits. The free plan’s 1,000 credits cover 10,000 results a month.
Know which endpoint you actually need. Search returns pages and optional content for your application to reason over. Answers takes a research task and an example JSON shape, reads the web, and returns json_content in that shape with the source URLs it used, for 10 credits in Fast mode. Scrape fetches one page you already know. Research agents often chain them: Search to find candidates, Scrape or the Markdown option to read them, Answers when the question needs synthesis across many sources.
Decide with a sample, not a feature list. Run 30 to 50 of your real prompts and score each on whether the returned passages answer the question, how often a stale page sneaks past the freshness filter, whether every quoted claim maps to a URL, and the total credits consumed including content retrieval. Treat all retrieved text as untrusted input in your prompt, since a search result can contain instructions aimed at the model. If your users live in Claude, Cursor, Codex, or ChatGPT, connect the hosted MCP server, which exposes search alongside scrape and crawl with OAuth sign-in.
| What to check | Why it matters | Context.dev Search |
|---|---|---|
| What one call returns | Links alone need a second fetch before the model can read | Ranked results with relevance labels, plus highlights or full page Markdown |
| Freshness and source controls | Stale or off-topic pages produce confident wrong answers | Last 24 hours to last year; include or exclude domains; country |
| Citations | Every claim should map to a URL | Title, URL, description, and relevance on every result |
| Agent access | Assistants should call it without glue code | Hosted MCP server with OAuth sign-in |
| Price per 1,000 results | The comparable number across vendors | $0.20 on the Developer plan; highlights add $0.20, Markdown 1 credit per page |
| Endpoint | Input | Output | Credits |
|---|---|---|---|
| Search | A question or query | Ranked results, optional highlights or Markdown | 1 per 10 results, plus content add-ons |
| Answers | A research task and an example JSON shape | json_content in your shape with source URLs | 10 in Fast mode, 100 in Ultra |
| Scrape | One URL | Markdown, HTML, JSON, screenshots | 1 per page, 5 with JSON extraction |
| If this is your situation | Use |
|---|---|
| The agent must quote passages and cite URLs in one round trip | Search with highlights or Markdown |
| You need a synthesized answer across many sources | Answers |
| You already know the page | Scrape |
| Your users ask inside Claude, Cursor, or Codex | The hosted MCP server |
Last reviewed