Top headlines
curl --request GET \
--url https://api.bonai.io/google-news/top-headlines \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bonai.io/google-news/top-headlines"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bonai.io/google-news/top-headlines', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.bonai.io/google-news/top-headlines"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request GET \
--url https://api.bonai.io/google-news/top-headlines \
--header 'Authorization: Bearer <token>'{
"success": true,
"totalHits": 123,
"size": 123,
"pageSize": 123,
"page": 123,
"totalPages": 123,
"articles": [
{
"title": "<string>",
"url": "<string>",
"date": "2023-11-07T05:31:56Z",
"thumbnail": "<string>",
"description": "<string>",
"authors": [
"<string>"
],
"source": {
"name": "<string>",
"url": "<string>",
"favicon": "<string>",
"publication_id": "<string>"
},
"keywords": [
"<string>"
]
}
]
}{
"success": false,
"code": 123,
"message": "<string>",
"fields": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
]
}{
"success": false,
"code": 123,
"message": "<string>",
"fields": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
]
}API Reference
Top headlines
Get top headlines for a country and language.
GET
/
top-headlines
Top headlines
curl --request GET \
--url https://api.bonai.io/google-news/top-headlines \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.bonai.io/google-news/top-headlines"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.bonai.io/google-news/top-headlines', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.bonai.io/google-news/top-headlines"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request GET \
--url https://api.bonai.io/google-news/top-headlines \
--header 'Authorization: Bearer <token>'{
"success": true,
"totalHits": 123,
"size": 123,
"pageSize": 123,
"page": 123,
"totalPages": 123,
"articles": [
{
"title": "<string>",
"url": "<string>",
"date": "2023-11-07T05:31:56Z",
"thumbnail": "<string>",
"description": "<string>",
"authors": [
"<string>"
],
"source": {
"name": "<string>",
"url": "<string>",
"favicon": "<string>",
"publication_id": "<string>"
},
"keywords": [
"<string>"
]
}
]
}{
"success": false,
"code": 123,
"message": "<string>",
"fields": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
]
}{
"success": false,
"code": 123,
"message": "<string>",
"fields": [
{
"name": "<string>",
"type": "<string>",
"description": "<string>"
}
]
}Authorizations
Your Bonai API key, sent as Authorization: Bearer <key>. The api-key and x-api-key headers are also accepted.
Headers
API version to consume. Defaults to the latest version (2026-05-25).
Available options:
2026-05-25, 2024-01-01, 2022-01-01 Query Parameters
Country code
Language code
Number of results per page
Required range:
x <= 150Page number
Response
Successful response
Example:
true
Total number of matching items
Number of results in this page
Maximum items per page
Current page number
Total number of pages
Hide child attributes
Hide child attributes
Was this page helpful?