Brave Web Search API
Query Parameters
# Web Search API
This table lists the query parameters supported by the Web Search API. Some are required, but most are optional.
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
q | yes | string | none | The user's search query term. Query can not be empty. Maximum of 400 characters and 50 words in the query. |
country | no | string | us | The search query country, where the results come from. The country string is limited to 2 character country codes of supported countries. For a list of supported values, see Country Codes. |
search_lang | no | string | en | The search language preference. The 2 or more character language code for which the search results are provided. For a list of possible values, see Language Codes. |
ui_lang | no | string | en-US | User interface language preferred in response. Usually of the format |
count | no | int | 20 | The number of search results returned in response. The maximum is |
offset | no | int | 0 | The zero based offset that indicates number of search results per page (count) to skip
before returning the result. The maximum is In order to paginate results use this parameter together with |
safesearch | no | string | moderate | Filters search results for adult content. The following values are supported:
|
freshness | no | string | none | Filters search results by when they were discovered. The following time deltas are supported:
|
text_decorations | no | bool | 1 | Whether display strings (e.g. result snippets) should include decoration markers (e.g. highlighting characters). |
spellcheck | no | bool | 1 | Whether to spellcheck provided query. If the spellchecker is enabled, the modified
query is always used for search. The modified query can be found in
|
result_filter | no | string | none | 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 a plan with the corresponding option is subscribed. The
response always includes Available result filter values are:
Example result filter value of |
goggles_id | no | string | none | Goggles act as a custom re-ranking on top of Brave’s search index. For more details, refer to the Goggles repository |
units | no | string | none | The measurement units. If not provided, units are derived from search country. Possible values are:
|
extra_snippets | no | bool | none | A snippet is an excerpt from a page you get as a result of the query, and Only available under |
summary | no | bool | none | This parameter enables summary key generation in web search results. This is required for summarizer to be enabled. |
# Local Search API
This table lists the query parameters supported by the Local Search API. Some are required, but most are optional.
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
ids | yes | list[string] | none | Unique identifier for the location. Ids can not be empty. Maximum of 20 ids per request. The parameter can be repeated to query for multiple ids. |
search_lang | no | string | en | The search language preference. The 2 or more character language code for which the location search results are provided. For a list of possible values, see Language Codes. |
ui_lang | no | string | en-US | User interface language preferred in response. Usually of the format |
units | no | string | none | The measurement units. If not provided, units are derived from search country. Possible values are:
|