qstring필수
The user’s search query term. Query can not be empty. Maximum of 600 characters and 75 words in the query.
https://api.sandbase.ai/v1/api/brave/llm-contextLLM Context from Brave. Returns the official Brave API response unchanged.
출력이 여기에 표시됩니다
입력을 완료한 다음 Run을 클릭하세요.
Returns page content snippets from web search results, shaped for use as context in an LLM prompt. It needs one search query in q. The response lists source pages with their text chunks and a metadata map keyed by URL.
best coffee in seattle.maximum_number_of_tokens and maximum_number_of_urls to fit a model's prompt limit.curl -X POST "https://api.sandbase.ai/v1/api/brave/llm-context" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"q": "best coffee in seattle"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
q | string | Yes | The user’s search query term. Query can not be empty. Maximum of 600 characters and 75 words in the query. |
context_threshold_mode | string | No | The mode to use to determine the threshold for including content in context. |
count | integer | No | The maximum number of search results considered to select the LLM context data. The default is 20 and the maximum is 50. |
country | string | No | The search query country, where the results come from. The country string is limited to 2 character country codes of supported countries. |
enable_local | boolean | No | Whether to enable local recall. Not setting this value means auto-detect: local recall is used if a location is provided ( X-Loc-Lat with X-Loc-Long , or X-Loc-City ). |
enable_source_metadata | boolean | No | Enable source metadata enrichment (site_name, favicon, thumbnail, description, fetched_content_timestamp) in the sources attribute of the response. |
freshness | string | No | 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 h |
goggles | string | No | 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 param |
maximum_number_of_snippets | integer | No | Maximum number of different snippets (or chunks of text) to include in LLM context. The default is 50 and maximum is 256 . |
maximum_number_of_snippets_per_url | integer | No | Maximum number of snippets to include per URL. The default is 50 and maximum is 100 . |
maximum_number_of_tokens | integer | No | Approximate maximum number of tokens to include in context. The default is 8192 and maximum is 32768 . |
maximum_number_of_tokens_per_url | integer | No | Maximum number of tokens to include per URL. The default is 4096 and maximum is 8192 . |
maximum_number_of_urls | integer | No | Maximum number of different URLs to include in LLM context. |
safesearch | string | No | Filters results for adult content. The following values are supported: off - No filtering is done. moderate - Drops adult content from the results used for context. strict - Drops all adult content from the results used |
search_lang | string | No | The search language preference. The 2 or more character language code for which the search results are provided. |
spellcheck | boolean | No | Whether to enable spellcheck on the query. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"grounding": {
"generic": [
{
"snippets": [
"# The Best Seattle Coffee Shops\n## Cardoon\nAs for coffee you can’t go wrong with…"
],
"title": "The Best Coffee Shops in the Seattle Area",
"url": "https://seattle.eater.com/maps/seattles-best-coffee-shops"
}
],
"map": []
},
"sources": {
"https://alyeatsfood.com/2022/07/31/must-try-seattle-coffee-shops/": {
"age": [
"Sunday, July 31, 2022"
],
"hostname": "alyeatsfood.com",
"snippet": "Seattle has some of the best coffee out there and chances are you may have tried…",
"title": "Must Try Seattle Coffee Shops"
},
"https://anchorheadcoffee.com/": {
"age": [
"Friday, November 14, 2025"
],
"hostname": "anchorheadcoffee.com",
"snippet": "Anchorhead Coffee is a Seattle-based specialty coffee roaster with cafes in Down…",
"title": "Anchorhead Coffee"
},
"https://explorewashingtonstate.com/10-cafes-to-grab-a-coffee-in-seattle/": {
"age": [
"Sunday, November 01, 2026"
],
"hostname": "explorewashingtonstate.com",
"snippet": "Seattle is stereotypically associated with its rainy weather, tech companies suc…",
"title": "Best Coffee in Seattle (2026)"
},
"https://feastio.com/coffee-shops-seattle/": {
"age": [
"Friday, August 14, 2026"
],
"hostname": "feastio.com",
"snippet": "Explore the best Seattle coffee shops from iconic venues to hidden gems.",
"title": "Exploring Seattle's Best Third-Wave Coffee Shops"
},
"https://seattle.eater.com/maps/seattles-best-coffee-shops": {
"age": [
"Wednesday, March 11, 2026"
],
"hostname": "seattle.eater.com",
"snippet": "Vietnamese brews topped with salted cream, old-school espresso, and innovative i…",
"title": "The Best Coffee Shops in the Seattle Area"
},
"https://seattleunexplored.com/the-2018-best-seattle-coffee-shop-awards-part-1/": {
"age": [
"Saturday, December 12, 2020"
],
"hostname": "seattleunexplored.com",
"snippet": "With two young’uns, we’ve had to trade in our frequency of night life in Seattle…",
"title": "The Seattle Coffee Shop Awards - Part 1 - Seattle Unexplored"
},
"https://seattleunexplored.com/the-seattle-coffee-shop-awards-part-4/": {
"age": [
"Saturday, December 12, 2020"
],
"hostname": "seattleunexplored.com",
"snippet": "See our other installments of Seattle Coffee Shop Awards: Everything You Always …",
"title": "The Seattle Coffee Shop Awards - Part 4 - Seattle Unexplored"
},
"https://sevencoffeeroasters.com/pages/seven-market-cafe": {
"age": [],
"hostname": "sevencoffeeroasters.com",
"snippet": "One of the best-reviewed coffee shops in Seattle on Google Maps.",
"title": "Seven Market"
},
"https://wheatlesswanderlust.com/best-coffee-shops-in-seattle/": {
"age": [
"Tuesday, September 15, 2026"
],
"hostname": "wheatlesswanderlust.com",
"snippet": "Three coffee snobs go on a quest to uncover the best coffee in Seattle. Read to …",
"title": "The Best Coffee In Seattle: A Guide For Coffee Lovers"
},
"https://www.cntraveler.com/gallery/best-coffee-shops-in-seattle-united-states": {
"age": [
"Friday, September 04, 2026"
],
"hostname": "www.cntraveler.com",
"snippet": "Our top recommendations for the best coffee in Seattle with pictures, reviews, a…",
"title": "10 Best Coffee Shops in Seattle"
},
"https://www.doubleskinnymacchiato.com/2020/03/seattle-specialty-coffee-shops-guide-map.html": {
"age": [
"Monday, March 02, 2020"
],
"hostname": "www.doubleskinnymacchiato.com",
"snippet": "The first Starbucks opened in Pike Place Market in 1971, and whatever you feel a…",
"title": "Double Skinny Macchiato"
},
"https://www.emeraldpalate.com/best-coffee-shops-in-seattle/": {
"age": [
"Thursday, July 30, 2026"
],
"hostname": "www.emeraldpalate.com",
"snippet": "A local shares the best coffee shops in Seattle, WA. Find creative coffee drinks…",
"title": "26 Best Coffee Shops in Seattle, WA for a Caffeine Fix"
}
}
}
| Field | Meaning |
|---|---|
grounding.generic[].title | Title of a page whose text was selected as context. |
grounding.generic[].url | URL of the page. It matches a key in the sources object. |
grounding.generic[].snippets[] | Text chunks taken from the page. Pass these to your LLM as context. |
grounding.map | List of map-style results. It is empty in this response. |
sources.<url>.title | Page title for the source, keyed by the full page URL. |
sources.<url>.hostname | Domain name of the source page. |
sources.<url>.snippet | Short description of the page. |
sources.<url>.age | List of three items: a readable date, an ISO date such as 2026-11-01, and a relative age such as 2 days ago. The list is empty when no date is known. |
q is required. Use count, maximum_number_of_urls, maximum_number_of_snippets and maximum_number_of_tokens to control how much context comes back.grounding.generic[].url to the keys of sources to get the hostname and age of each page.sources can hold more pages than grounding.generic, so not every source has snippets.enable_source_metadata to true to add fields such as site_name, favicon and thumbnail to sources. For plain result lists, try Brave Web Search.$0.005 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
빌드를 시작하세요
통합 인증 및 사용량 추적이 있는 플랫폼 API 엔드포인트입니다.
curl -X POST "https://api.sandbase.ai/v1/api/brave/llm-context" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "best coffee in seattle",
"count": 20,
"country": "US",
"freshness": "",
"spellcheck": true,
"search_lang": "en",
"enable_source_metadata": false,
"maximum_number_of_urls": 20,
"maximum_number_of_tokens": 8192,
"maximum_number_of_snippets": 50,
"maximum_number_of_tokens_per_url": 4096,
"maximum_number_of_snippets_per_url": 50
}'서버 환경에 SandBase API 키를 설정하세요. 요청에는 Bearer 인증이 사용됩니다.
export SANDBASE_API_KEY="YOUR_API_KEY"키는 서버에 보관하세요. 브라우저 코드에 노출하지 마세요.
qstring필수The user’s search query term. Query can not be empty. Maximum of 600 characters and 75 words in the query.
context_threshold_modestringThe mode to use to determine the threshold for including content in context.
가능한 값: disabled, strict, lenient, balanced
countintegerThe maximum number of search results considered to select the LLM context data. The default is 20 and the maximum is 50.
기본값: 20
countrystringThe search query country, where the results come from. The country string is limited to 2 character country codes of supported countries.
기본값: "US"
가능한 값: 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
enable_localbooleanWhether to enable local recall. Not setting this value means auto-detect: local recall is used if a location is provided ( X-Loc-Lat with X-Loc-Long , or X-Loc-City ).
enable_source_metadatabooleanEnable source metadata enrichment (site_name, favicon, thumbnail, description, fetched_content_timestamp) in the sources attribute of the response.
기본값: false
freshnessstringFilters 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
기본값: ""
gogglesstringGoggles 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.
maximum_number_of_snippetsintegerMaximum number of different snippets (or chunks of text) to include in LLM context. The default is 50 and maximum is 256 .
기본값: 50
maximum_number_of_snippets_per_urlintegerMaximum number of snippets to include per URL. The default is 50 and maximum is 100 .
기본값: 50
maximum_number_of_tokensintegerApproximate maximum number of tokens to include in context. The default is 8192 and maximum is 32768 .
기본값: 8192
maximum_number_of_tokens_per_urlintegerMaximum number of tokens to include per URL. The default is 4096 and maximum is 8192 .
기본값: 4096
maximum_number_of_urlsintegerMaximum number of different URLs to include in LLM context.
기본값: 20
safesearchstringFilters results for adult content. The following values are supported: off - No filtering is done. moderate - Drops adult content from the results used for context. strict - Drops all adult content from the results used for context. When not set, no filtering is applied — except for local recall, wh
가능한 값: off, moderate, strict
search_langstringThe search language preference. The 2 or more character language code for which the search results are provided.
기본값: "en"
가능한 값: 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
spellcheckbooleanWhether to enable spellcheck on the query.
기본값: true
이 API의 저장된 예시 응답입니다. 확인할 때 라이브 요청은 실행되지 않습니다.
저장된 응답이 게시되지 않았습니다. Playground에서 API를 실행해 응답을 확인하세요.
더 살펴보기
| API | 가격 | 응답 |
|---|---|---|
Brave LLM Context이 API Brave | $0.005 / 호출 | JSON |
Brave | $0.01 / 호출 | JSON |
Brave | $0.005 / 호출 | JSON |
Brave | $0.005 / 호출 | JSON |
Brave | $0.005 / 호출 | JSON |
Brave | $0.005 / 호출 | JSON |
질문
Authorization 헤더(Bearer)에 SandBase API 키를 넣고, 매개변수를 JSON 본문으로 담아 https://api.sandbase.ai/v1/api/brave/llm-context에 POST 요청을 보내세요. 이 페이지의 Playground에서도 코드를 작성하지 않고 직접 테스트할 수 있습니다.
호출당 $0.005, SandBase 잔액에서 청구됩니다. 사용한 호출에 대해서만 요금이 부과되며, 구독은 없습니다.
필수: q (string). 선택: context_threshold_mode(disabled, strict, lenient, balanced 중 하나), count (integer), country(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 중 하나), enable_local (boolean), enable_source_metadata (boolean) 및 freshness (string) 외 9개. 이 페이지의 Parameters 표와 Playground에 모든 필드가 나와 있습니다.
같은 HTTP 요청에서 반환되는 JSON 응답입니다(동기식). 이 페이지의 README에 샘플 응답이 포함되어 있습니다.
아니요. Brave LLM Context은 SandBase를 통해 실행되므로, SandBase API 키 하나로 이 엔드포인트와 카탈로그의 다른 모든 API 및 모델을 사용할 수 있습니다. Brave API 액세스를 별도로 신청할 필요는 없습니다.