Brave API endpoint
Returns web search results from Brave Search for a query string, along with offset-based pagination, related queries, discussions, videos, and the right-side knowledge card when Brave includes one. Use time_range for preset ranges or date_from/date_to for a custom YYYY-MM-DD range. Locale defaults to country=us and lang=en-us.
/brave/searchQuery parameters:
q: required. Search query. Example: openai.offset: optional. Zero-based Brave result page. Example: 1. Minimum: 0.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. Example: us.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. Example: en-us.time_range: optional. Preset time filter. Allowed values: any, day, week, month, year, custom.date_from: optional. Custom start date in YYYY-MM-DD; requires date_to. Example: 2026-03-01.date_to: optional. Custom end date in YYYY-MM-DD; requires date_from. Example: 2026-03-30.| Field | Filled in, of 20 checked | Values in the sample |
|---|---|---|
| position | 20 | 1 to 20, median 10 |
| title | 20 | “OpenAI | Research & Deployment” and 19 other values |
| url | 20 | openai.com and 10 other hosts |
| description | 20 | median 173 characters |
| hostname | 20 | “openai.com” and 10 other values |
| favicon | 20 | “b” and 10 other values |
| age | 13 | “April 28, 2025” and 11 other values |
| path | 19 | “› wiki › OpenAI” and 16 other values |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| q | string | Yes | Search query | openai | |
| offset | integer | No | Zero-based Brave result page Minimum: 0. | 1 | |
| 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 |
| time_range | string | No | Preset time filter: any, day, week, month, year, or custom Allowed values: any, day, week, month, year, custom. | ||
| date_from | string | No | Custom start date in YYYY-MM-DD; requires date_to | 2026-03-01 | |
| date_to | string | No | Custom end date in YYYY-MM-DD; requires date_from | 2026-03-30 | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/brave/search?q=openai&country=us&lang=en&time_range=any" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"results": [
{
"position": 1,
"title": "OpenAI",
"url": "https://openai.com/",
"description": "OpenAI helps you build and deploy AI systems.",
"hostname": "openai.com",
"path": "research > overview"
}
],
"pagination": {
"offset": 0,
"next_offset": 1
},
"related_queries": [
"openai api"
],
"knowledge_card": {
"title": "OpenAI",
"description": "AI research and deployment company",
"long_description": "OpenAI is an AI research and deployment company building useful models and tools.",
"url": "https://openai.com/",
"image": "https://imgs.search.brave.com/openai-card.png",
"category": "Artificial intelligence company"
},
"discussions": [
{
"position": 1,
"title": "Why is OpenAI so popular?",
"url": "https://www.reddit.com/r/OpenAI/comments/abc123/why_is_openai_so_popular/",
"description": "Trying to understand why OpenAI has such a large audience.",
"forum": "r/OpenAI",
"hostname": "www.reddit.com"
}
],
"videos": [
{
"position": 1,
"title": "OpenAI DevDay keynote - YouTube",
"url": "https://www.youtube.com/watch?v=openai-devday",
"description": "Watch the OpenAI DevDay keynote and product announcements.",
"platform": "YouTube",
"creator": "OpenAI"
}
]
}
}Request schema
No body schema
Response schema
#/definitions/brave.searchResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | brave.SearchResponse | No | ||||
| data.discussions | array | No | Forum and Q&A discussions Brave shows for the query. Omitted when there are none. | |||
| data.discussions[].age | string | No | October 24, 2024 | When the thread was posted, as Brave shows it. | ||
| data.discussions[].comment_count | integer | No | 30 | Number of replies Brave shows for the thread. Omitted when Brave shows none. | ||
| data.discussions[].description | string | No | I have free time from highschool and want to get into coding, and tips on diving in and learning. | Short excerpt of the thread as Brave shows it. | ||
| data.discussions[].favicon | string | No | https://imgs.search.brave.com/example-reddit.ico | URL of the site's favicon as Brave serves it. | ||
| data.discussions[].forum | string | No | r/pythontips | Forum or subreddit the thread belongs to, for example `r/pythontips`. | ||
| data.discussions[].hostname | string | No | www.reddit.com | Host name of the site hosting the thread. | ||
| data.discussions[].path | string | No | r > pythontips > comments > 1gav6bm > how_to_learn_python | Breadcrumb-style path of the thread URL as Brave shows it. | ||
| data.discussions[].position | integer | No | 1 | Rank of the discussion in the discussions block, starting at 1. | ||
| data.discussions[].score | integer | No | 25 | Vote score of the thread. Omitted when Brave shows none. | ||
| data.discussions[].title | string | No | How to learn python | Title of the forum thread or question. | ||
| data.discussions[].top_comment | string | No | r/learnpython | Text of the top comment Brave shows for the thread. | ||
| data.discussions[].url | string | No | https://www.reddit.com/r/pythontips/comments/1gav6bm/how_to_learn_python/ | URL of the discussion thread. | ||
| data.knowledge_card | object | No | Knowledge card Brave shows for the query. Omitted when there is none. | |||
| data.knowledge_card.category | string | No | computer program | Kind of entity the card describes, for example `computer program`. | ||
| data.knowledge_card.description | string | No | computer program that produces the message "Hello, world!", often used to illustrate the basic syntax of a programming language | One-line description of the entity. | ||
| data.knowledge_card.image | string | No | https://imgs.search.brave.com/example-card.png | URL of the card's image. | ||
| data.knowledge_card.long_description | string | No | A "Hello, World!" program is usually a simple computer program that displays on the screen a message similar to "Hello, World!". | Longer description of the entity. | ||
| data.knowledge_card.provider | object | No | Source Brave credits for the card. | |||
| data.knowledge_card.provider.icon | string | No | https://imgs.search.brave.com/example-provider.ico | URL of the provider's icon. | ||
| data.knowledge_card.provider.name | string | No | Wikipedia | Name of the provider, for example `Wikipedia`. | ||
| data.knowledge_card.provider.url | string | No | https://en.wikipedia.org/wiki/%22Hello,_World!%22_program | URL of the provider's page for the entity. | ||
| data.knowledge_card.title | string | No | "Hello, World!" program | Name of the entity or topic the card is about. | ||
| data.knowledge_card.url | string | No | https://en.wikipedia.org/wiki/%22Hello,_World!%22_program | URL of the source page the card draws on. | ||
| data.pagination | object | No | Paging information for this response. | |||
| data.pagination.next_offset | integer | No | 1 | Offset to request the next page. Omitted when there is no next page. | ||
| data.pagination.offset | integer | No | 0 | Zero-based page offset of this response. | ||
| data.pagination.previous_offset | integer | No | 0 | Offset to request the previous page. Omitted on the first page. | ||
| data.related_queries | array | No | hello world anime,hello world code | Related searches Brave suggests for the query. | ||
| data.results | array | No | Organic web results in Brave's order. | |||
| data.results[].age | string | No | 1 day ago | How old the page is, as Brave shows it. Omitted when Brave shows none. | ||
| data.results[].description | string | No | OpenAI helps you build and deploy AI systems. | Result snippet as shown on the Brave results page. | ||
| data.results[].favicon | string | No | https://imgs.search.brave.com/example.ico | URL of the site's favicon as Brave serves it. | ||
| data.results[].hostname | string | No | openai.com | Host name of the result URL. | ||
| data.results[].path | string | No | research > index | Breadcrumb-style path of the result URL as Brave shows it. | ||
| data.results[].position | integer | No | 1 | Rank of the result on the page, starting at 1. | ||
| data.results[].title | string | No | OpenAI | Result title as shown on the Brave results page. | ||
| data.results[].url | string | No | https://openai.com/ | URL of the result page. | ||
| data.videos | array | No | Video results Brave shows for the query. Omitted when there are none. | |||
| data.videos[].age | string | No | March 24, 2024 | When the video was published, as Brave shows it. | ||
| data.videos[].creator | string | No | Train To Code | Channel or creator that published the video. | ||
| data.videos[].description | string | No | Introducing you to 15 of the most popular programming languages in the world, by writing hello world to the console. | Video description snippet as Brave shows it. | ||
| data.videos[].duration | string | No | 08:47 | Video length as Brave shows it, for example `08:47`. | ||
| data.videos[].favicon | string | No | https://imgs.search.brave.com/example-youtube.ico | URL of the hosting site's favicon as Brave serves it. | ||
| data.videos[].hostname | string | No | www.youtube.com | Host name of the video URL. | ||
| data.videos[].path | string | No | watch | Path of the video URL as Brave shows it. | ||
| data.videos[].platform | string | No | YouTube | Platform hosting the video, for example `YouTube`. | ||
| data.videos[].position | integer | No | 1 | Rank of the video among the results, starting at 1; continues across pages in video searches. | ||
| data.videos[].thumbnail | string | No | https://imgs.search.brave.com/example-thumb.jpg | URL of the video thumbnail. | ||
| data.videos[].title | string | No | Hello World in 15 Programming Languages - YouTube | Video title as shown on the Brave results page. | ||
| data.videos[].url | string | No | https://www.youtube.com/watch?v=tRUsXTbixIE | URL of the video page. | ||
| data.videos[].views | string | No | 118 | View count as Brave shows it. | ||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Missing or invalid query | #/definitions/app.Response |
| 404 | No results found | #/definitions/app.Response |
| 429 | Rate limit exceeded | #/definitions/app.Response |
| 500 | Internal server error | #/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/search?q=openai&country=us&lang=en&time_range=any" \
-H "x-api-key: $CRAWLORA_API_KEY"