Brave Search API Key: Get One and Make Your First Search

Sign up on the Brave Search API page, choose a plan and create a key in the API dashboard. Send it in the X-Subscription-Token header to https://api.search.brave.com/res/v1/web/search with your query in the q parameter. As of October 2026, Search costs $5 per 1,000 requests and includes $5 of free credit each month.

Brave Search API plans, as of October 2026 (brave.com/search/api)
SearchAnswersEnterprise
Price$5 per 1,000 requests$4 per 1,000 requests plus $5 per million input/output tokensContact Brave
Free credit$5 every month$5 every monthNot listed
Rate limit50 queries per second2 queries per secondNot listed

Updated

Build a request below: type a query, choose how many results and the safe search level, and copy a curl command or a fetch snippet. The key field is never filled in for you; paste your own in place of the placeholder on your server.

Request builder

Search query: best bakery website ideas. Results (1 to 20): 10. Safe search: Moderate (default).

curl

curl "https://api.search.brave.com/res/v1/web/search?q=best+bakery+website+ideas&count=10&safesearch=moderate" \
  -H "X-Subscription-Token: <YOUR_API_KEY>"

fetch (server side)

const res = await fetch("https://api.search.brave.com/res/v1/web/search?q=best+bakery+website+ideas&count=10&safesearch=moderate", {
  headers: { "X-Subscription-Token": process.env.BRAVE_SEARCH_API_KEY },
});
const data = await res.json();
console.log(data.web.results);

Monthly cost on the Search plan

Requests per month: 3000

About $10.00 after the monthly free credit, at the October 2026 rate.

Give an agent a search tool

A small function an agent can call. It keeps the key on the server and returns only what the agent needs.

webSearch tool function

Register this with your agent framework as a tool that takes a query string.

export async function webSearch(query) {
  const url = new URL("https://api.search.brave.com/res/v1/web/search");
  url.searchParams.set("q", query);
  url.searchParams.set("count", "5");
  const res = await fetch(url, {
    headers: { "X-Subscription-Token": process.env.BRAVE_SEARCH_API_KEY },
  });
  if (!res.ok) throw new Error("Search failed: " + res.status);
  const data = await res.json();
  return (data.web?.results ?? []).map((r) => ({
    title: r.title,
    url: r.url,
    description: r.description,
  }));
}

Endpoints you will see in the docs

Web search lives at /res/v1/web/search. Images, videos and news have their own paths under /res/v1/, and an LLM context endpoint at /res/v1/llm/context returns text shaped for language models.

All of them use the same key and header, so one key covers each endpoint your plan includes.

How it works

  1. Open the Brave Search API page and select Get API key to reach the API dashboard.
  2. Pick a plan. Brave's documentation does not spell out every screen, so follow the dashboard's own prompts for billing and keys.
  3. Copy the key and store it as an environment variable on your server, never in front-end code.
  4. Call the web search endpoint with the key in the X-Subscription-Token header and read web.results from the JSON reply.

Tips

  • Each result in web.results carries a title, url and description, which is all an agent usually needs.
  • count tops out at 20 results per page, and offset goes up to 9, so one query reaches a limited number of pages.
  • safesearch defaults to moderate. Set it to strict for a tool children might use.
  • The monthly $5 credit covers about 1,000 Search requests at the published rate, enough for testing and small sites.
  • Cache answers to repeated questions on your side; every request counts toward the bill.

Frequently asked questions

Is the Brave Search API free?

Not unlimited. As of October 2026, the Search plan bills $5 per 1,000 requests and includes $5 in free credits every month, so light use can cost nothing.

Which header carries the key?

X-Subscription-Token. Brave's examples send it as a request header on every call; there is no key in the URL.

Can an AI agent use Brave Search as its web search tool?

Yes. Wrap the request in a function your agent framework can call, return the titles, links and descriptions, and let the agent pick what to read. Brave also offers an LLM context endpoint built for this.

What is the Answers plan?

Answers returns written answers instead of a list of links. It is priced per 1,000 requests plus per million tokens and has a lower rate limit of 2 queries per second.

Can I call the API from my website's front end?

You should not, because visitors could read the key in the page code. Call it from your server or a serverless function and send only the results to the browser.

Related: What is an API key, Build an AI agent, What is an MCP server, Webhook vs API.

Build your site free or see all free tools. On We.Inc you can build your site free, with no card and no trial needed to start. AI building is on paid plans from $19 a month.

More in Guides

Product

Who It's For

Features

Resources

Company

View Sitemap