summarizer

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.

GET
/ v1/ llm/ context
POST
/ v1/ llm/ context

Authorization

x-subscription-token string header required
The subscription token that was generated for the product.

Query Parameters

q string required
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.
Default: "US"
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.
Default: "en"
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.
Min: 1 Max: 50 Default: 20
Maximum number of different URLs to include in LLM context.
Min: 1 Max: 50 Default: 20
Approximate maximum number of tokens to include in context. The default is 8192 and maximum is 32768.
Min: 1024 Max: 32768 Default: 8192
Maximum number of different snippets (or chunks of text) to include in LLM context. The default is 50 and maximum is 100.
Min: 1 Max: 100 Default: 50
The mode to use to determine the threshold for including content in context. Default is balanced.
Default: "balanced"
Available options: disabledstrictlenient
Maximum number of tokens to include per URL. The default is 4096 and maximum is 8192.
Min: 512 Max: 8192 Default: 4096
Maximum number of snippets to include per URL. The default is 50 and maximum is 100.
Min: 1 Max: 100 Default: 50
goggles string | string[]
  • https://raw.githubusercontent.com/brave/goggles-quickstart/main/goggles/hacker_news.goggle Prioritizes domains popular with the Hacker News
  • ! name: Social Networks ! description: Removes social networks ! public: true ! author: Average Joe ! avatar: #de0320 $discard,site=facebook.com $discard,site=x.com $discard,site=instagram.com Social media blocker
The goggle url or definition to rerank search results.
freshness string
  • pm
  • 2022-04-01to2022-07-30

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.
Default: ""
enable_local boolean
Whether to enable local recall. Not setting this value means auto-detect and uses local recall if any of the localization headers are provided.

Headers

x-loc-lat number
  • [object Object] None
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.
x-loc-long number
  • [object Object] None
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.
x-loc-city string
  • Ann Arbor City in USA
The generic name of the client city
x-loc-state string
  • MI Michigan State/Region code in USA
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.
x-loc-state-name string
  • Michigan Michigan generic state name in USA
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
x-loc-postal-code string
  • 48105 Postal code in Ann Harbor, Michigan, US
The client’s postal code
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.36 Android
  • Mozilla/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.1 iOS
  • Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36 macOS
  • Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36 Windows
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.
400 Bad Request
type string
error object required
time integer
403 Forbidden
type string
error object required
time integer
404 Not Found
type string
error object required
time integer
422 Unprocessable Entity
type string
error object required
time integer
429 Too Many Requests
type string
error object required
time integer