4Geeks chosen to deliver AI education in the Bahamas alongside Harvard, Oxford, and Columbia.See more
16 min read

Web Search API for AI Agents: Search vs Scrape vs RAG

Compare web search APIs for AI agents: Cloudflare AI Gateway vs Tavily, Exa, and Brave, plus when to scrape or use RAG instead.

Updated 2026-11-18

A web search API is a live web index your agent queries for ranked URLs and snippets. A scrape or fetch tool reads pages you already know. RAG over your own docs answers from private material, not the open web. Pick search when the agent must discover sources, scrape when you have the URL, RAG when the corpus is yours. Cloudflare's Web Search API (via AI Gateway, open beta since Oct 2, 2026), DeepSeek's Search API (open to all developers since Oct 17, 2026) and standalone options like Tavily, Exa, and Brave all solve discovery. They do not replace each other one for one.

Last verified: Nov 18, 2026. On Nov 18, 2026 we added Brave's pay per request option over x402 from Brave's announcement and agent payments docs, and rechecked DeepSeek's Search & Fetch guide. DeepSeek's Search and Fetch APIs were added on Oct 22, 2026, from that guide and the API changelog. The other prices and launch facts were last checked on Oct 5, 2026 and are tied to the official links on this page (Cloudflare providers and Birthday Week blog, Exa pricing, Tavily credits, Brave Search API). Native Cloudflare "server tools" were still listed as coming soon on Oct 5, so you orchestrate the tool call yourself. Treat any comparison older than about two months as stale, including this one if you find it later.

Search vs scrape vs RAG

Before you buy an API key, name the job. Most "my agent needs the web" tickets are actually one of these three.

ApproachWhat it doesWhen to pick it
Web search APIQuery a live index; get ranked titles, URLs, snippetsAgent must find sources it does not already know
Scrape / fetchFetch and clean a known URL (or crawl from a seed)You already have the page; you need its body
RAG over your docsRetrieve chunks from your corpus, then generateAnswers must come from private or controlled material

Search discovers. Scrape reads. RAG remembers your stuff. An agent that guesses URLs needs search first. An agent that already holds a permalink needs fetch. An agent answering from SOPs and tickets needs RAG, not a public index. For scrape oriented tooling, see Firecrawl Free Keyless. Broader tool context lives in the AI tools hub.

Some vendors now sell both halves. DeepSeek's Search API finds pages for a query, and its separate Fetch API takes one URL and returns the page as Markdown, each billed on its own. That's search and scrape from one key, but they're still two calls, and you still decide which one the agent needs.

Steal this rule: if the model invents links, add search. If the model has the link but invents the body, add fetch. If the answer must stay inside your files, add RAG.

Category table: how the search products differ

OptionCategoryHow you call itBilling shape (verified Oct 5, 2026)Best fit
Cloudflare Web Search APIAggregator via AI GatewayREST or Workers env.AI.websearchPartner list price, no Cloudflare markup; BYOK allowedYou already use AI Gateway and want one bill plus logs
Ceramic.ai (via Cloudflare)AI oriented web indexprovider: ceramic (default)$0.25 per 1,000 requestsMany agent loops; cheap grounding
Linkup (via Cloudflare)AI search with sourced snippetsprovider: linkup$5.00 per 1,000 requestsFast cited results for tool calls
Exa (via Cloudflare or direct)Neural + keyword AI searchCloudflare provider: exa, or Exa /search$7.00 per 1,000 requests (up to 10 results on auto/fast)Query relevant highlights into context
TavilyAgent first search + extractTavily /search (and related)Credits: free 1,000/mo; basic/fast/ultra-fast = 1 credit; advanced = 2; pay as you go $0.008 per creditLangChain style agents that want search + extract in one vendor
Brave Search APIIndependent web indexBrave REST with an API key (/web/search, LLM context, Answers), or the keyless x402 proxy search.agent.s.brave.appSearch $5 per 1,000 requests on an API key plan; or $0.005 per request paid in USDC on Base over x402, no key or account (since Nov 12, 2026)You want an independent index outside Cloudflare's partners, or an agent that pays per search on its own
DeepSeek Search and FetchIn house AI search index plus a page to Markdown fetchDeepSeek /v1/tools/search and /v1/tools/fetch$0.75 per 1,000 successful requests each (verified Nov 18, 2026); searches the model runs through DeepSeek's server side tools bill tokens onlyCheap search plus fetch from one vendor, if you already use the DeepSeek API

