qstringจำเป็น
The user’s search query term. Query can not be empty. Maximum of 400 characters and 50 words in the query.
https://api.sandbase.ai/v1/api/brave/newsNews Search from Brave. Returns the official Brave API response unchanged.
เอาต์พุตของคุณจะแสดงที่นี่
กรอกอินพุตให้ครบ แล้วคลิก Run
Returns news search results from Brave for a text query. Each result has a title, URL, short description, source name, and age. The only required input is q, the search query.
country, search_lang, and freshness filters.results[].profile.name and results[].meta_url.hostname.curl -X POST "https://api.sandbase.ai/v1/api/brave/news" \
-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 400 characters and 50 words in the query. |
count | integer | No | The number of search results returned in response. The maximum is 50. The actual number delivered may be less than requested. Combine this parameter with offset to paginate search results. |
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 or ALL for worldwide. |
extra_snippets | boolean | No | 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. |
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 |
include_fetch_metadata | boolean | No | Include fetch metadata. |
offset | integer | No | The zero based offset that indicates number of search results per page (count) to skip before returning the result. The maximum is 9. The actual number delivered may be less than requested based on the query. In order to |
operators | boolean | No | Whether to apply search operators. |
safesearch | string | No | Filters search results for adult content. The following values are supported: off - No filtering is done. moderate - Filter out explicit content. strict - Filter out explicit and suggestive content. |
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 spell check the provided query. If the spellchecker is enabled, the modified query is always used for search. The modified query can be found in altered key from the query response model. |
ui_lang | string | No | User interface language preferred in response. Usually of the format <language_code>-<country_code> . For more, see RFC 9110 . |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"query": {
"original": "best coffee in seattle",
"show_strict_warning": false,
"spellcheck_off": false
},
"results": [
{
"age": "9 hours ago",
"description": "Our favorite coffee spots in Seattle for sitting down and getting some work done…",
"extra_snippets": [
"All City Coffee is our favorite coffee shop in Georgetown for getting work done—…"
],
"meta_url": {
"favicon": "https://imgs.search.brave.com/3VTx1ykYSLM6wIkkWjezI6aUbxLh9fb82D4Ml5qPou4/rs:fit…",
"hostname": "theinfatuation.com",
"netloc": "theinfatuation.com",
"path": "› seattle › reviews › all-city-coffee",
"scheme": "https"
},
"page_age": "2026-11-02T22:39:38",
"profile": {
"name": "The Infatuation",
"url": "https://theinfatuation.com/seattle/reviews/all-city-coffee"
},
"thumbnail": {
"src": "https://imgs.search.brave.com/HCR-1mTmgRUuXT7KMPHvCK0NlhgVM3PVh4bWyvLmxYY/rs:fit…"
},
"title": "All City Coffee is the best spot to get work done in Georgetown - Review - Seatt…",
"type": "news_result",
"url": "https://theinfatuation.com/seattle/reviews/all-city-coffee"
}
],
"type": "news"
}
| Field | Meaning |
|---|---|
results[].title | Headline or page title of the news result. |
results[].url | Full URL of the article. |
results[].description | Short excerpt that describes the article. |
results[].extra_snippets[] | Additional excerpts from the same page. These appear in the response when the request sets extra_snippets to true. |
results[].age | Human-readable age of the result, such as 9 hours ago or February 17, 2026. |
results[].page_age | Page date as an ISO 8601 style timestamp, such as 2026-02-17T16:30:00. |
results[].profile.name / results[].profile.url | Name of the source publication and the URL tied to that source profile. |
results[].meta_url.hostname / results[].meta_url.netloc | Domain of the article. Use it to group or filter results by site. |
results[].thumbnail.src | URL of a thumbnail image for the result. |
query.original | The query string as you sent it. |
q is the only required parameter. It accepts up to 400 characters and 50 words.count (1 to 50, default 20) with offset (0 to 9). offset counts pages of count results.results has type set to news_result. The top-level type is news.$0.005 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/brave/news" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"q": "best coffee in seattle",
"count": 20,
"offset": 0,
"country": "US",
"ui_lang": "en-US",
"freshness": "",
"operators": true,
"safesearch": "strict",
"spellcheck": true,
"search_lang": "en",
"include_fetch_metadata": false
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
qstringจำเป็นThe user’s search query term. Query can not be empty. Maximum of 400 characters and 50 words in the query.
countintegerThe number of search results returned in response. The maximum is 50. The actual number delivered may be less than requested. Combine this parameter with offset to paginate search results.
ค่าเริ่มต้น: 20
countrystringThe search query country, where the results come from. The country string is limited to 2 character country codes of supported countries or ALL for worldwide.
ค่าเริ่มต้น: "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
extra_snippetsbooleanA 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.
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.
include_fetch_metadatabooleanInclude fetch metadata.
ค่าเริ่มต้น: false
offsetintegerThe zero based offset that indicates number of search results per page (count) to skip before returning the result. The maximum is 9. The actual number delivered may be less than requested based on the query. In order to paginate results use this parameter together with count. For example, if your u
ค่าเริ่มต้น: 0
operatorsbooleanWhether to apply search operators.
ค่าเริ่มต้น: true
safesearchstringFilters search results for adult content. The following values are supported: off - No filtering is done. moderate - Filter out explicit content. strict - Filter out explicit and suggestive content.
ค่าเริ่มต้น: "strict"
ค่าที่เป็นไปได้: 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 spell check the provided query. If the spellchecker is enabled, the modified query is always used for search. The modified query can be found in altered key from the query response model.
ค่าเริ่มต้น: true
ui_langstringUser interface language preferred in response. Usually of the format <language_code>-<country_code> . For more, see RFC 9110 .
ค่าเริ่มต้น: "en-US"
ค่าที่เป็นไปได้: 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
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
ยังไม่มีการเผยแพร่การตอบกลับที่บันทึกไว้ ให้รัน API ใน Playground เพื่อดูการตอบกลับ
สำรวจเพิ่มเติม
| API | ราคา | การตอบกลับ |
|---|---|---|
Brave News SearchAPI นี้ Brave | $0.005 ต่อการเรียก | JSON |
Brave | $0.01 ต่อการเรียก | JSON |
Brave | $0.005 ต่อการเรียก | JSON |
Brave | $0.005 ต่อการเรียก | JSON |
Brave | $0.005 ต่อการเรียก | JSON |
Brave | $0.005 ต่อการเรียก | JSON |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/brave/news โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
$0.005 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: q (string). ตัวเลือก: 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), extra_snippets (boolean), freshness (string), goggles (string) และ include_fetch_metadata (boolean) และอีก 6 รายการ ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น Brave News Search ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Brave API แยกต่างหาก