mattlisiv / newsapi-python

A Python Client for News API
MIT License
375 stars 130 forks source link

Can't get top headlines for some countries (even though supported by the API) #91

Open EceSenaEtoglu opened 9 months ago

EceSenaEtoglu commented 9 months ago

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