PyGoogleNews
Installation and quickstart
Installation
Copy
Ask AI
$ pip install pygooglenews --upgrade
Quickstart
Copy
Ask AI
from pygooglenews import GoogleNews
gn = GoogleNews()
Top stories
Copy
Ask AI
top = gn.top_news()
Stories by topic
Copy
Ask AI
business = gn.topic_headlines('business')
Geolocation Specific Stories
Copy
Ask AI
headquaters = gn.geo_headlines('San Fran')
Stories by a Query Search
Copy
Ask AI
# 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.