0

am trying to retrieve a news headlines using the API NewsApicatcher i did what are mentioned in the documentation but when i try to use multiple q paramater i have an error. I've tried to use doubles quotes but still the error thank in advance.

from newscatcherapi import NewsCatcherApiClient

newscatcherapi = NewsCatcherApiClient(x_api_key='N8ufhnGvBzL1MrspefKl5txhxC-PeYZUQCtlE3LcarQ')

all_articles = newscatcherapi.get_search(q='Elon Musk' OR 'Tim Cook' OR 'Bill Gates',
                                         lang='en',
                                         countries='US',
                                         page_size=100)

and i got this error :

  File "<ipython-input-33-b5fb97e57424>", line 5
    all_articles = newscatcherapi.get_search(q='Elon Musk' OR 'Tim Cook' OR 'Bill Gates',
                                               ^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
frentych
  • 1
  • 1

0 Answers0