Skip to main content

Top Headlines Endpoint

This endpoint allows you to search for current trending articles, the articles that are selected to be returned by this endpoint are based on the Google News ranking. There are 9 categories available, the default category is "general".

HTTP Request

GET https://gnews.io/api/v4/top-headlines?category=general&apikey=API_KEY

Query Parameters

Parameter NameDefault ValueDescription
categorygeneralThis parameter allows you to change the category for the request. The available categories are : general, world, nation, business, technology, entertainment, sports, science and health.
langAnyThis parameter allows you to specify the language of the news articles returned by the API. You have to set as value the 2 letters code of the language you want to filter.
See the list of supported languages.
countryAnyThis setting allows you to filter articles by country. Most articles will come from sources originating in that country, and the others will be relevant to that country. You have to set as value the 2 letters code of the country you want to filter.
See the list of supported countries.
max10This parameter allows you to specify the number of news articles returned by the API. The minimum value of this parameter is 1 and the maximum value is 100. The value you can set depends on your subscription.
See the pricing for more information.
nullableNoneThis parameter allows you to specify the attributes that you allow to return null values. The attributes that can be set are description, content and image. It is possible to combine several attributes by separating them with a comma.
For example: description,content
fromNoneThis parameter allows you to filter the articles that have a publication date greater than or equal to the specified value. The date must comply with ISO 8601 format.
For example: 2025-07-18T21:32:58.500Z
toNoneThis parameter allows you to filter the articles that have a publication date smaller than or equal to the specified value. The date must comply with ISO 8601 format.
For example: 2025-07-18T21:32:58.500Z
qNoneThis parameter allows you to specify your search keywords to find the news articles you are looking for. The keywords will be used to return the most relevant articles. It is possible to use logical operators with keywords, see the section on query syntax. Maximum 200 characters.
page1This parameter allows you to control the pagination of the results returned by the API. The paging behavior is closely related to the value of the max parameter. The first page is page 1, then you have to increment by 1 to go to the next page. Let's say that the value of the max parameter is 10, then the first page will contain the first 10 articles returned by the API (articles 1 to 10), page 2 will return the next 10 articles (articles 11 to 20), etc.
For performance reasons, it is not possible to paginate more than 1000 articles.
expandNoneThis parameter will only work if you have a paid subscription activated on your account.
This parameter allows you to return in addition to other data, the full content of the articles. To get the full content of the articles, the parameter must be set to content, as follows expand=content

Code Examples

// TODO: replace API_KEY with your API key.
apikey = 'API_KEY';
category = 'general';
url = 'https://gnews.io/api/v4/top-headlines?category=' + category + '&lang=en&country=us&max=10&apikey=' + apikey;

fetch(url)
.then(function (response) {
return response.json();
})
.then(function (data) {
articles = data.articles;

for (i = 0; i < articles.length; i++) {
// articles[i].title
console.log("Title: " + articles[i]['title']);
// articles[i].description
console.log("Description: " + articles[i]['description']);
// You can replace {property} below with any of the article properties returned by the API.
// articles[i].{property}
// console.log(articles[i]['{property}']);

// Delete this line to display all the articles returned by the request. Currently only the first article is displayed.
break;
}
});

Alternatively, you can use our official libraries available at gnews.io/libraries.

Supported Languages

NameCode
Arabicar
Bengalibn
Bulgarianbg
Catalanca
Chinesezh
Dutchnl
Englishen
Estonianet
Finnishfi
Frenchfr
Germande
Greekel
Gujaratigu
Hebrewhe
Hindihi
Hungarianhu
Indonesianid
Italianit
Japaneseja
Koreanko
Latvianlv
Lithuanianlt
Malayalamml
Marathimr
Norwegianno
Polishpl
Portuguesept
Punjabipa
Romanianro
Russianru
Serbiansl
Slovaksk
Spanishes
Swedishsv
Tamilta
Telugute
Thaith
Turkishtr
Ukrainianuk
Vietnamesevi

Supported Countries

NameCode
Argentinaar
Australiaau
Austriaat
Bangladeshbd
Belgiumbe
Brazilbr
Bulgariabg
Canadaca
Chilecl
Chinacn
Colombiaco
Cubacu
Czech Republiccz
Egypteg
Estoniaee
Ethiopiaet
Finlandfi
Francefr
Germanyde
Ghanagh
Greecegr
Hong Konghk
Hungaryhu
Indiain
Indonesiaid
Irelandie
Israelil
Italyit
Japanjp
Kenyake
Lebanonlb
Lithuanialt
Latvialv
Malaysiamy
Mexicomx
Moroccoma
Namibiana
Netherlandsnl
New Zealandnz
Nigeriang
Norwayno
Pakistanpk
Perupe
Philippinesph
Polandpl
Portugalpt
Romaniaro
Russiaru
Saudi Arabiasa
Senegalsn
Serbiasi
Singaporesg
Slovakiask
South Africaza
South Koreakr
Spaines
Swedense
Switzerlandch
Taiwantw
Tanzaniatz
Thailandth
Turkeytr
Ugandaug
Ukraineua
United Arab Emiratesae
United Kingdomgb
United Statesus
Venezuelave
Vietnamvn
Zimbabwezw