Search API Endpoints, LLM Context, Place Discovery, and Media Results
How to authenticate, query web and media search APIs, ground LLMs with context, fetch POIs, and compare response shapes with Perplexity.
This page summarises Brave Search API documentation for programmatic search: shared authentication, the main Web Search endpoint, agent-oriented LLM Context, geographic Place Search, image, news, and video APIs, and Suggestions. Perplexity appears only where the cluster documents a simpler, flat search result model for comparison.
Search API authentication: subscription token header
Section titled “Search API authentication: subscription token header”Every Brave endpoint in this cluster expects a subscription token in the request header, not in the query string.
X-Subscription-Token: YOUR_API_KEY
— Brave, Authentication
The API references name the same header x-subscription-token (case-insensitive in HTTP). JSON responses are the default (accept: application/json). Optional headers used across services include api-version (format YYYY-MM-DD, default latest), Cache-Control: no-cache for a best-effort cache bypass, and a browser-style user-agent when you want device-tuned experiences.
Brave Search will return cached content by default. To prevent caching set the Cache-Control header to no-cache. This is currently done as best effort.
— Brave, Search
Web search API: query limits, pagination, and result_filter
Section titled “Web search API: query limits, pagination, and result_filter”Web Search and the POST variant share the same parameters. The required q parameter cannot be empty and is capped at 600 characters and 75 words.
The user’s search query term. Query can not be empty. Maximum of 600 characters and 75 words in the query.
— Brave, Search
Locale controls include country (default US, including ALL), search_lang (default en), and ui_lang (default en-US). For adult-content filtering, web search documents safesearch as off, moderate (default), or strict; Web Search service wording for strict mentions explicit and suggestive content, while the video API reference says strict drops all adult content—treat strict as the strictest setting and read the endpoint doc you integrate against.
Web search pagination: count and offset apply to web results only
Section titled “Web search pagination: count and offset apply to web results only”Pagination is easy to misconfigure. count defaults to 20, ranges 1–20, and offset is a page index from 0 to 9, not a row skip. Increment offset by 1 for each page when count stays fixed; delivered counts may be below what you request, and pages may overlap.
NOTE: Count only applies to web results.
— Brave, Search
For example, if your user interface displays 10 search results per page, set count to 10 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 1 (for example, 0, 1, 2). It is possible for multiple pages to include some overlap in results.
— Brave, Search
Filtering verticals: freshness, Goggles, and plan-gated types
Section titled “Filtering verticals: freshness, Goggles, and plan-gated types”freshness filters by page age (pd, pw, pm, py, or YYYY-MM-DDtoYYYY-MM-DD), using the most relevant published or modified date on the page. result_filter is a comma-delimited list of blocks to return; if omitted, Brave returns every type that has data and your plan allows.
A comma delimited string of result types to include in the search response. Not specifying this parameter will return back all result types in search response where data is available and the plan has the corresponding option activated. The response always includes query and type to identify any query modifications and response type respectively.
— Brave, Search
Allowed filter values include web, news, videos, discussions, locations, faq, infobox, summarizer, and query. Replace deprecated goggles_id with goggles (URL or inline definition, up to three Goggles). An example goggle URL from the cluster is hacker_news.goggle.
Goggles act as a custom re-ranking on top of Brave’s search index.
— Brave, Search
Optional extra_snippets adds up to five alternate excerpts per result. Set summary=true when you need summarizer support; that flag is required before summarizer appears in result_filter. enable_rich_callback=true requests real-time rich verticals via callback and requires a Search plan.
Enable rich callback. Allows you to get real time rich results via a callback URL when they are relevant to your query. NOTE: Requires Search plan.
— Brave, Search
Web search response JSON: query, vertical blocks, and mixed ordering
Section titled “Web search response JSON: query, vertical blocks, and mixed ordering”A 200 response has type: search, a rich query object (original, altered, show_strict_warning, is_geolocal, summary_key, search_operators, and more), and optional vertical sections such as web, news, videos, discussions, locations, faq, infobox, summarizer, and rich. The mixed block lists preferred SERP positions in main, top, and side arrays. Individual web.results[] items can carry schemas (schema.org-like extracts), extra_snippets, and nested attachments (location, product, recipe, and others). Use location instead of deprecated restaurant.
Deprecated. Use location instead.
— Brave, Search
POI id values in web or place flows are short-lived:
A temporary id associated with this result, which can be used to retrieve extra information about the location. It remains valid for 8 hours.
— Brave, Search
Local search: x-loc-* headers and two-step POI detail
Section titled “Local search: x-loc-* headers and two-step POI detail”Optional client location headers (x-loc-lat, x-loc-long, x-loc-city, x-loc-state, x-loc-country, x-loc-postal-code, and related fields) steer local relevance on web search and LLM Context.
Web Search service describes local enrichments (extra POI imagery and mentions) as distinct from rich data enrichments (third-party real-time widgets). Full POI detail uses a separate flow: collect id values from web (or place) results, then call /local/pois (max 20 ids per request) and optionally /local/descriptions for AI-generated text.
Note that the id fields of POIs are ephemeral and will expire after approximately 8 hours. Do not store them for later use.
— Brave, Web Search
Place Search targets physical locations (businesses, landmarks, addresses) rather than HTML pages. You may omit q for area explore mode, anchor with coordinates or a location string, and use radius in meters as a bias, not a hard geofence. Response buckets include results, cities, addresses, and mixed ordering hints; clients that only need one bucket can read that array directly.
Clients that only care about a single bucket (e.g., POIs) can ignore mixed and read results directly.
— Brave, Place search service
LLM Context API: grounding snippets for agents and chatbots
Section titled “LLM Context API: grounding snippets for agents and chatbots”LLM Context searches the web and returns grounding payloads—generic[] with url, title, and relevance-selected snippets[], plus optional poi and map when local recall runs—alongside a sources map keyed by URL. Use it when you need token-budgeted text for RAG or tool-using agents instead of raw SERP links alone.
Location-aware queries with point-of-interest and map data
— Brave, LLM Context service
Key limits on GET and POST: q up to 600 characters / 75 words; count 1–50 for candidate URLs (default 20); maximum_number_of_tokens default 8192 (range 1024–32768); maximum_number_of_tokens_per_url default 4096. Pin api-version if you rely on a specific content pipeline—the service changelog notes a new pipeline by default and Api-Version: 2026-02-06 for the previous one.
enable_local auto-detects from location headers; you may force true or false when you need to override. Safesearch on LLM Context allows off, moderate, or strict; when unset, no filtering is applied except local recall, which stays strict—unlike News Search, where default is strict.
For most use cases, you can omit enable_local entirely and let the API auto-detect based on whether you provide location headers. Set it explicitly only when you need to override the default behavior.
— Brave, LLM Context service — Local Recall
Use the smallest maximum_number_of_tokens that meets your needs
— Brave, LLM Context — Performance
Snippet semantics:
Extracted text chunks from the page that are picked for their relevance to the query.
— Brave, LLM Context GET
Image, news, and video search APIs: limits and pagination differences
Section titled “Image, news, and video search APIs: limits and pagination differences”Endpoint behaviour diverges; do not assume web-search pagination rules everywhere.
| Endpoint | q limit |
count |
Pagination | Default safesearch |
|---|---|---|---|---|
| Image search | 400 chars, 50 words | 1–200 | No offset—raise count |
strict (off or strict only) |
| News search | 400 chars, 50 words | 1–50 | offset 0–9 (page style) |
strict (off / moderate / strict) |
| Video search | 400 chars, 50 words | 1–50 | offset 0–9; overlap possible |
moderate |
Image search exposes query.show_strict_warning when strict filtering removes all results. News supports extra_snippets and the same freshness tokens as LLM Context. Video results are video_result objects with nested video metadata (duration, views, author) and the same strict-warning pattern.
NOTE: Image search is not paginated and has no offset parameter. Raise count to get more results.
— Brave, Image search — count
For agent-side image tools, Perplexity Agent API image_search caps max_results at 30 (default 5). Legacy Sonar media returns at most 30 images when return_images: true, with optional domain and format filters. Common conclusion: Brave’s dedicated image API allows a higher single-request count (up to 200) and no page offset; Perplexity bundles fewer images per call inside agent or Sonar flows.
Spellcheck: embedded in search vs dedicated spell check API
Section titled “Spellcheck: embedded in search vs dedicated spell check API”With spellcheck=true (default on web and video search), Brave always searches using the corrected query; inspect query.altered.
Whether to spell check provided query. If the spell checker is enabled, the modified query is always used for search. The modified query can be found in altered key from the query response model.
— Brave, Search
The standalone Spell check endpoint uses a stricter q (400 characters, 50 words). lang and country are hints only. Use it when you want corrections without executing a full search.
Autosuggest API: query completions and rich suggestions
Section titled “Autosuggest API: query completions and rich suggestions”Suggestions returns type: suggest, query.original, and results[] with suggested query strings. Types include query, entity, and calculator; unknown future types should be treated like plain query suggestions.
New kinds may be added, so treat an unrecognised value as a plain query suggestion.
— Brave, Suggestions
count is 1–20 (default 5); there is no offset. Setting rich=true needs a paid autosuggest subscription.
Whether to enhance suggestions with rich results. This requires a paid autosuggest subscription.
— Brave, Suggestions
Perplexity search responses: flat page list vs multi-vertical SERP
Section titled “Perplexity search responses: flat page list vs multi-vertical SERP”Perplexity Search POST documents a compact ApiSearchResponse: required results[] with title, url, snippet, optional date and last_updated, plus id and optional server_time. Legacy Sonar Pro Search stream mode (Concise) examples show the same per-row shape; server_time may be null.
Brave web search, by contrast, returns many parallel verticals, explicit query metadata, Goggles mutation flags, and layout via mixed. Common conclusion: choose Perplexity when a uniform list of pages with snippets is enough; choose Brave web search when you need news, video, and discussion blocks, local POI ids, summarizer keys, rich callbacks, or fine-grained filters in one response.
Common mistakes when integrating search APIs
Section titled “Common mistakes when integrating search APIs”- Treating
offsetas a row index instead of a page index paired withcount. - Expecting
countto capnews,videos, ordiscussionson web search—it applies towebonly. - Storing POI or location
idvalues longer than ~8 hours before calling Local POIs. - Requesting image pagination via
offset(unsupported—increasecountup to 200). - Ignoring
query.show_strict_warningwhensafesearch=strictyields empty image or video results. - Assuming LLM Context safesearch defaults match news search (unset means no filter except strict local recall).
- Using deprecated
goggles_idor more than three Goggles. - Enabling
summarizerinresult_filterwithoutsummary=true. - Calling Spell check with a 600-character web-search query.
How to check this on your site
Section titled “How to check this on your site”-
Confirm requests send
X-Subscription-Tokenper Authentication and receive JSON from the Brave Search API dashboard reference for your endpoint. -
Run a minimal web search with
q, then togglespellcheckand comparequery.originalvsquery.alteredin Search. -
Paginate web results with fixed
countandoffset0 then 1; verifyquery.more_results_availableand expect possible overlap per the API note. -
For a local query, resend with
x-loc-latandx-loc-long, then within eight hours fetch details via local_pois using ids from the search response. -
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page disagrees with the linked provider docs or your integration behaviour, write to yimasynthetic@gmail.com with the page URL and the exact statement you want clarified.