Metadata-Version: 2.4
Name: google-news-scraper-api
Version: 0.1.0
Summary: News scraper API for Google News. Scrape Google News results in Python as structured JSON with title, source, snippet and date.
Author: wordstotech
License: MIT
Project-URL: Homepage, https://www.scrapingbee.com/scrapers/google-news-scraper-api/
Project-URL: Documentation, https://www.scrapingbee.com/documentation/google-api/
Project-URL: Repository, https://github.com/ScrapingBee/google-news-scraper-api
Keywords: news-scraper-api,google-news-scraper,news-scraper,scrape-google-news,google-news-api,serp-api,media-monitoring,web-scraping-api,scraping-api,scrapingbee
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Text Processing :: Indexing
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Dynamic: license-file

# google-news-scraper-api

A **news scraper API** for Python, built on ScrapingBee's
[Google News scraper](https://www.scrapingbee.com/scrapers/google-news-scraper-api/). It turns a
query into structured articles with title, source, domain, snippet and timestamp, so you never
touch Google's markup.

Verified live on 2026-08-25 against `GET /api/v1/google` with `search_type=news`. Calls in testing
charged 10 credits.

## Install

```bash
pip install google-news-scraper-api
```

## Scrape Google News results

```python
from google_news_scraper_api import GoogleNewsScraper

scraper = GoogleNewsScraper("YOUR-API-KEY")

for article in scraper.search("openai", country_code="us"):
    print(article.date, article.source, article.title)
```

Get a key at [app.scrapingbee.com](https://app.scrapingbee.com/); new accounts include 1,000 free
credits.

## Article fields

Every result carries the nine keys the API actually returns:

| Field | Example |
| --- | --- |
| `title` | "OpenAI Claims Its New Chips Can Outperform Nvidia" |
| `source` | "Bloomberg" |
| `domain` | the publisher domain, useful for allow-lists |
| `link` | the article URL |
| `snippet` | the summary line under the headline |
| `date` | ISO 8601 timestamp |
| `relative_date` | "3 hours ago" style string |
| `position` | rank within the page |
| `page` | which result page it came from |

`article.as_dict()` gives you all nine at once, which is what you want before writing to a
database or a dataframe.

## Paging without waste

`paginate` walks result pages and stops the moment one comes back empty, so an optimistic page
count does not spend credits on nothing:

```python
articles = list(scraper.paginate("climate policy", pages=5, country_code="us"))
print(len(articles))
```

## Deduplicating a monitor

Syndicated stories repeat across pages and across queries. Counting them twice makes a media
monitor useless, so dedupe by link before you store anything:

```python
raw = []
for query in ["openai", "anthropic", "mistral ai"]:
    raw.extend(scraper.paginate(query, pages=2, country_code="us"))

unique = GoogleNewsScraper.deduplicate(raw)
print(len(raw), "->", len(unique))
```

## Query controls worth knowing

```python
scraper.search("acme corp", country_code="gb", date_range="d")   # recent window
scraper.search("scrapingbee", nfpr=True)                         # no spelling "correction"
```

`nfpr=True` matters more than it looks. Google rewrites unfamiliar brand names to something it
considers correct, which quietly turns a brand monitor into a monitor for a different word.

One documented limit: `search_type=news` is not available with `device="mobile"`.

## Raw payload

When you want `meta_data` as well as the articles:

```python
payload = scraper.search_raw("openai", country_code="us")
print(payload["meta_data"])
# {'url': 'https://www.google.com/search?q=openai&hl=en&gl=us&tbm=nws', 'number_of_page': 10, ...}
```

## Cost

| Call | Credits |
| --- | --- |
| One news query | 10 in testing, 15 documented standard, 10 with `light_request=true` |
| `usage()` | 0 |
| HTTP 500 | 0 |

Retrying a 500 is free. Check the balance with `scraper.usage()` before a scheduled sweep. Tiers
on the [pricing page](https://www.scrapingbee.com/pricing/).

## Other Google surfaces

The same endpoint switches surface with `search_type`, so the same key also reaches
[Google search](https://www.scrapingbee.com/features/google/),
[Shopping](https://www.scrapingbee.com/scrapers/google-shopping-api/),
[Images](https://www.scrapingbee.com/scrapers/google-image-scraper/),
[Lens](https://www.scrapingbee.com/scrapers/google-lens-api/),
[AI Mode](https://www.scrapingbee.com/scrapers/google-ai-mode-api/) and
[Ads](https://www.scrapingbee.com/scrapers/google-ads-api/). For a lighter alternative there is
[Fast Search](https://www.scrapingbee.com/features/fast-search/), and for an RSS-shaped feed see
the [Google News RSS API](https://www.scrapingbee.com/scrapers/google-news-rss-api/).

## Scope

Public, pre-login content only. Scraping behind login credentials is prohibited by the
[ScrapingBee terms](https://www.scrapingbee.com/terms-and-conditions/). Keep API keys out of AI
coding assistants.

MIT licensed. [Repository](https://github.com/ScrapingBee/google-news-scraper-api) .
[API reference](https://www.scrapingbee.com/documentation/google-api/)
