Brave API endpoint
Returns Brave autosuggest query completions for a query prefix. Locale defaults to country=us and lang=en-us. Suggestions are fetched from public Brave Search suggest JSON and trimmed to the requested count. `rich=true` adds entity metadata (name, description, category, image) where Brave resolves a suggestion to a known entity.
/brave/suggestQuery parameters:
q: required. Search query prefix. Example: openai.count: optional. Suggestions to return. Defaults to 10, clamped to 1..12.country: optional. Brave result country. Defaults to us. Allowed values: all, ar, at, au, be, br, ca, ch, cl, cn, de, dk, es, fi, fr, gb, gr, hk, id, in, it, jp, kr, mx, my, nl, no, nz, ph, pl, pt, ru, sa, se, sg, tr, tw, us, za.lang: optional. Brave UI language. Defaults to en-us. Allowed values: de-de, en-ca, en-gb, en-in, en-us, fi-fi, fr-ca, fr-fr, ja-jp, pt-br, sq-al, sw-ke, zh-tw.rich: optional boolean. When true, suggestions that Brave resolves to a known entity carry an entity object with name, description, category (for example person, company, music, event), image_url, and logo. Defaults to false.Notable response behavior:
503.entity is omitted for plain phrase suggestions and for every row when rich is not true.| Field | Filled in, of 8 checked | Values in the sample |
|---|---|---|
| position | 8 | 1 to 8, median 4 |
| query | 8 | “openai” and 7 other values |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| q | string | Yes | Search query prefix | openai | |
| count | integer | No | 10 | Suggestions to return; defaults to 10, clamped to 1..12 Minimum: 1. Maximum: 12. | 10 |
| country | string | No | us | Brave result country; defaults to us Allowed values: all, ar, at, au, be, br, ca, ch, cl, cn, de, dk, es, fi, fr, gb, gr, hk, id, in, it, jp, kr, mx, my, nl, no, nz, ph, pl, pt, ru, sa, se, sg, tr, tw, us, za. | us |
| lang | string | No | en-us | Brave UI language; defaults to en-us Allowed values: de-de, en-ca, en-gb, en-in, en-us, fi-fi, fr-ca, fr-fr, ja-jp, pt-br, sq-al, sw-ke, zh-tw. | en-us |
| rich | boolean | No | false | Add entity name, description, category, and image to suggestions Brave resolves to a known entity; defaults to false | false |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/brave/suggest?q=openai&count=10&country=us&lang=en&rich=true" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"query": "openai",
"suggestions": [
{
"position": 1,
"query": "openai api"
}
]
}
}Request schema
No body schema
Response schema
#/definitions/brave.suggestResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | brave.SuggestResponse | No | ||||
| data.query | string | No | openai | Query prefix the suggestions were requested for. | ||
| data.suggestions | array | No | Search suggestions Brave returned, in order. | |||
| data.suggestions[].entity | object | No | Entity Brave matched to the suggestion. Only set when the request used `rich=true` and Brave recognises an entity. | |||
| data.suggestions[].entity.category | string | No | person | Kind of entity, for example `person`. | ||
| data.suggestions[].entity.description | string | No | American singer-songwriter (born 1989) | Short description of the entity. | ||
| data.suggestions[].entity.image_url | string | No | https://imgs.search.brave.com/example.jpg | URL of the entity's image. | ||
| data.suggestions[].entity.logo | boolean | No | false | Whether Brave marks the entity image as a logo. | ||
| data.suggestions[].entity.name | string | No | Taylor Swift | Name of the entity. | ||
| data.suggestions[].position | integer | No | 1 | Rank of the suggestion in the list, starting at 1. | ||
| data.suggestions[].query | string | No | openai api | Suggested search query. | ||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Missing or invalid query | #/definitions/app.Response |
| 429 | Rate limit exceeded | #/definitions/app.Response |
| 500 | Internal server error | #/definitions/app.Response |
| 503 | Brave upstream request failed | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/brave/suggest?q=openai&count=10&country=us&lang=en&rich=true" \
-H "x-api-key: $CRAWLORA_API_KEY"