HELP CENTER

How to Retrieve Google News Results with Python Using DataForSEO SERP API

Scraping Google News yourself looks simple at first. Then the parsers start breaking every time Google releases a markup change. Proxy rotation eats up hours that should be spent on product work. And the News tab only returns a fraction of the metadata Google has on each story. Our Google News SERP API handles the data layer with a single API request. Send a keyword, get back the top 100 Google News results as structured JSON. In this guide, we’ll cover the available endpoints, the authentication flow, how to send a working Python request, and interpret the response. Besides, we’ll analyze the four most common mistakes new integrations make.

What you can get from the Google News SERP API

The Google News SERP API returns the top 100 results from the Google News search vertical for any keyword, location, and language combination. The response is structured JSON. You won’t be parsing HTML, walking XPath, or maintaining a separate parser for the News tab markup. Each news item returns the fields you’d want downstream: title, source publication, snippet, full URL, timestamp, breadcrumb, and Google’s ranking position (both grouped and absolute).

Live requests return in under 6 seconds on average. That’s fast enough to power user-facing dashboards or real-time monitoring without queuing.

Google News SERP results are desktop-only. You can pick between Windows and macOS for the OS parameter, but mobile results aren’t available through this endpoint. What you get back matches what a desktop user sees when switching to the News tab on google.com. See the full field definitions in the Google News SERP API overview docs.

Endpoints and methods to pick from

Our SERP API exposes Google News through a few endpoints. The right one depends on whether you need instant results or you’re optimizing for cost at volume.

  • Live Google News SERP. Live method, structured JSON response. One keyword per request, results in under 6 seconds. This is the default for most Python integrations.
  • Live Google News SERP HTML. Live method, raw HTML page response. Useful when you need to render the SERP yourself or inspect markup directly.
  • Google News SERP Task POST and Google News SERP Task GET Advanced. Standard (queue-based) method. You post tasks, then either poll the Tasks Ready list or set a postback_url to be notified. Priced lower per call than Live and built for batch workloads where a few minutes of latency is fine.

Live is faster and simpler to set up. Standard costs less per call and is better suited to large batches. The rest of this guide uses the Live Advanced endpoint.

Authenticate from Python

All of our APIs use HTTP Basic authentication. You sign up, grab the credentials from your dashboard, base64-encode login:password, and send the result as the Authorization header on every request. If you’d like a closer look at the credential flow, our Help Center has a step-by-step setup walkthrough with code examples in other languages.

You can authenticate from Python in two ways. The first is our official RestClient, a thin wrapper you can download from the docs. The second is calling the API directly with requests. This guide uses requests for a smaller setup with fewer moving parts.

The snippet below loads your credentials from environment variables, builds the auth header, and prepares the base URL. You’ll reuse this header on every subsequent request, so it’s worth setting up once.

import os
import base64
import requests

# Keep credentials out of source — read them from the environment instead
login = os.environ["DATAFORSEO_LOGIN"]
password = os.environ["DATAFORSEO_PASSWORD"]

# Basic auth: base64-encode "login:password" and send as the Authorization header
token = base64.b64encode(f"{login}:{password}".encode()).decode()
HEADERS = {
    "Authorization": f"Basic {token}",
    "Content-Type": "application/json",
}

BASE_URL = "https://api.dataforseo.com/v3"

With the auth header ready, you can call any endpoint our SERP API exposes, including Google News.

Send a Live request and parse the response

The Live Advanced endpoint takes a single keyword per request. You POST an array containing one task object, get back a JSON response, and walk down to tasks[0].result[0].items for the news stories.

The snippet below sends one keyword to the Live Google News SERP endpoint, checks both the top-level and per-task status codes, and prints the rank, title, source, and timestamp for each returned news item.

url = f"{BASE_URL}/serp/google/news/live/advanced"

# location_code 2840 = United States; language_code en = English
# live/advanced accepts ONE keyword per request — for multiple keywords,
# send concurrent requests or switch to the Standard task_post method
payload = [{
    "keyword": "artificial intelligence",
    "location_code": 2840,
    "language_code": "en",
    "depth": 100,
}]

resp = requests.post(url, headers=HEADERS, json=payload, timeout=30)
resp.raise_for_status()
data = resp.json()

# 20000 = "Ok." Any other code means the request itself failed
if data["status_code"] != 20000:
    raise RuntimeError(f"API error: {data['status_message']}")

