API reference · Brave
brave/web
Integrate this model through SandBase's unified API, with production-ready schemas and examples.
Production endpoint
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
POST
https://api.sandbase.ai/v1/api/brave/webModel ID
brave/web01
Input Schema
19 parameters · 1 required · 18 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Required | The user’s search query term. Query can not be empty. Maximum of 600 characters and 75 words in the query. |
count | integer | Optional | The number of search results returned in response. The maximum is 20. The actual number delivered may be less than requested. Combine this parameter with offset to paginate search results. NOTE: Count only applies to web results. · Min: 1 · Max: 20 · Default: 20 |
units | string | Optional | The measurement units. The following values are supported: metric - The standardized measurement system (km, celcius…) imperial - The British Imperial system of units (mile, fahrenheit…) · Options: imperial, metric imperialmetric |
offset | integer | Optional | The zero based offset that indicates number of search result pages (count) to skip before returning the result. The default is 0 and the maximum is 9. The actual number delivered may be less than requested. Use this parameter along with the count parameter to page results. For example, if your user · Min: 0 · Max: 9 · Default: 0 |
country | string | Optional | The 2 character country code where the search results come from. · Options: AR, AU, AT, BE, BR, CA, CL, DK, FI, FR, DE, GR, HK, IN, ID, IT, JP, KR, MY, MX, NL, NZ, NO, CN, PL, PT, PH, RU, SA, ZA, ES, SE, CH, TW, TR, GB, US, ALL · Default: "US" ARAUATBEBRCACLDKFIFRDEGRHKINIDITJPKRMYMXNLNZNOCNPLPTPHRUSAZAESSECHTWTRGBUSALL |
goggles | string | Optional | Goggles act as a custom re-ranking on top of Brave’s search index. The parameter supports both a url where the Goggle is hosted or the definition of the Goggle. For more details, see the Goggles documentation . The parameter can be a single Goggle or a list of up to 3 Goggles. |
summary | boolean | Optional | This parameter enables summary key generation in web search results. This is required for summarizer to be enabled. |
ui_lang | string | Optional | User interface language preferred in response. Usually of the format <language_code>-<country_code>. For more, see RFC 9110 . · Options: es-AR, en-AU, de-AT, nl-BE, fr-BE, pt-BR, en-CA, fr-CA, es-CL, da-DK, fi-FI, fr-FR, de-DE, el-GR, zh-HK, en-IN, en-ID, it-IT, ja-JP, ko-KR, en-MY, es-MX, nl-NL, en-NZ, no-NO, zh-CN, pl-PL, en-PH, ru-RU, en-ZA, es-ES, sv-SE, fr-CH, de-CH, zh-TW, tr-TR, en-GB, en-US, es-US · Default: "en-US" es-ARen-AUde-ATnl-BEfr-BEpt-BRen-CAfr-CAes-CLda-DKfi-FIfr-FRde-DEel-GRzh-HKen-INen-IDit-ITja-JPko-KRen-MYes-MXnl-NLen-NZno-NOzh-CNpl-PLen-PHru-RUen-ZAes-ESsv-SEfr-CHde-CHzh-TWtr-TRen-GBen-USes-US |
freshness | string | Optional | Filters search results by page age. The age of a page is determined by the most relevant date reported by the content, such as its published or last modified date. The following values are supported: pd - Pages aged 24 hours or less. pw - Pages aged 7 days or less. pm - Pages aged 31 days or less. p · Default: "" |
operators | boolean | Optional | Whether to apply search operators · Default: true |
goggles_id | string | Optional | Goggles act as a custom re-ranking on top of Brave’s search index. For more details, refer to the Goggles repository. This parameter is deprecated. Please use the goggles parameter. |
safesearch | string | Optional | Filters search results for adult content. The following values are supported: off - No filtering is done. moderate - Filters explicit content, like images and videos, but allows adult domains in the search results. strict - Drops all adult content from search results. · Options: off, moderate, strict · Default: "moderate" offmoderatestrict |
spellcheck | boolean | Optional | Whether to spell check provided query. If the spell checker is enabled, the modified query is always used for search. The modified query can be found in altered key from the query response model. · Default: true |
search_lang | string | Optional | The 2 or more character language code for which the search results are provided. · Options: ar, eu, bn, bg, ca, zh-hans, zh-hant, hr, cs, da, nl, en, en-gb, et, fi, fr, gl, de, el, gu, he, hi, hu, is, it, ja, jp, kn, ko, lv, lt, ms, ml, mr, nb, pl, pt-br, pt-pt, pa, ro, ru, sr, sk, sl, es, sv, ta, te, th, tr, uk, vi · Default: "en" areubnbgcazh-hanszh-hanthrcsdanlenen-gbetfifrgldeelguhehihuisitjajpknkolvltmsmlmrnbplpt-brpt-ptparorusrskslessvtatethtrukvi |
result_filter | string[] | Optional | 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 the plan has the corresponding option activated. The response always includes query and type to identify any quer |
extra_snippets | boolean | Optional | 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. |
text_decorations | boolean | Optional | Whether display strings (e.g. result snippets) should include decoration markers (e.g. highlighting characters). · Default: true |
enable_rich_callback | boolean | Optional | Enable rich callback. Allows you to get real time rich results via a callback URL when they are relevant to your query. NOTE : Requires Search plan. · Default: false |
include_fetch_metadata | boolean | Optional | Include fetch metadata. · Default: false |
02
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
03
Code Examples
Ready-to-run snippets
const apiKey = process.env.SANDBASE_API_KEY;
const response = await fetch("https://api.sandbase.ai/v1/api/brave/web", {
method: "POST",
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"count": 20,
"offset": 0,
"country": "US",
"ui_lang": "en-US",
"freshness": "",
"operators": true,
"safesearch": "moderate",
"spellcheck": true,
"search_lang": "en",
"text_decorations": true,
"enable_rich_callback": false,
"include_fetch_metadata": false
}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());