LLM Context
Pre-extracted web content optimized for AI agents, LLM grounding, and RAG pipelines. Use this API to get the context for your LLM or AI agent.
Authorization
Request Body
The user’s search query term. Query can not be empty. Maximum of 400 characters and 50 words in the query.
country enum<string> The search query country, where the results come from. The country string is limited to 2 character country codes of supported countries.
Available options:
ARAUAT search_lang enum<string> The search language preference. The 2 or more character language code for which the search results are provided.
Available options:
areubn count integer The maximum number of search results considered to select the LLM context data. The default is 20 and the maximum is 50.
maximum_number_of_tokens integer Approximate maximum number of tokens to include in context. The default is
8192 and maximum is 32768.maximum_number_of_snippets integer Maximum number of different snippets (or chunks of text) to include in LLM context. The default is
50 and maximum is 100.context_threshold_mode enum<string> The mode to use to determine the threshold for including content in context. Default is
balanced.Available options:
disabledstrictlenient maximum_number_of_tokens_per_url integer Maximum number of tokens to include per URL. The default is
4096 and maximum is 8192.freshness string Filters search results by page age. The age of a page is determined by the most relevant date reported by the content, such as its published or last modified date. The following values are supported:
- pd - Pages aged 24 hours or less.
- pw - Pages aged 7 days or less.
- pm - Pages aged 31 days or less.
- py - Pages aged 365 days or less.
- YYYY-MM-DDtoYYYY-MM-DD - A custom date range is also supported by specifying start and end dates e.g.
2022-04-01to2022-07-30.
Headers
The latitude of the client’s geographical location in degrees, to provide relevant local results. The latitude must be greater than or equal to -90.0 degrees and less than or equal to +90.0 degrees.
The longitude of the client’s geographical location in degrees, to provide relevant local results. The longitude must be greater than or equal to -180.0 and less than or equal to +180.0 degrees.
A code which could be up to three characters, that represent the client’s state/region. The region is the first-level subdivision (the broadest or least specific) of the ISO 3166-2 code.
The name of the client’s state/region. The region is the first-level subdivision (the broadest or least specific) of the ISO 3166-2 code.
x-loc-country enum<string> The two letter country code for the client’s country. For a list of country codes, see ISO 3166-1 alpha-2
Available options:
ADAEAF api-version string The API version to use. This is denoted by the format
YYYY-MM-DD. Default is the latest that is available. Read more about API versioning.accept enum<string> The default supported media type is application/json.
Default:
"application/json"Available options:
application/json*/* cache-control "no-cache" 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.user-agent string Mozilla/5.0 (Linux; Android 12) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.71 Mobile Safari/537.36AndroidMozilla/5.0 (iPhone; CPU iPhone OS 15_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/103.0.5060.63 Mobile/15E148 Safari/604.1iOSMozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36macOSMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36Windows
The user agent originating the request. Brave search can utilize the user agent to provide a different experience depending on the device as described by the string. The user agent should follow the commonly used browser agent strings on each platform. For more information on curating user agents, see RFC 9110.
Responses
200 Successful Response
grounding object Container for all LLM context content by type.
sources object Metadata for all referenced URLs, keyed by URL.