curl --request GET \
--url https://api.aisa.one/apis/v1/brave/llm/context \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/brave/llm/context"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/brave/llm/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/brave/llm/context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/brave/llm/context"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/brave/llm/context")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/brave/llm/context")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"grounding": {
"generic": [],
"map": []
},
"sources": {}
}LLM Context
LLM Context
curl --request GET \
--url https://api.aisa.one/apis/v1/brave/llm/context \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/brave/llm/context"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/brave/llm/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/brave/llm/context",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/brave/llm/context"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.aisa.one/apis/v1/brave/llm/context")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/brave/llm/context")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"grounding": {
"generic": [],
"map": []
},
"sources": {}
}Request contract
- Method and path: GET /apis/v1/brave/llm/context
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/brave/llm/context - accept: header; optional
- api-version: header; optional
- cache-control: header; optional
- user-agent: header; optional
- x-loc-city: header; optional
- x-loc-country: header; optional
- x-loc-lat: header; optional
- x-loc-long: header; optional
- x-loc-postal-code: header; optional
- x-loc-state: header; optional
- x-loc-state-name: header; optional
- context_threshold_mode: query; optional
- count: query; optional
- country: query; optional
- enable_local: query; optional
- enable_source_metadata: query; optional
- freshness: query; optional
- goggles: query; optional
- maximum_number_of_tokens: query; optional
- maximum_number_of_tokens_per_url: query; optional
- maximum_number_of_urls: query; optional
- operators: query; optional
- operators_fallback: query; optional
- q: query; required
- safesearch: query; optional
- search_lang: query; optional
- spellcheck: query; optional
{
"operationId": "get_any_brave_search_apis_v1_brave_llm_context",
"method": "GET",
"path": "/apis/v1/brave/llm/context",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"deprecated": false,
"description": "The default supported media type is application/json.",
"examples": {
"0": {
"value": "application/json"
}
},
"in": "header",
"name": "accept",
"required": false,
"schema": {
"allOf": [
{
"enum": [
"application/json",
"*/*"
],
"title": "Accept",
"type": "string"
},
{
"default": "application/json"
}
],
"description": "The default supported media type is application/json.",
"examples": [
"application/json"
],
"title": "Media type"
}
},
{
"deprecated": false,
"description": "The API version to use. This is denoted by the format <code>YYYY-MM-DD</code>. Default is the latest that is available. Read more about <a href=\"/documentation/guides/versioning\">API versioning</a>.",
"in": "header",
"name": "api-version",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The API version to use. This is denoted by the format <code>YYYY-MM-DD</code>. Default is the latest that is available. Read more about <a href=\"/documentation/guides/versioning\">API versioning</a>.",
"title": "API version"
}
},
{
"deprecated": false,
"description": "Brave Search will return cached content by default. To prevent caching set the Cache-Control header to <code>no-cache</code>. This is currently done as best effort.",
"in": "header",
"name": "cache-control",
"required": false,
"schema": {
"anyOf": [
{
"const": "no-cache",
"enum": [
"no-cache"
],
"title": "CacheControl",
"type": "string"
},
{
"type": "null"
}
],
"description": "Brave Search will return cached content by default. To prevent caching set the Cache-Control header to <code>no-cache</code>. This is currently done as best effort.",
"title": "Cache control"
}
},
{
"deprecated": false,
"description": "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 <a href=\"https://www.rfc-editor.org/rfc/rfc9110.html#name-user-agent\">RFC 9110</a>.",
"examples": {
"Android": {
"description": "Android",
"value": "Mozilla/5.0 (Linux; Android 12) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.71 Mobile Safari/537.36"
},
"Windows": {
"description": "Windows",
"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
},
"iOS": {
"description": "iOS",
"value": "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"
},
"macOS": {
"description": "macOS",
"value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
}
},
"in": "header",
"name": "user-agent",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "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 <a href=\"https://www.rfc-editor.org/rfc/rfc9110.html#name-user-agent\">RFC 9110</a>.",
"title": "User agent"
}
},
{
"deprecated": false,
"description": "The generic name of the client city",
"examples": {
"City in USA": {
"value": "Ann Arbor"
}
},
"in": "header",
"name": "x-loc-city",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The generic name of the client city",
"title": "X-Loc-City"
}
},
{
"deprecated": false,
"description": "The two letter country code for the client’s country. For a list of country codes, see <a href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\">ISO 3166-1 alpha-2</a>",
"examples": {
"Country alpha-2 code": {
"value": "US"
}
},
"in": "header",
"name": "x-loc-country",
"required": false,
"schema": {
"anyOf": [
{
"enum": [
"AD",
"AE",
"AF",
"AG",
"AI",
"AL",
"AM",
"AO",
"AQ",
"AR",
"AS",
"AT",
"AU",
"AW",
"AX",
"AZ",
"BA",
"BB",
"BD",
"BE",
"BF",
"BG",
"BH",
"BI",
"BJ",
"BL",
"BM",
"BN",
"BO",
"BQ",
"BR",
"BS",
"BT",
"BV",
"BW",
"BY",
"BZ",
"CA",
"CC",
"CD",
"CF",
"CG",
"CH",
"CI",
"CK",
"CL",
"CM",
"CN",
"CO",
"CR",
"CU",
"CV",
"CW",
"CX",
"CY",
"CZ",
"DE",
"DJ",
"DK",
"DM",
"DO",
"DZ",
"EC",
"EE",
"EG",
"EH",
"ER",
"ES",
"ET",
"FI",
"FJ",
"FK",
"FM",
"FO",
"FR",
"GA",
"GB",
"GD",
"GE",
"GF",
"GG",
"GH",
"GI",
"GL",
"GM",
"GN",
"GP",
"GQ",
"GR",
"GS",
"GT",
"GU",
"GW",
"GY",
"HK",
"HM",
"HN",
"HR",
"HT",
"HU",
"ID",
"IE",
"IL",
"IM",
"IN",
"IO",
"IQ",
"IR",
"IS",
"IT",
"JE",
"JM",
"JO",
"JP",
"KE",
"KG",
"KH",
"KI",
"KM",
"KN",
"KP",
"KR",
"KW",
"KY",
"KZ",
"LA",
"LB",
"LC",
"LI",
"LK",
"LR",
"LS",
"LT",
"LU",
"LV",
"LY",
"MA",
"MC",
"MD",
"ME",
"MF",
"MG",
"MH",
"MK",
"ML",
"MM",
"MN",
"MO",
"MP",
"MQ",
"MR",
"MS",
"MT",
"MU",
"MV",
"MW",
"MX",
"MY",
"MZ",
"NA",
"NC",
"NE",
"NF",
"NG",
"NI",
"NL",
"NO",
"NP",
"NR",
"NU",
"NZ",
"OM",
"PA",
"PE",
"PF",
"PG",
"PH",
"PK",
"PL",
"PM",
"PN",
"PR",
"PS",
"PT",
"PW",
"PY",
"QA",
"RE",
"RO",
"RS",
"RU",
"RW",
"SA",
"SB",
"SC",
"SD",
"SE",
"SG",
"SH",
"SI",
"SJ",
"SK",
"SL",
"SM",
"SN",
"SO",
"SR",
"SS",
"ST",
"SV",
"SX",
"SY",
"SZ",
"TC",
"TD",
"TF",
"TG",
"TH",
"TJ",
"TK",
"TL",
"TM",
"TN",
"TO",
"TR",
"TT",
"TV",
"TW",
"TZ",
"UA",
"UG",
"UM",
"US",
"UY",
"UZ",
"VA",
"VC",
"VE",
"VG",
"VI",
"VN",
"VU",
"WF",
"WS",
"YE",
"YT",
"ZA",
"ZM",
"ZW"
],
"title": "Country",
"type": "string"
},
{
"type": "null"
}
],
"description": "The two letter country code for the client’s country. For a list of country codes, see <a href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\">ISO 3166-1 alpha-2</a>",
"title": "X-Loc-Country"
}
},
{
"deprecated": false,
"description": "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.",
"examples": {
"None": {}
},
"in": "header",
"name": "x-loc-lat",
"required": false,
"schema": {
"anyOf": [
{
"maximum": 90,
"minimum": -90,
"type": "number"
},
{
"type": "null"
}
],
"description": "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.",
"title": "X-Loc-Lat"
}
},
{
"deprecated": false,
"description": "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.",
"examples": {
"None": {}
},
"in": "header",
"name": "x-loc-long",
"required": false,
"schema": {
"anyOf": [
{
"maximum": 180,
"minimum": -180,
"type": "number"
},
{
"type": "null"
}
],
"description": "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.",
"title": "X-Loc-Long"
}
},
{
"deprecated": false,
"description": "The client’s postal code",
"examples": {
"Postal code in Ann Harbor, Michigan, US": {
"value": "48105"
}
},
"in": "header",
"name": "x-loc-postal-code",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The client’s postal code",
"title": "X-Loc-Postal-Code"
}
},
{
"deprecated": false,
"description": "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 <a href=\"https://en.wikipedia.org/wiki/ISO_3166-2\">ISO 3166-2</a> code.",
"examples": {
"Michigan State/Region code in USA": {
"value": "MI"
}
},
"in": "header",
"name": "x-loc-state",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "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 <a href=\"https://en.wikipedia.org/wiki/ISO_3166-2\">ISO 3166-2</a> code.",
"title": "X-Loc-State"
}
},
{
"deprecated": false,
"description": "The name of the client’s state/region. The region is the first-level subdivision (the broadest or least specific) of the <a href=\"https://en.wikipedia.org/wiki/ISO_3166-2\">ISO 3166-2</a> code.",
"examples": {
"Michigan generic state name in USA": {
"value": "Michigan"
}
},
"in": "header",
"name": "x-loc-state-name",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The name of the client’s state/region. The region is the first-level subdivision (the broadest or least specific) of the <a href=\"https://en.wikipedia.org/wiki/ISO_3166-2\">ISO 3166-2</a> code.",
"title": "X-Loc-State-Name"
}
},
{
"deprecated": false,
"description": "The mode to use to determine the threshold for including content in context.",
"in": "query",
"name": "context_threshold_mode",
"required": false,
"schema": {
"anyOf": [
{
"enum": [
"disabled",
"strict",
"lenient",
"balanced"
],
"title": "SummarizerContextThresholdMode",
"type": "string"
},
{
"type": "null"
}
],
"description": "The mode to use to determine the threshold for including content in context.",
"title": "Context Threshold Mode"
}
},
{
"deprecated": false,
"description": "The maximum number of search results considered to select the LLM context data. The default is 20 and the maximum is 50.",
"in": "query",
"name": "count",
"required": false,
"schema": {
"description": "The maximum number of search results considered to select the LLM context data. The default is 20 and the maximum is 50.",
"maximum": 50,
"minimum": 1,
"title": "Count",
"type": "integer"
}
},
{
"deprecated": false,
"description": "The search query country, where the results come from. The country string is limited to 2 character country codes of supported countries.",
"in": "query",
"name": "country",
"required": false,
"schema": {
"allOf": [
{
"enum": [
"AR",
"AU",
"AT",
"BE",
"BR",
"CA",
"CL",
"DK",
"FI",
"FR",
"DE",
"GR",
"HK",
"IN",
"ID",
"IT",
"JP",
"KR",
"MY",
"MX",
"NL",
"NZ",
"NO",
"CN",
"PL",
"PT",
"PH",
"RU",
"SA",
"ZA",
"ES",
"SE",
"CH",
"TW",
"TR",
"GB",
"US",
"ALL"
],
"title": "SearchCountry",
"type": "string"
},
{
"default": "US"
}
],
"description": "The search query country, where the results come from. The country string is limited to 2 character country codes of supported countries."
}
},
{
"deprecated": false,
"description": "Whether to enable local recall. Not setting this value means auto-detect: local recall is used if a location is provided (<code>X-Loc-Lat</code> with <code>X-Loc-Long</code>, or <code>X-Loc-City</code>).",
"in": "query",
"name": "enable_local",
"required": false,
"schema": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"description": "Whether to enable local recall. Not setting this value means auto-detect: local recall is used if a location is provided (<code>X-Loc-Lat</code> with <code>X-Loc-Long</code>, or <code>X-Loc-City</code>).",
"title": "Enable Local"
}
},
{
"deprecated": false,
"description": "Enable source metadata enrichment (site_name, favicon, thumbnail, description, fetched_content_timestamp) in the sources attribute of the response.",
"in": "query",
"name": "enable_source_metadata",
"required": false,
"schema": {
"default": false,
"description": "Enable source metadata enrichment (site_name, favicon, thumbnail, description, fetched_content_timestamp) in the sources attribute of the response.",
"title": "Enable Source Metadata",
"type": "boolean"
}
},
{
"deprecated": false,
"description": "<p>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:</p>\n<ul>\n<li><strong>pd</strong> - Pages aged 24 hours or less.</li>\n<li><strong>pw</strong> - Pages aged 7 days or less.</li>\n<li><strong>pm</strong> - Pages aged 31 days or less.</li>\n<li><strong>py</strong> - Pages aged 365 days or less.</li>\n<li><strong>YYYY-MM-DDtoYYYY-MM-DD</strong> - A custom date range is also supported by specifying start and end dates e.g. <code>2022-04-01to2022-07-30</code>.</li>\n</ul>",
"examples": {
"0": {
"value": ""
},
"1": {
"value": "pm"
},
"2": {
"value": "2022-04-01to2022-07-30"
}
},
"in": "query",
"name": "freshness",
"required": false,
"schema": {
"default": "",
"description": "<p>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:</p>\n<ul>\n<li><strong>pd</strong> - Pages aged 24 hours or less.</li>\n<li><strong>pw</strong> - Pages aged 7 days or less.</li>\n<li><strong>pm</strong> - Pages aged 31 days or less.</li>\n<li><strong>py</strong> - Pages aged 365 days or less.</li>\n<li><strong>YYYY-MM-DDtoYYYY-MM-DD</strong> - A custom date range is also supported by specifying start and end dates e.g. <code>2022-04-01to2022-07-30</code>.</li>\n</ul>",
"examples": [
"",
"pm",
"2022-04-01to2022-07-30"
],
"title": "Freshness",
"type": "string"
}
},
{
"deprecated": false,
"description": "Goggles act as a custom re-ranking on top of Brave’s search index. The parameter supports both a url where the Goggle is hosted or the definition of the Goggle. For more details, see the <a href=\"/documentation/resources/goggles\">Goggles documentation</a>. The parameter can be a single Goggle or a list of up to 3 Goggles.",
"examples": {
"Prioritizes domains popular with the Hacker News": {
"value": "https://raw.githubusercontent.com/brave/goggles-quickstart/main/goggles/hacker_news.goggle"
},
"Social media blocker": {
"value": "! name: Social Networks\n! description: Removes social networks\n! public: true\n! author: Average Joe\n! avatar: #de0320\n$discard,site=facebook.com\n$discard,site=x.com\n$discard,site=instagram.com"
}
},
"in": "query",
"name": "goggles",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"description": "Goggles act as a custom re-ranking on top of Brave’s search index. The parameter supports both a url where the Goggle is hosted or the definition of the Goggle. For more details, see the <a href=\"/documentation/resources/goggles\">Goggles documentation</a>. The parameter can be a single Goggle or a list of up to 3 Goggles.",
"title": "Goggles"
}
},
{
"deprecated": false,
"description": "Approximate maximum number of tokens to include in context. The default is <code>8192</code> and maximum is <code>32768</code>.",
"in": "query",
"name": "maximum_number_of_tokens",
"required": false,
"schema": {
"default": 8192,
"description": "Approximate maximum number of tokens to include in context. The default is <code>8192</code> and maximum is <code>32768</code>.",
"maximum": 32768,
"minimum": 1024,
"title": "Maximum Number Of Tokens",
"type": "integer"
}
},
{
"deprecated": false,
"description": "Maximum number of tokens to include per URL. The default is <code>4096</code> and maximum is <code>8192</code>.",
"in": "query",
"name": "maximum_number_of_tokens_per_url",
"required": false,
"schema": {
"description": "Maximum number of tokens to include per URL. The default is <code>4096</code> and maximum is <code>8192</code>.",
"maximum": 8192,
"minimum": 512,
"title": "Maximum Number Of Tokens Per Url",
"type": "integer"
}
},
{
"deprecated": false,
"description": "Maximum number of different URLs to include in LLM context.",
"in": "query",
"name": "maximum_number_of_urls",
"required": false,
"schema": {
"description": "Maximum number of different URLs to include in LLM context.",
"maximum": 50,
"minimum": 1,
"title": "Maximum Number Of Urls",
"type": "integer"
}
},
{
"deprecated": false,
"description": "Whether to apply search operators.",
"in": "query",
"name": "operators",
"required": false,
"schema": {
"default": true,
"description": "Whether to apply search operators.",
"title": "Operators",
"type": "boolean"
}
},
{
"deprecated": false,
"description": "Whether to fall back to the original results when search operators return no results.",
"in": "query",
"name": "operators_fallback",
"required": false,
"schema": {
"default": true,
"description": "Whether to fall back to the original results when search operators return no results.",
"title": "Operators Fallback",
"type": "boolean"
}
},
{
"deprecated": false,
"description": "The user’s search query term. Query can not be empty. Maximum of 600 characters and 75 words in the query.",
"in": "query",
"name": "q",
"required": true,
"schema": {
"description": "The user’s search query term. Query can not be empty. Maximum of 600 characters and 75 words in the query.",
"maxLength": 600,
"minLength": 1,
"title": "Q",
"type": "string"
}
},
{
"deprecated": false,
"description": "<p>Filters results for adult content. The following values are supported:</p>\n<ul>\n<li><strong>off</strong> - No filtering is done.</li>\n<li><strong>moderate</strong> - Drops adult content from the results used for context.</li>\n<li><strong>strict</strong> - Drops all adult content from the results used for context.</li>\n</ul>\n<p>When not set, no filtering is applied — except for local recall, which stays <code>strict</code>.</p>",
"in": "query",
"name": "safesearch",
"required": false,
"schema": {
"anyOf": [
{
"enum": [
"off",
"moderate",
"strict"
],
"title": "SafeSearch",
"type": "string"
},
{
"type": "null"
}
],
"description": "<p>Filters results for adult content. The following values are supported:</p>\n<ul>\n<li><strong>off</strong> - No filtering is done.</li>\n<li><strong>moderate</strong> - Drops adult content from the results used for context.</li>\n<li><strong>strict</strong> - Drops all adult content from the results used for context.</li>\n</ul>\n<p>When not set, no filtering is applied — except for local recall, which stays <code>strict</code>.</p>",
"title": "Safe search"
}
},
{
"deprecated": false,
"description": "The search language preference. The 2 or more character language code for which the search results are provided.",
"in": "query",
"name": "search_lang",
"required": false,
"schema": {
"allOf": [
{
"enum": [
"ar",
"eu",
"bn",
"bg",
"ca",
"zh-hans",
"zh-hant",
"hr",
"cs",
"da",
"nl",
"en",
"en-gb",
"et",
"fi",
"fr",
"gl",
"de",
"el",
"gu",
"he",
"hi",
"hu",
"is",
"it",
"ja",
"jp",
"kn",
"ko",
"lv",
"lt",
"ms",
"ml",
"mr",
"nb",
"pl",
"pt-br",
"pt-pt",
"pa",
"ro",
"ru",
"sr",
"sk",
"sl",
"es",
"sv",
"ta",
"te",
"th",
"tr",
"uk",
"vi"
],
"title": "Language",
"type": "string"
},
{
"default": "en"
}
],
"description": "The search language preference. The 2 or more character language code for which the search results are provided."
}
},
{
"deprecated": false,
"description": "Whether to enable spellcheck on the query.",
"in": "query",
"name": "spellcheck",
"required": false,
"schema": {
"default": true,
"description": "Whether to enable spellcheck on the query.",
"title": "Spellcheck",
"type": "boolean"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
Request pricing. Default request estimate: $0.005 USD. The final charge depends on actual usage. Your account price may differ; use a request quote where supported.Authorizations
Headers
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.
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.
The two letter country code for the client’s country. For a list of country codes, see ISO 3166-1 alpha-2
AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BF, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, YE, YT, ZA, ZM, ZW 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.
Query Parameters
The search query country, where the results come from. The country string is limited to 2 character country codes of supported countries.
AR, AU, AT, BE, BR, CA, CL, DK, FI, FR, DE, GR, HK, IN, ID, IT, JP, KR, MY, MX, NL, NZ, NO, CN, PL, PT, PH, RU, SA, ZA, ES, SE, CH, TW, TR, GB, US, ALL 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.
""
"pm"
"2022-04-01to2022-07-30"
Goggles act as a custom re-ranking on top of Brave’s search index. The parameter supports both a url where the Goggle is hosted or the definition of the Goggle. For more details, see the Goggles documentation. The parameter can be a single Goggle or a list of up to 3 Goggles.
Filters results for adult content. The following values are supported:
- off - No filtering is done.
- moderate - Drops adult content from the results used for context.
- strict - Drops all adult content from the results used for context.
When not set, no filtering is applied — except for local recall, which stays strict.
off, moderate, strict The search language preference. The 2 or more character language code for which the search results are provided.
ar, eu, bn, bg, ca, zh-hans, zh-hant, hr, cs, da, nl, en, en-gb, et, fi, fr, gl, de, el, gu, he, hi, hu, is, it, ja, jp, kn, ko, lv, lt, ms, ml, mr, nb, pl, pt-br, pt-pt, pa, ro, ru, sr, sk, sl, es, sv, ta, te, th, tr, uk, vi