Skip to main content

News Search API

The Google News Search API returns recent news articles related to your search query. Access this endpoint by setting search_type=news in your request.

Request Format

GET /api/google?search_type=news

Parameters

ParameterDescriptionExampleRequiredNotes
queryThe search termcaféYesMust be URL encoded
locationGeographic locationParis,Paris,Ile-de-France,FranceYesMust follow format: City,City,Region,Country
google_domainGoogle domain to usegoogle.frNoDomain name without https://www.
glGoogle country codefrNoTwo-letter country code
hlInterface languagefrNoTwo-letter language code
search_typeType of searchnewsYesMust be set to news
deviceDevice typedesktopNoOptions: desktop or mobile
pagePage number1NoRange: 1-100

Response Format

{
"news": Array<{
url: string, // URL of the news article
title: string, // Article headline
content: string, // Article snippet/description
source: string, // News source name
date: string, // Publication date/time
thumbnail: string // URL of article thumbnail image
}>,
"metadata": {
status: string, // Success/failure status
request_id: string, // Unique identifier for request
created_at: string, // Request timestamp
updated_at: string, // Response timestamp
params: { // Echo of request parameters
query: string,
location: string,
google_domain: string,
gl: string,
hl: string,
search_type: string,
page: string | null,
device: string
}
}
}

Example Request

curl -X 'GET' \
'https://app.serpextractor.com/api/google?query=café&location=Paris%2CParis%2CIle-de-France%2CFrance&google_domain=google.fr&gl=fr&hl=fr&search_type=news&device=desktop' \
-H 'accept: */*' \
-H 'X-API-Key: YOUR_API_KEY'

Response Fields

News Article Object

FieldTypeDescription
urlstringDirect link to the news article
titlestringArticle headline
contentstringBrief excerpt or description of the article
sourcestringName of the publishing organization
datestringRelative or absolute publication timestamp
thumbnailstringURL of the article's thumbnail image

Pagination

News search results support pagination:

  • Results are typically returned in batches of 10
  • Page parameter accepts values from 1-100
  • Empty results indicate end of available pages
  • News articles are sorted by date (most recent first)

Error Handling

Status CodeDescription
200Success
400Invalid parameters
401Invalid or missing API key
429Too many concurrent connections
500Server error
tip

When working with news results:

  • Regularly refresh results to get the latest news
  • Handle relative dates appropriately
  • Verify thumbnail availability before displaying, as not all news articles will have a thubnail
caution
  • News articles may become unavailable over time
  • Thumbnail URLs may expire
  • Publication dates are in the timezone of the news source
  • Article content may be truncated in the snippet