Registry / http-networking / gnews
library0.8.1pypypi✓ verified 79d ago

A lightweight Python client to search and retrieve news articles from Google News, returning structured JSON. Current version 0.4.3. Low release cadence, last release in 2021.

pip install gnews
INSTALL
IMPORT
SIG · GNEWS
G
gnews
http-networkingpythonv0.8.1
Install
3.5s avg
Import
Disk
25MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.8.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 27MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 3.5s · import 0.000s · 28MB
25MB installed
● package 25MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GNews
from gnews import GNews
from gnews import GNEWS

Basic usage: create a GNEWS instance and call get_news() to retrieve articles.

from gnews import GNEWS # Initialize with optional language and country gnews = GNEWS(language='en', country='US') # Search for news results = gnews.get_news('Python programming') for article in results[:3]: print(article['title'], '-', article['url'])
Debug
Known issues
breakingVersion 0.2.3 changed the method signature. `GNEWS.get_news(query)` now returns a list of dicts instead of a dict with 'entries' key.
fix
Update code to handle list directly, not accessing .get('entries').
affects: >=0.2.3
gotchaThe class name is `GNEWS` (all caps), not `Gnews` or `GNews`. Many examples online use incorrect casing.
fix
Use `from gnews import GNEWS`.
affects: all
deprecatedThe `get_news_by_topic` method is no longer documented and may be removed in future versions.
fix
Use `get_news(query)` with appropriate keywords instead.
affects: >=0.2.3
gotchaGoogle News may block requests without proper User-Agent. The library does not set one by default.
fix
Manually set headers on the session: `gnews.session.headers.update({'User-Agent': 'Mozilla/5.0 ...'})`.
affects: all
breakingThe `country` parameter in constructor expects ISO 3166-1 alpha-2 code (e.g., 'US', 'IN'). Wrong codes may silently return empty results.
fix
Use valid country codes. Common ones: 'US', 'GB', 'IN', 'CA'.
affects: all
Upgrade
Version history
0.8.1latest on PyPI · released Jun 17, 2026
Audit
Dependencies
requestsrequiredHTTP requests to Google News
beautifulsoup4requiredHTML parsing
Agent activity
21 hits · last 30 days
node
20
Resources
gnews — pip install gnews · libregistry