You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default language of get_top_headlines seems "en". When needed to get specific news for a country, if language is not changed article count seems 0.
Change the language get the news, could be a choice.
BUT
The problem occurs when the language is not supported by the API
top_headlines = newsapi.get_top_headlines(country="tr",language = "tr")
print(top_headlines)
Above code gives" invalid language error".
But in the API doc, specific news are supported for Turkey.
Since in the client, language has to be changed to get the news and language is not defined tor Turkey in the API, it raises an error
Also the issue exists in getting category specific news for countries
The text was updated successfully, but these errors were encountered:
EceSenaEtoglu
changed the title
Can't get category specific top headlines for some countries (even though supported by the API)
Can't get top headlines for some countries (even though supported by the API)
Oct 5, 2023
The default language of get_top_headlines seems "en". When needed to get specific news for a country, if language is not changed article count seems 0.
Change the language get the news, could be a choice.
BUT
The problem occurs when the language is not supported by the API
top_headlines = newsapi.get_top_headlines(country="tr",language = "tr")
print(top_headlines)
Above code gives" invalid language error".
But in the API doc, specific news are supported for Turkey.
Since in the client, language has to be changed to get the news and language is not defined tor Turkey in the API, it raises an error
Also the issue exists in getting category specific news for countries
The text was updated successfully, but these errors were encountered: