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 | true | string | null | The user’s search query term. Query can not be empty. Maximum of 400 characters and 50 words in the query. |
country | false | 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 | false | 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 | false | string | en-US | User interface language preferred in response. Usually of the format ‘<language_code>-<country_code>’. For more, see RFC 9110. For a list of supported values, see UI Language Codes. |
count | false | number | 20 | The number of search results returned in response. The maximum is |
offset | false | number | 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 | false | string | moderate | Filters search results for adult content. The following values are supported:
|
freshness | false | string | null | Filters search results by when they were discovered. The following values are supported:
- |
text_decorations | false | bool | 1 | Whether display strings (e.g. result snippets) should include decoration markers (e.g. highlighting characters). |
spellcheck | false | 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 | false | string | null | 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 query and type to identify any query modifications and response type respectively. Available result filter values are: - discussions - faq - infobox - news - query - summarizer - videos - web - locations Example result filter param |
goggles_id | false | string | null | Goggles act as a custom re-ranking on top of Brave’s search index. For more details, refer to the Goggles repository. |
units | false | string | null | The measurement units. If not provided, units are derived from search country. Possible values are:
- |
extra_snippets | false | bool | null | A snippet is an excerpt from a page you get as a result of the query, and extra_snippets allow you to get up to 5 additional, alternative excerpts. Only available under |
summary | false | bool | null | This parameter enables summary key generation in web search results. This is required for summarizer to be enabled. |
You can also optimise your search query by using search operators.
# 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 | true | list[string] | null | 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 | false | 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 | false | string | en-US | User interface language preferred in response. Usually of the format ‘<language_code>-<country_code>’. For more, see RFC 9110. For a list of supported values, see UI Language Codes. |
units | false | string | null | The measurement units. If not provided, units are derived from search country. Possible values are:
- |