Cloudflare partners at launch are Ceramic.ai, Exa, and Linkup (providers docs). Responses must include a link to the source. Partners commit to Cloudflare's Verified bot crawling rules. Ceramic and Linkup are marked Zero Data Retention Yes on that providers page; Exa is marked No for ZDR there, which is the detail most launch posts gloss over.

Cloudflare vs Tavily / Exa / Brave

Cloudflare Web Search API (via AI Gateway)

Cloudflare's product is not a fourth index. It is a control plane: one REST shape, one Workers binding, AI Gateway logs, and credits that debit at each partner's list price with no extra markup (Web Search overview, Birthday Week announcement). You can also bring your own provider key.

What doesn't get said. Native server tools are still "coming soon," so today your app (or agent runtime) must call web search, then pass results back into the model as context. You also inherit each provider's quirks: Ceramic returns long descriptions (up to 8,000 characters), Exa through the gateway uses Exa's auto mode with highlights as the description, Linkup uses fast depth with raw results (no generated answer). Switching provider keeps the response shape, not the ranking quality.

Verdict: pick Cloudflare when AI Gateway is already your inference front door and you want search in the same observability and credit pool. Avoid treating it as a quality ranking across Ceramic, Exa, and Linkup; run your own evals.

Ceramic.ai through Cloudflare

Default provider. Independent index oriented at agents and LLMs, more than 40 billion pages per Cloudflare's docs. Price is the standout: $0.25 per 1,000 requests.

What doesn't get said. Cheap search still burns budget when an agent loops twenty queries per task. Long descriptions are generous for grounding and expensive for context windows if you dump five full descriptions every turn.

Verdict: best default for high volume grounding and "did the model invent this URL?" checks. Avoid it if you need Exa style neural retrieval features that only show up on Exa's own API surface.

Linkup through Cloudflare

$5.00 per 1,000 requests, Zero Data Retention yes, fast search depth, sourced snippets without a vendor written answer.

What doesn't get said. Fast mode is the gateway path; if you need Linkup's slower or answer generating modes, call Linkup directly. Cloudflare's wrapper is optimized for tool call style results, not deep research reports.

Verdict: solid middle price cited results for agents that must show sources. Avoid it if you already standardized on Exa highlights or Brave's LLM context endpoint.

Exa through Cloudflare (and direct)

Through Cloudflare: $7.00 per 1,000, auto search, highlights as descriptions. Direct Exa /search on fast or auto is the same $7 per 1,000 for up to 10 results with text and highlights included (Exa's instant mode is cheaper at $4 / 1k on Exa's own pricing page; extra results and summaries bill separately).

What doesn't get said. Cloudflare's providers table marks Exa Zero Data Retention as No, unlike Ceramic and Linkup. If ZDR is a hard requirement, do not assume the gateway magically adds it. Deep modes (Deep Lite, Deep, Deep Reasoning) live on Exa's own API, not on the Cloudflare wrapper's launch surface.

Verdict: pick Exa when natural language queries and tight highlights matter more than the lowest unit price. Prefer direct Exa when you need deep modes or content controls the gateway does not expose yet.

Tavily

Built as search for LLM agents, with extract, crawl, and map siblings. Search depth trades cost for relevance: per Tavily's credits docs and search API, basic, fast, and ultra-fast cost 1 credit; advanced costs 2. Free plan includes 1,000 credits per month; pay as you go is $0.008 per credit (plans).