# Each task in the response has its own status — branch on it before reading items
task = data["tasks"][0]
if task["status_code"] != 20000:
    raise RuntimeError(f"Task error: {task['status_message']}")

for item in task["result"][0]["items"]:
    print(item["rank_absolute"], item["title"], "—", item["source"], item["timestamp"])

Here’s the response. The top-level wrapper carries the cost, status, and task ID; result[0].items holds the news stories themselves. The repeating items in the array have been collapsed below the first one.

{
  "version": "0.1.20250601",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "5.8765 sec.",
  "cost": 0.006,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "12345678-1234-1234-1234-123456789abc",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "5.7901 sec.",
      "cost": 0.006,
      "result_count": 1,
      "path": ["v3", "serp", "google", "news", "live", "advanced"],
      "data": {
        "api": "serp",
        "function": "live",
        "se": "google",
        "se_type": "news",
        "language_code": "en",
        "location_code": 2840,
        "keyword": "artificial intelligence",
        "device": "desktop",
        "os": "windows"
      },
      "result": [
        {
          "keyword": "artificial intelligence",
          "type": "news",
          "se_domain": "google.com",
          "location_code": 2840,
          "language_code": "en",
          "check_url": "https://www.google.com/search?q=artificial+intelligence&num=100&hl=en&gl=US&tbm=nws",
          "datetime": "2026-06-12 09:14:35 +00:00",
          "items_count": 100,
          "items": [
            {
              "type": "news_search",
              "rank_group": 1,
              "rank_absolute": 1,
              "domain": "reuters.com",
              "source": "Reuters",
              "title": "AI investment trends reach new highs, industry report finds",
              "snippet": "A quarterly industry review highlights notable growth in early-stage funding...",
              "timestamp": "2026-06-12 06:42:00 +00:00",
              "url": "https://www.reuters.com/technology/ai-investment-trends/",
              "breadcrumb": "Reuters",
              "sub_links": null
            }
            // ...99 more items follow, same shape
          ]
        }
      ]
    }
  ]
}

In the items array, rank_absolute is the position you’ll most often want to store. It reflects the story’s actual placement on the SERP, not its position within a sub-group.

Parameters worth knowing for production use

Most workflows use only a few of these.

  • depth. How many news items to return per request, in increments of 10, up to 700. Default is 100. If you only need the top 20, dropping depth keeps the response payload small.
  • search_param. Passes through Google’s own search modifiers. The common one is tbs=qdr:d to restrict results to the last 24 hours, or qdr:h for the last hour.
  • target. Filters results to a single domain. Useful when you’re tracking a competitor’s news coverage or your own pickup.
  • tag. A string label our API echoes back on the response. Handy for correlating concurrent requests in logs without parsing the keyword field.
  • postback_url and pingback_url. Apply to the Standard method only. Our system POSTs the result (or a notification) to your endpoint when the task finishes, which removes the need to poll.

Common mistakes to avoid

A handful of mistakes show up over and over in early integrations:

1. Sending multi-keyword batches to a Live request. The Live Advanced endpoint accepts one keyword per request. Posting an array with multiple task objects either rejects the call or processes only the first one. To run many keywords through Live, send concurrent requests from your client. To process them as one batch, use the Google News SERP Task POST endpoint instead.
2. Treating Google News results as mobile-capable. Google News SERPs are desktop-only through our SERP API. Setting "device": "mobile" on this endpoint returns an error. If your product compares mobile and desktop coverage across other verticals, build that branching upstream so the Google News path falls back to desktop.
3. Hardcoding credentials in source code. This is easy to do during initial setup and painful once the repo lands in a shared place. Read login and password from environment variables, secrets managers, or a .env file excluded from version control, the same pattern you’d use for any other API key.
4. Not branching on the per-task status_code before reading items. The top-level status_code can be 20000 (“Ok.”) while a specific task inside tasks failed. Walking straight to tasks[0].result[0].items without checking tasks[0].status_code first means a clean-looking response will crash your parser later. Branch on both.

Wrap up

You can move from “I need Google News data in Python” to a working integration in one afternoon. Sign up, base64-encode your credentials, POST a single keyword to the Live Google News SERP endpoint, and parse the JSON response. The same setup works whether you’re feeding a media-monitoring product, an internal dashboard, or a news-tracking module inside a larger SEO tool. After the initial integration, there’s no parser maintenance to plan around.

Try for free and start sending Google News requests from your first script.

Embed DataForSeo widget on your website


Embed code:
Preview: