Brave Resolve API Documentation
Brave Search encrypts the links of many results (https://search.brave.com/go/v1/...). Each of those results in a Brave Search API response comes with a link_token beside its link. Send those tokens to this API to get the destination URLs. Requests use no credits, and are limited to 500 per minute and 20 at a time, or 10 at a time for accounts without a subscription.
Results come back in the order you sent them, one row per item, so a repeated token gets a row each time.
| Row has | Meaning | What to do |
|---|---|---|
No link_token |
Resolved | Use link, the destination URL. |
link_token and error |
Will not resolve | Do not send it again. |
link_token, no error |
Not ready | Send it again after retry_after seconds. It keeps any link you sent. Stop once a few resends in a row resolve nothing new, and keep the link you have. |
Every item needs a link_token, and one item without it fails the whole request. Every other field you send on an item comes back unchanged on its row, so you can tag items with your own ids and match each row to your records. The destination always comes back in link, so a result that carries a link_token can be sent as it is. A domain you send becomes the destination's host once the row resolves. An error field you send is dropped.
A token has no expiry of its own and is not tied to your account, but Brave Search can stop opening the link behind it. That comes back as an error row.
API Parameters
Results
-
- Name
-
results - Required
- Required
- Description
-
The links to resolve, at most
25items, in the JSON body. Each item is an object with thelink_tokenreturned beside an encrypted Brave link in a Brave Search API response, and one item without it fails the whole request. An item can also carry fields of your own, such as an id for your records, and they come back on its row with the destination inlink. Anerrorfield you send is dropped. The whole array, your fields included, can be at most 1 MB as JSON.
Engine
-
- Name
-
engine - Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
brave_resolve.
API key
-
- Name
-
api_key - Required
- Required
- Description
-
The
api_keyauthenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY) or in the Authorization header (Bearer YOUR_API_KEY).
API Examples
Send a POST with this body:
{
"engine": "brave_resolve",
"results": [
{"link_token": "LINK_TOKEN_A", "id": "result-1"},
{"link_token": "LINK_TOKEN_A", "id": "result-2"},
{"link_token": "LINK_TOKEN_B", "id": "result-3"},
{"link_token": "LINK_TOKEN_C", "id": "result-4"}
]
}
Its response keeps each row's id: result-1 and result-2 share a token and both resolved, result-3 is not ready, and result-4 will not resolve. Only results and retry_after are shown.
{
"results": [
{"id": "result-1", "link": "https://example.com/page"},
{"id": "result-2", "link": "https://example.com/page"},
{"link_token": "LINK_TOKEN_B", "id": "result-3"},
{"link_token": "LINK_TOKEN_C", "id": "result-4", "error": "Brave did not return a destination for this link."}
],
"retry_after": 5
}