What doesn't get said. Credit math is easy to undercount once you turn on include_raw_content, advanced depth, or Research endpoints (Research has its own min/max credit bounds). Tavily is a full retrieval toolkit, not only a SERP JSON dump.

Verdict: pick Tavily when your stack already expects an agent search SDK and you want search plus extract from one vendor. Avoid it if you only need an independent index and already pay Brave or Cloudflare credits.

Brave Search API

Independent index that Brave crawls and serves itself, with no fallback to Google or Bing, per Brave. Search plan list price $5 per 1,000 requests. Separate Answers product is $4 per 1,000 plus $5 per million input/output tokens on that same page. LLM context endpoint exists for grounding style payloads.

Since Nov 12, 2026 there's a second way in that skips the API key entirely (Brave announcement). Your agent sends the request to Brave's proxy at search.agent.s.brave.app, gets back an HTTP 402 Payment Required response with the price, signs a USDC payment on the Base network and retries. The signed payment is the credential, so there's no account and no plan to pick. Each request costs $0.005 ($5 per 1,000) for LLM Context, web, news, images, videos and local search, the same as the published API rate. Brave says it covers the Base gas fees for a limited time. Answers, Autosuggest and Spellcheck aren't sold this way yet and still need an API key (agent payments docs). The API key plans haven't gone anywhere; x402 is an extra option, not a replacement.

What doesn't get said. Brave is not a Cloudflare AI Gateway partner in this launch. On an API key plan you manage a separate key, bill, and rate limit. The x402 route drops the key and the account, but now your agent needs a funded crypto wallet, and every search is a payment you have to cap and track. Storage rights for training require a plan that explicitly grants them.

Verdict: pick Brave when independence from Google/Bing scrapers and from Cloudflare's partner set matters. Try the x402 route when you want an agent to buy its own searches without signing up first. Avoid it if one consolidated AI Gateway bill is the whole point, or if nobody on your team wants to manage a stablecoin wallet.

DeepSeek Search and Fetch

DeepSeek opened both APIs to all developers on Oct 17, 2026 (changelog). Search runs on DeepSeek's in house search engine and returns ranked results with a short snippet, a longer summary meant for a model, an authority tier and, if you ask, the page content. Fetch takes one URL and returns its content as Markdown. Both use your normal DeepSeek API key. Each costs $0.75 per 1,000 successful requests, and failed calls, empty results and timeouts aren't billed. Account limits are 100 requests per second for Search and 25 for Fetch.

What doesn't get said. Who pays per request depends on how the search runs. Per DeepSeek's guide (checked Nov 18, 2026), searches the model makes through server side tools, like the web tools, web_search in the Responses API or Web Search in Claude Code, bill model tokens only. Calls that hit the Search and Fetch APIs directly from your client, like Codex Alpha Search, bill $0.75 per 1,000. DeepSeek also sits outside Cloudflare's partner set, so it's another key and another bill. And on Oct 20, 2026 the US Department of Homeland Security published an order removing DeepSeek products from federal civilian agency IT systems (Federal Register), so skip it if you build for those agencies.

Verdict: pick DeepSeek when you already use its models and want search plus fetch at $0.75 per 1,000 from one key. Check which of your tools call the APIs directly, since those are the calls that bill per request. Avoid it if you sell to US federal civilian agencies or want everything behind one Cloudflare bill.

Grounding with citations

The useful pattern is boring on purpose:

  1. The model decides it needs live evidence and calls a web_search tool with a concrete query.
  2. Your runtime hits Cloudflare Web Search, DeepSeek, Tavily, Exa, or Brave and gets titles, URLs, and snippets.
  3. You pass those results back as tool results (or a short context block), not as silent system prompt folklore.
  4. The model answers and cites the URLs it actually used.

That is the same discipline as RAG, except the corpus is the public web for this turn. Search without citations just moves the hallucination from facts to "sources." Scrape without search only helps after discovery. Keep the three layers separate in your agent graph: discover (search), read (fetch), remember (RAG).

