You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Endpoints
Brave Search API exposes multiple endpoints for specific types of data, based on the level of your subscription. If you don’t see the endpoint you’re interested in, you may need to change your subscription.
Brave Web Search API
Brave Web Search API is currently available at the following endpoint and exposes an API to query general web.
curl -s --compressed "https://api.search.brave.com/res/v1/web/search?q=brave+search" -H "Accept:
application/json" -H "Accept-Encoding: gzip" -H "X-Subscription-Token: <YOUR_API_KEY>"
The response specification for Web Search API can be seen in the WebSearchApiResponse model.
Brave Summarizer Search API
Note
Access to summarizer is available through the Pro AI plan.
Brave Summarizer Search API is currently available at the following endpoint and exposes an API to get summarized content for web search queries.
The summarizer API version 2023-08-25 is deprecated. Please use the version 2024-04-23 onwards.
For API version 2024-04-23 onwards, the key is equal to summarizer key (key) as part of the (Summarizer) response model. An example is below.
Response
{"summarizer": {"type": "summarizer", "key": "{"query":"what is the second highest mountain","country":"us","language":"en","safesearch":"moderate","results_hash":"a51e129180225a2f4fe1a00984bcbf58f0ae0625c97723aae43c2c6e3440715b"}}
Note
The key should be treated as a string and passed as is. The format can change in the future.
The key can be used to poll the summarizer endpoint for the summarized content. Requests to summarizer are not counted towards your plan and only the initial request to web search endpoint is billed based on the selected plan. An example request is below.
For API version 2023-08-25, the key is equal to summarizer key (summary_key) which is provided in the response to a web search query when it is eligible for a summary or an answer. The key is part of the query (Query) response model. API version 2023-08-25 is now deprecated. An example is below.
Response
{"query": {"summary_key": "what is the second highest mountain:us:en"}}
This key can be used to poll the summarizer endpoint for the summarized content. Polling requests to summarizer endpoint are not counted towards your plan and only the initial request to web search endpoint is billed based on the selected plan. An example poll request is below.
Curl
curl -s --compressed "https://api.search.brave.com/res/v1/summarizer/search?key=what%20is%20the%20second%20highest%20mountain:us:en"
-H "Accept: application/json" -H "Accept-Encoding: gzip" -H "X-Subscription-Token:
<YOUR_API_KEY>"
Note
The summarizer results are cached for a limited time, after which the flow has to be started again to get the summarized content.
The response specification for Summarizer Search API can be seen in the SummarizerSearchApiResponse model.
The text was updated successfully, but these errors were encountered:
Repository owner
locked and limited conversation to collaborators
May 1, 2024
Endpoints
Brave Search API exposes multiple endpoints for specific types of data, based on the level of your subscription. If you don’t see the endpoint you’re interested in, you may need to change your subscription.
Brave Web Search API
Brave Web Search API is currently available at the following endpoint and exposes an API to query general web.
Endpoint
https://api.search.brave.com/res/v1/web/search
Get started immediately with CURL. An example request will look something like this:
Curl
curl -s --compressed "https://api.search.brave.com/res/v1/web/search?q=brave+search" -H "Accept:
application/json" -H "Accept-Encoding: gzip" -H "X-Subscription-Token: <YOUR_API_KEY>"
The response specification for Web Search API can be seen in the WebSearchApiResponse model.
Brave Summarizer Search API
Note
Access to summarizer is available through the Pro AI plan.
Brave Summarizer Search API is currently available at the following endpoint and exposes an API to get summarized content for web search queries.
Endpoint
https://api.search.brave.com/res/v1/summarizer/search
To utilize the Summarizer, follow the steps outlined below.
An initial request has to be made to web search endpoint with a given query. An example request is given below.
Curl
curl -s --compressed "https://api.search.brave.com/res/v1/web/search?q=what+is+the+second+highest+mountain&summary=1" -H
"Accept: application/json" -H "Accept-Encoding: gzip" -H "X-Subscription-Token:
<YOUR_API_KEY>"
If the query is eligible for a summary or an answer, as in this case, a summarizer key is provided in the response.
Note
The summarizer API version 2023-08-25 is deprecated. Please use the version 2024-04-23 onwards.
For API version 2024-04-23 onwards, the key is equal to summarizer key (key) as part of the (Summarizer) response model. An example is below.
Response
{"summarizer": {"type": "summarizer", "key": "{"query":"what is the second highest mountain","country":"us","language":"en","safesearch":"moderate","results_hash":"a51e129180225a2f4fe1a00984bcbf58f0ae0625c97723aae43c2c6e3440715b"}}
Note
The key should be treated as a string and passed as is. The format can change in the future.
The key can be used to poll the summarizer endpoint for the summarized content. Requests to summarizer are not counted towards your plan and only the initial request to web search endpoint is billed based on the selected plan. An example request is below.
Curl
curl -s --compressed "https://api.search.brave.com/res/v1/summarizer/search?key=%7B%22query%22%3A%22what%20is%20the%20second%20highest%20mountain%22%2C%22country%22%3A%22us%22%2C%22language%22%3A%22en%22%2C%22safesearch%22%3A%22moderate%22%2C%22results_hash%22%3A%22a51e129180225a2f4fe1a00984bcbf58f0ae0625c97723aae43c2c6e3440715b%22%7D&entity_info=1" -H "accept: application/json" -H "Accept-Encoding: gzip" -H "x-subscription-token: <YOUR_API_KEY>"
For API version 2023-08-25, the key is equal to summarizer key (summary_key) which is provided in the response to a web search query when it is eligible for a summary or an answer. The key is part of the query (Query) response model. API version 2023-08-25 is now deprecated. An example is below.
Response
{"query": {"summary_key": "what is the second highest mountain:us:en"}}
This key can be used to poll the summarizer endpoint for the summarized content. Polling requests to summarizer endpoint are not counted towards your plan and only the initial request to web search endpoint is billed based on the selected plan. An example poll request is below.
Curl
curl -s --compressed "https://api.search.brave.com/res/v1/summarizer/search?key=what%20is%20the%20second%20highest%20mountain:us:en"
-H "Accept: application/json" -H "Accept-Encoding: gzip" -H "X-Subscription-Token:
<YOUR_API_KEY>"
Note
The summarizer results are cached for a limited time, after which the flow has to be started again to get the summarized content.
The response specification for Summarizer Search API can be seen in the SummarizerSearchApiResponse model.
The text was updated successfully, but these errors were encountered: