Skip to content

'us' is working but 'kr', 'jp', 'cn' .. are not working #93

Open

Description

@hwk06023
# US
head_lines = newsapi.get_top_headlines(category='entertainment', country='us')

for x in head_lines['articles']:
    print('title:', x['title'])
    print('description:', x['description'])    
    print('url:', x['url'])
    # print('urlToImage:', x['urlToImage'])
    print('content:', x['content'])
    print()

->

news_api


head_lines = newsapi.get_top_headlines(category='entertainment', country='kr') # or 'jp' or 'cn' ....

print(top_headlines)

for x in head_lines['articles']:
    print('title:', x['title'])
    print('description:', x['description'])    
    print('url:', x['url'])
    # print('urlToImage:', x['urlToImage'])
    print('content:', x['content'])
    print()

->

news_api_kr


Hi. In my case, 'us' is working but 'kr', 'jp', 'cn' .. are not working.
Is it not supported originally, or does there seem to be a problem?

Thank you.

Activity

  1. lukasfasnacht commented on Jun 8, 2024

    @lukasfasnacht

    I've encountered the same problem. The modul supported all the country codes when I first implemented it. Seems like a new issue to me.

  2. one-littlebear commented on Aug 14, 2024

    @one-littlebear

    Found the problem: the "get_top_headlines" function has "en" as default language. Just change it to "None" like the other params.

  3. Shishir-Suman commented on Nov 14, 2024

    @Shishir-Suman

    Anyone else failing the issue still. Tried running the code below but no results

    
    api = NewsApiClient(api_key=<api-key>)
    
    head_lines = api.get_top_headlines(category='entertainment', country='gb', language='en')```
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions