[Python] ValueError: cannot mix country/category param with sources param

Discussão em 'Python' iniciado por Stack, Dezembro 20, 2024.

  1. Stack

    Stack Membro Participativo

    I am working with an API for the very first time with Python and while doing so I got the following Error:


    ValueError: cannot mix country/category param with sources param.
    ​

    What should I do to solve this Error?

    This is the code:

    import config
    from newsapi import NewsApiClient

    newsapi = NewsApiClient(api_key=config.api_key)

    top_headlines = newsapi.get_top_headlines(q='Neuralink',sources='the-verge',category='technology',language='en',country='us')```

    Continue reading...

Compartilhe esta Página