Which should I pick?

If you need...Start withSkip when...
One bill and logs next to model callsCloudflare Web Search API (Ceramic default)You refuse any Cloudflare dependency
Cheapest high volume groundingCeramic via Cloudflare ($0.25 / 1k)You need Exa deep modes
Cited fast tool results at mid priceLinkup via Cloudflare or Brave Search ($5 / 1k)You need ZDR and were about to pick Exa via Cloudflare without reading the ZDR column
Neural search + highlightsExa ($7 / 1k on auto/fast)ZDR is mandatory on Cloudflare's path
Search plus page fetch from one key at the lowest per call price we found outside CloudflareDeepSeek Search and Fetch ($0.75 / 1k each)You build for US federal civilian agencies, or your agent loop calls the APIs directly thousands of times a day
Search with no account or API key, paid per call by the agentBrave via x402 ($0.005 per request in USDC on Base)You can't run a crypto wallet, or you need Brave Answers, Autosuggest or Spellcheck
Search + extract + crawl in one agent SDKTavilyYou only need SERP style JSON
Private company answersRAG over your docsYou are trying to replace a shared drive with Google results
Known URL body textScrape / fetchThe agent still does not know which URL to open

Soft next step if you are building agents for real

If you already ship production code and the gap is agents, memory, and retrieval rather than "what is an LLM," compare self paced paths that start at that gap. AI Flex is built for developers who want agents and RAG without a fixed cohort lock in. Use the program comparison to see which program fits before you buy another API key you will not wire into a real loop.

FAQ

What is a web search API for an AI agent?

It is an HTTP API that returns ranked live web results (titles, URLs, snippets) your agent can pass into a model as evidence. It is discovery, not a full page download and not private document search.

How is a web search API different from scraping?

Search finds candidate URLs from a query. Scraping fetches and cleans pages you already chose. Agents that skip search and guess URLs fail differently from agents that skip fetch and invent page contents.

How is web search different from RAG?

RAG retrieves from a corpus you control (handbooks, tickets, specs). A web search API retrieves from a public index. Many production agents use both: RAG for internal truth, search for fresh external context.

What did Cloudflare launch on Oct 2, 2026?

A Web Search API in open beta through AI Gateway, with partners Ceramic.ai, Exa, and Linkup, callable via REST or the Workers AI binding (announcement, docs). Billing uses AI Gateway credits at partner list prices with no Cloudflare markup, or bring your own key.

How much do Cloudflare's search providers cost?

Per Cloudflare's providers docs (checked Oct 5, 2026): Ceramic $0.25, Linkup $5.00, Exa $7.00 per 1,000 requests when paid with AI Gateway credits.

How much do DeepSeek's Search and Fetch APIs cost?

$0.75 per 1,000 successful requests for each API, per DeepSeek's Search & Fetch guide (checked Nov 18, 2026). Failed calls, empty results and timeouts aren't billed. Searches the model runs through DeepSeek's server side tools, such as Web Search in Claude Code, bill model tokens only.

Should I use Cloudflare or call Tavily, Exa, or Brave directly?

Use Cloudflare when you want gateway logging and a shared credit pool across Ceramic, Exa, and Linkup. Call vendors directly when you need features the gateway does not expose (Exa deep modes, Tavily extract/crawl, Brave Answers) or when you want Brave's independent index outside that partner set.

Can an AI agent pay for Brave Search without an API key?

Yes. Since Nov 12, 2026, Brave's proxy at search.agent.s.brave.app accepts x402 payments: the agent pays $0.005 per request in USDC on Base and the signed payment replaces the key (Brave announcement, agent payments docs). It covers LLM Context, web, news, images, videos and local search. Answers, Autosuggest and Spellcheck still need an API key, and the regular API key plans are still available.

Building agents and still guessing which path fits?

See how AI Flex covers agents, RAG, and production workflows without a fixed cohort. Get the details and compare programs.

Frequently Asked Questions