TL;DR
The Brave Search API is one of the few search APIs you can start using in an afternoon: self-serve signup, $5 in free monthly credits, and a public price of $5 per 1,000 requests. This guide walks the whole path: getting an API key (a credit card is required, even for free usage), what the free credits actually buy, and your first calls in Python. Then it covers the step most tutorials stop before: search returns links, and when your project needs the numbers behind those links, a schema-first layer like ScrapeGraphAI turns search results into typed JSON your code can store. Every ScrapeGraphAI example below ran live on July 9, 2026, and the full workflow is in the companion Google Colab.
Most search APIs make you talk to sales or squint at a rate card. Brave does neither. You register, add a card, and you are making requests against an independent index of 30 billion pages within minutes. That makes it the easiest way to give an AI agent real web access without touching Google or Bing.
It also makes it easy to hit the API's natural boundary without noticing. Brave hands your agent ranked URLs and snippets. It does not hand you the pricing table, the spec sheet, or the product attributes sitting on the pages behind those URLs. This guide covers both halves: getting productive with Brave fast, and what to bolt on when links stop being enough.
You can run the extraction half of this guide in the browser without installing anything:

What the Brave Search API Actually Is
Brave Search runs on its own crawler and its own index. The product page claims over 30 billion pages, refreshed by more than 100 million page updates a day. That independence is the pitch: results that do not depend on Google's or Bing's ranking, from a company whose whole brand is not tracking you.
The API surface is wider than most people expect. Beyond web search, the documentation lists news, image, video, and place search, autosuggest, spellcheck, a summarizer, an LLM Context endpoint tuned for RAG pipelines, and Answers, a grounded question-answering product with citations and streaming.
The buyer Brave has in mind is whoever is typing "search api for ai agents" into a search box right now. Sometimes that means a chatbot that has to cite its sources, more often a RAG pipeline that wants fresh pages instead of a stale vector store.
How to Get a Brave Search API Key
The query "brave search api key" gets thousands of searches a month, which is funny because the process takes about five minutes. Here it is, with the one surprise called out.
- Register at api-dashboard.search.brave.com/register. This account is separate from any Brave browser or Brave Rewards account you might have.
- Add a credit card. Yes, even for free usage; this is the surprise. Brave says on the product page that the card is an anti-fraud measure, and you will not be charged while you stay inside the $5 monthly credits, but there is no way around the form.
- Pick a plan. Search and Answers are separate subscriptions, each with its own $5 in free monthly credits. Everything in this guide runs on Search.
- Generate the key from the dashboard. It is a subscription token tied to the plan you picked.
Brave authenticates with a custom header, X-Subscription-Token, not the Authorization: Bearer header most APIs use. Your first request from the terminal:
curl -s "https://api.search.brave.com/res/v1/web/search?q=gpu+cloud+pricing&count=5" \
-H "Accept: application/json" \
-H "X-Subscription-Token: $BRAVE_SEARCH_API_KEY"Keep the key in an environment variable from day one. Subscription tokens map straight to your card, and searching GitHub for leaked X-Subscription-Token strings is exactly the kind of thing bots already do.
What the Free Tier Actually Covers
There is no separate free plan anymore. What Brave gives you is $5 in credits on the first of every month, on both Search and Answers. At $5 per 1,000 Search requests, the free tier is about 1,000 searches a month.
Whether that is generous depends entirely on what you are building. For a prototype or a weekend demo, it is plenty; you will struggle to burn 200 queries. A personal agent is tighter but workable, since an assistant running 30 searches a day lands at roughly 900 a month, just inside the credits. The moment real users show up, forget it. Ten users doing ten searches a day is already 3,000 requests a month, and your card picks up the difference at $5 per thousand.
The credits do not roll over, so an unused month is not a bank you can draw on later. And since the numbers on the product page can change, treat this section as a snapshot from July 2026 and re-check before you commit real volume.
First Real Calls in Python
The same request as the curl above, with the response fields you actually use:
import os
import requests
resp = requests.get(
"https://api.search.brave.com/res/v1/web/search",
headers={
"Accept": "application/json",
"X-Subscription-Token": os.environ["BRAVE_SEARCH_API_KEY"],
},
params={"q": "gpu cloud pricing", "count": 10, "country": "us"},
timeout=30,
)
resp.raise_for_status()
for item in resp.json().get("web", {}).get("results", []):
print(item.get("title"))
print(" ", item.get("url"))Titles, URLs, snippets, and some enriched metadata for content types Brave recognizes. That object shape is the product: whatever endpoint you call, what comes back is search-shaped.
What it costs once the credits run out
| Plan | Price | Capacity |
|---|---|---|
| Search | $5 per 1,000 requests | Up to 50 queries per second |
| Answers | $4 per 1,000 requests, plus $5 per million input and output tokens | Up to 2 queries per second |
| Enterprise | Custom | Custom capacity, zero data retention options, NDAs |
Two things stand out. First, 50 queries per second is real production capacity, not a trial cap. Second, Answers bills tokens on top of requests, so it competes with running your own summarizer over Search results, not with Search itself. If URLs and snippets are all you need, Answers is the wrong product.
For a wider look at this market, including Brave's competitors, I compared the options in Bing Search API Alternatives.
The Wall: Links Are Not Data
Everything up to this point is where most search API tutorials stop. It is also, in my experience, where the real project starts.
Say the demo went well. The next ticket reads: "Track which GPU clouds exist and what an H100 costs per hour on each, in a table, refreshed weekly." Run that query through the code above and you get exactly what a search API is built to give you: ten links, some of them aggregators, some of them official pricing pages, none of them a table.
To close that ticket with a search API alone, you now need to fetch each URL, render the JavaScript-heavy ones, write a parser per site, and keep those parsers alive every time a marketing team redesigns a pricing page. The search call was one line; the glue around it is the actual project.
None of that is a flaw in Brave, it is just where this product category ends. Search APIs sell recall, meaning what pages exist and how they rank. The moment your deliverable is a database row instead of a citation, you are in extraction territory, the same territory I mapped in Scraping Google Search Results with AI Agents.
Search That Returns Typed Results
ScrapeGraphAI approaches the same problem from the data side. Instead of returning search-shaped objects, its search endpoint takes a JSON schema and returns results already shaped like your application's types. Grab a key from the dashboard (free tier, no card required), export it as SGAI_API_KEY, and install the SDK:
pip install "scrapegraph-py>=2" pydanticThe GPU cloud ticket from the previous section, step one, discover the market:
import os
from pydantic import BaseModel, Field
from scrapegraph_py import ScrapeGraphAI
class Provider(BaseModel):
name: str = Field(description="Provider name")
homepage: str = Field(description="Official homepage URL")
pricing_page: str = Field(description="GPU pricing page URL, or 'unknown'")
positioning: str = Field(description="One-line summary of what the provider is known for")
class ProviderList(BaseModel):
providers: list[Provider]
sgai = ScrapeGraphAI(api_key=os.environ["SGAI_API_KEY"])
res = sgai.search(
"GPU cloud providers for AI training and inference",
num_results=6,
prompt=(
"Return the GPU cloud providers a developer would evaluate for training "
"or inference workloads. For each one give the official homepage, the "
"GPU pricing page on the provider's own domain, and a one-line summary "
"of what the provider is known for. Only use URLs on the provider's "
"own website, never aggregator or comparison sites."
),
schema=ProviderList.model_json_schema(),
)
if res.status != "success":
raise RuntimeError(res.error)
market = ProviderList.model_validate(res.data.json_data)
watchlist = {}
for p in market.providers:
if not p.pricing_page.startswith("http"):
continue
p.pricing_page = p.pricing_page.split("?")[0]
watchlist.setdefault(p.name.lower(), p)
for p in list(watchlist.values())[:8]:
print(f"{p.name:14} {p.pricing_page}")
print(f"{'':14} {p.positioning}")Live output from July 9, 2026, trimmed:
GMI Cloud https://www.gmicloud.ai/nvidia-h200
Specialized AI cloud offering cost-effective, on-demand access to NVIDIA H100, H200 and next-gen Blackwell GPUs.
Amazon Web Services (AWS) https://aws.amazon.com/ec2/pricing/on-demand/
Industry-leading cloud platform with a wide range of GPU instances for AI workloads
Lambda Labs https://lambdalabs.com/service/gpu-cloud-pricing
AI-centric cloud built by researchers, providing easy access to high-performance NVIDIA GPUs like H100 and A100.
CoreWeave https://coreweave.com/pricing
Specialized GPU cloud with a Kubernetes-native platform, strong NVIDIA partnership, and GPU-first infrastructure.
Runpod https://runpod.io/pricing
All-in-one platform to train, fine-tune, and deploy AI applications, with simple pricing and low-latency inference.One call handled both the searching and the reading, and the result came back already typed. The dedupe loop also strips tracking parameters, because several results linked official pages through referral URLs. Real web data is messy like that, and it is cheaper to clean a typed field than to parse a results page.
The same endpoint exists in the JavaScript SDK and as a plain REST call with curl, so none of this locks you into Python.
Extract the Numbers the SERP Can Only Point At
Step two of the ticket: turn three of those pricing pages into one table. This is the part no search API can do, and it is one schema and one loop:
import os
from pydantic import BaseModel, Field
from scrapegraph_py import ScrapeGraphAI
class GpuPrice(BaseModel):
gpu_model: str = Field(description="GPU model as shown, for example NVIDIA H100 SXM")
vram: str = Field(description="VRAM per GPU as shown, or 'not stated'")
hourly_price: str = Field(description="On-demand hourly price as shown, or 'custom'")
notes: str = Field(description="Caveat shown next to the price, for example per-instance pricing, or 'none'")
class GpuPriceList(BaseModel):
gpus: list[GpuPrice]
providers = {
"Lambda": "https://lambda.ai/pricing",
"RunPod": "https://www.runpod.io/pricing",
"CoreWeave": "https://www.coreweave.com/pricing",
}
sgai = ScrapeGraphAI(api_key=os.environ["SGAI_API_KEY"])
matrix = {}
for name, url in providers.items():
res = sgai.extract(
prompt=(
"Extract every GPU listed with an on-demand hourly price on this "
"page: GPU model, VRAM, hourly price, and any caveat shown next to "
"the price, for example when the price covers a whole multi-GPU "
"instance. Report only what the page shows. If a GPU has no public "
"price, use 'custom'."
),
url=url,
schema=GpuPriceList.model_json_schema(),
)
if res.status != "success":
print(f"skipping {name}: {res.error}")
continue
matrix[name] = GpuPriceList.model_validate(res.data.json_data)
for name, pricing in matrix.items():
print(f"\n{name}")
for gpu in pricing.gpus[:4]:
print(f" {gpu.gpu_model:32} {gpu.vram:12} {gpu.hourly_price:10} {gpu.notes}")Live output from the same run, trimmed:
Lambda
NVIDIA HGX B200 not stated $9.86 price per cluster (16 GPUs)
NVIDIA HGX B200 not stated $9.36 price per cluster (64 GPUs)
NVIDIA H100 not stated $6.16 price per cluster (16 GPUs)
RunPod
B300 288 GB HBM3e $7.39/hr none
H200 141 GB $4.39/hr none
B200 180 GB $5.89/hr none
CoreWeave
NVIDIA GB300 NVL72 279 custom Contact sales
NVIDIA GB200 NVL72 186 $42.00 none
NVIDIA HGX B200 180 $68.80 noneLook at the notes column. Lambda quotes cluster prices, RunPod quotes per GPU, and CoreWeave lists multi-GPU instances, so the raw hourly numbers are not comparable until you normalize the units. A hand-written parser would have silently mixed those up. A schema with an explicit caveat field surfaces the trap in the output itself.
One design lesson from building this example. An earlier version of the schema asked the model to also return the provider name and source URL. With a prompt that says "report only what the page shows," it correctly refused to fill fields the page does not literally contain. The fix was better code, not a pushier prompt: your loop already knows the provider and the URL, so keep known values in your code and ask the model only for what lives on the page.
From here, persistence is the boring part it should be: model_dump() each row, add the provider name and a date, and write to CSV or upsert into Postgres. When a vendor redesigns a page, the schema stays the same and there is no parser to fix.
Which Layer Does Your AI Agent Need?
"Search API for AI agents" gets treated as one product category. In practice agents consume the web at three different layers, and picking the wrong one is how projects end up with either a useless pile of links or an oversized scraping bill.
The first layer is citations. The agent needs to say "according to these pages," so ranked URLs and snippets are the deliverable. That is the Brave Search API's home turf, with an independent index and enough QPS for production traffic.
The second is grounded answers, where the agent wants a summarized answer with sources attached and you would rather not run the summarizer yourself. Brave sells that too, as Answers, priced per request plus tokens.
The third layer is typed records: prices, specs, availability, positions. Fields your product stores. That is schema-first search and extraction, which is what ScrapeGraphAI is built for, and the rank tracking pattern is the same idea pointed at SERPs themselves.
These layers stack, to be clear. Some teams run Brave for recall and ScrapeGraphAI for extraction, and that is a perfectly good pipeline. If your workload starts at layer three, ScrapeGraphAI's search already covers discovery, and one vendor is enough. What you should not do is buy a search API and then hand-build layer three out of requests, BeautifulSoup, and hope. That glue layer is where the quarter goes.
ScrapeGraphAI is not a replacement for Brave's index, and I am not going to pretend otherwise. If independent-index recall or privacy guarantees are the requirement, use Brave. If typed data is the requirement, skip the glue.
Final Recommendation
The Brave Search API earns its popularity: real self-serve signup, public pricing at $5 per 1,000 requests, $5 in monthly free credits, and an independent index that gives agents genuinely different results. Getting the key takes five minutes, as long as you have a card ready.
Just be clear about which ticket you are closing. If the deliverable is links and citations, Brave alone finishes the job. If the deliverable is data, sign up for ScrapeGraphAI, export SGAI_API_KEY, and the two scripts above take you from market discovery to a normalized pricing table in one sitting. Both scripts, ready to run, are in the companion Colab.
Related Articles
- Bing Search API Alternatives: 7 Best Replacements in 2026 - The wider search API market, including where Brave fits
- Rank Tracking API for Developers - Turn SERPs themselves into typed position records
- ScrapeGraph vs SerperAPI: Web Data Extraction 2026 - Search-shaped JSON versus schema-first extraction, head to head
- Scraping Google Search Results with AI Agents - Extraction patterns for search result pages
- Firecrawl Pricing: Plans, Credits, and Costs - Cost math for the extraction side of the stack