Playground Sign in Start free

Google News SERP API

1

Overview

The SERP (Search Engine Results Page) API allows you to access Google News results programmatically without dealing with HTML parsing or JavaScript rendering. You get clean, structured JSON data.

What You'll Get

News headlines & titles
Article snippets
Source publication
Publication timestamp
Article URLs
Thumbnail images
Why Use SERP API?

Unlike scraping HTML, SERP API provides pre-structured data, is more reliable against Google updates, includes geo-targeting, and is faster since there's no need for JavaScript rendering.

2

API Parameters

The SERP API for Google News supports several parameters to customize your search:

ParameterDescriptionExample
searchSearch queryartificial intelligence
search_typeSet to news for Google Newsnews
locationCountry codeUS, GB, DE
langLanguageen, es, fr
extra_paramsAdditional params (e.g. time filter)&tbs=qdr:h (past hour)
results_countResults per page10, 20, 50
Time Filters

Use extra_params=&tbs=qdr:h for past hour, qdr:d for past day, qdr:w for past week, qdr:m for past month.

3

Make the API Request

curl -X GET "https://api.ujeebu.com/serp" \
  -H "ApiKey: YOUR_API_KEY" \
  -G \
  --data-urlencode "search=artificial intelligence" \
  --data-urlencode "search_type=news" \
  --data-urlencode "location=US" \
  --data-urlencode "lang=en" \
  --data-urlencode "results_count=10"
4

Response Format

The API returns structured JSON with news articles:

JSON - API Response
{
  "metadata": {
    "google_url": "https://www.google.com/search?gl=US&hl=en&num=10&q=artificial+intelligence&tbm=nws",
    "number_of_results": 1250000,
    "query_displayed": "artificial intelligence",
    "results_time": "0.25 seconds"
  },
  "news": [
    {
      "position": 1,
      "title": "AI Breakthrough: New Model Achieves Human-Level Performance",
      "link": "https://techsite.com/article/ai-breakthrough",
      "siteName": "TechSite",
      "date": "2 hours ago",
      "description": "Researchers announce a major breakthrough in artificial intelligence...",
      "image": "data:image/jpeg;base64,..."
    }
  ],
  "pagination": {
    "api": {
      "current": "https://api.ujeebu.com/serp?search=artificial+intelligence&...",
      "next": "https://api.ujeebu.com/serp?search=artificial+intelligence&page=2&..."
    }
  }
}
5

Advanced Usage

News Monitoring Script

Python
import requests
import time

def monitor_news(keywords, interval_minutes=30):
    """Monitor news for specific keywords."""
    seen_links = set()

    while True:
        for keyword in keywords:
            response = requests.get("https://api.ujeebu.com/serp",
                headers={"ApiKey": "YOUR_API_KEY"},
                params={
                    "search": keyword,
                    "search_type": "news",
                    "extra_params": "&tbs=qdr:h",  # Past hour only
                    "results_count": 20
                })

            for article in response.json().get("news", []):
                if article["link"] not in seen_links:
                    seen_links.add(article["link"])
                    print(f"NEW: {article['title']}")
                    print(f"     {article['siteName']} - {article['date']}")

        time.sleep(interval_minutes * 60)

# Monitor multiple topics
monitor_news(["AI news", "tech startups", "cybersecurity"])
6

Best Practices

01

Use Geo-Targeting

Set location and lang parameters to get locally relevant news results.

Recommended
02

Filter by Time

Use extra_params=&tbs=qdr:h for breaking news or qdr:d for daily summaries.

Essential
03

Cache Results

Store results locally to reduce API calls and track news changes over time.

Production
04

Deduplicate

Track seen article URLs to avoid processing the same news multiple times.

Best Practice

Ready to Start Scraping?

Try the API in our interactive playground or explore the documentation.