PyGoogleNews
Installation and quickstart
Installation
Copy
$ pip install pygooglenews --upgrade
Quickstart
Copy
from pygooglenews import GoogleNews
gn = GoogleNews()
Top stories
Copy
top = gn.top_news()
Stories by topic
Copy
business = gn.topic_headlines('business')
Geolocation Specific Stories
Copy
headquaters = gn.geo_headlines('San Fran')
Stories by a Query Search
Copy
# search for the best matching articles that mention MSFT and
# do not mention AAPL (over the past 6 month
search = gn.search('MSFT -APPL', when = '6m')
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.