Python web scraping framework covering single HTTP requests, stealth browsers, parsing, and full concurrent crawls with exports.
ranahaani/GNews
A lightweight Python package that searches Google News and returns article results as JSON, with optional full-text extraction.
- Stars
- 1,018
- Forks
- 153
- Open issues
- 0
- Last commit
- 11 days ago
What is it?
GNews is a Python package for searching Google News. It queries the Google News RSS feed by keyword, topic, location, or site and returns each article's title, description, publish date, URL, and publisher as JSON. Searches can be filtered by language, country, time period, date range, and excluded websites.
Beyond search results, GNews can fetch the full text of an article through the optional fulltext extra, so developers do not need to write their own scrapers for article bodies. It also offers a command-line interface, export to JSON and CSV, and async versions of its search methods. An optional Playwright extra resolves Google News redirect links into real article URLs.
An optional SearchApi backend, enabled by passing an API key, adds fields such as ISO dates, thumbnails, and pagination beyond the RSS result limit. GNews also accepts a standard requests-style proxy configuration for routing traffic.
Key features
- 01Searches Google News by keyword, topic, location, or site and returns JSON results.
- 02Filters results by language, country, time period, date range, and excluded sites.
- 03Extracts full article text via an optional extra.
- 04Provides a command-line interface with JSON output.
- 05Exports results to JSON and CSV files.
- 06Offers async versions of all search methods.
Use cases
- Collecting news articles on a topic for media monitoring or analysis.
- Building a news feed or dashboard from Google News results in Python.
- Preparing a news dataset for sentiment analysis or NLP experiments.
- Scripting daily headline pulls from the command line.
Quick start
- 1
Install the package
pip install gnews - 2
Fetch news for a keyword in Python
from gnews import GNews
Things to know
- Results come from the Google News RSS feed, so output depends on Google News behaviour.
- Heavy scraping can get your IP rate-limited, and the README suggests a paid proxy service for that.
- Full article extraction and URL resolution need optional extras (fulltext, playwright) and a Chromium install.
Topics
FAQ
- What is GNews?
- A lightweight Python package that searches Google News and returns article results as JSON, with optional full-text extraction. GNews is a Python package for searching Google News. It queries the Google News RSS feed by keyword, topic, location, or site and returns each article's title, description, publish date, URL, and publisher as JSON. Searches can be filtered by language, country, time period, date range, and excluded websites.
- Is GNews free to use? What license does it have?
- GNews is open source under the MIT license. Check the license terms before using it in commercial products.
- Is GNews still maintained?
- Actively maintained. The last commit to GNews was on Oct 9, 2026.
- What can I use GNews for?
- Collecting news articles on a topic for media monitoring or analysis. Building a news feed or dashboard from Google News results in Python. Preparing a news dataset for sentiment analysis or NLP experiments. Scripting daily headline pulls from the command line.
- How do I install GNews?
- Install the package: pip install gnews Fetch news for a keyword in Python: from gnews import GNews
- Where can I get GNews?
- The source code and installation instructions are on GitHub: https://github.com/ranahaani/GNews
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Python tool and CLI that downloads chat messages from YouTube, Twitch, and Zoom livestreams, videos, clips, and past broadcasts without authentication.
Open-source Python library for building AI agents that control a real browser, with optional Browser Use Cloud stealth browsers and hosted agent API.
Self-hosted web page change monitor that alerts you via Discord, Email, Slack, Telegram, webhooks and more when a page changes.
A Python web scraping library that uses LLMs and graph-based pipelines to extract structured data from websites and local documents based on a text prompt.
An open-source autonomous research agent that plans questions, gathers web and local sources, and writes cited reports with any LLM provider.