Google News
Search Google News to retrieve news articles from thousands of sources in JSON format.
Endpoint
GET /v1/news/{query}
Description
The Google News Search endpoint allows you to search for news articles from Google News. The query parameter should be a URL-encoded query string. News can be filtered by country and language using the ceid parameter.
By default each entry's link is Google's own redirect (https://news.google.com/rss/articles/...), which is how Google News publishes its feed. Set resolve_links=true to have Serply follow those redirects for you and return the publisher's URL instead.
Authentication
All requests require authentication using the X-Api-Key header. See the Authentication guide for more details.
Path Parameters
query (required)
Type: string
A URL-encoded query string for Google News search. You can use simple queries or include country/language filters.
Examples:
- Simple query:
q=president - Multiple keywords:
q=news+about+president+trump - Filtered by country and language:
- US news in English:
q=trump&ceid=US:en - Great Britain news in English:
q=trump&ceid=GB:en
- US news in English:
Query Parameters
resolve_links (optional)
Type: boolean
Default: false
When true, every entry's link is rewritten from the news.google.com/rss/articles/... redirect to the article's real URL on the publisher's site. The original redirect is kept as google_link, each entry gets a link_resolved boolean, and the response gains a links_resolved count. Links inside links[], sub_articles[] and the summary HTML are rewritten as well.
Resolution needs one extra fetch per article, done in parallel on Serply's servers, so expect the request to take roughly 2 to 3 seconds longer. Any link that cannot be resolved is returned unchanged with link_resolved: false.
The flag is an ordinary query parameter, sent alongside the other news parameters:
GET /v1/news/?q=tesla&resolve_links=true
GET /v1/news/?q=tesla&ceid=US:en&resolve_links=true
Request Headers
X-Proxy-Location (optional)
Type: string
Specify the proxy location for the search. Available options:
EU- European UnionCA- CanadaUS- United StatesIE- IrelandGB- United KingdomFR- FranceDE- GermanySE- SwedenIN- IndiaJP- JapanKR- South KoreaSG- SingaporeAU- AustraliaBR- Brazil
X-User-Agent (optional)
Type: string
Specify the user agent type. Available options:
desktop- Desktop user agent (default)mobile- Mobile user agent
Request Example
Using cURL
curl --request GET \
--url 'https://api.serply.io/v1/news/?q=stock+market' \
--header 'X-Api-Key: YOUR_API_KEY'
With publisher URLs instead of Google redirects:
curl --request GET \
--url 'https://api.serply.io/v1/news/?q=stock+market&resolve_links=true' \
--header 'X-Api-Key: YOUR_API_KEY'
Using JavaScript/Node.js
const response = await fetch('https://api.serply.io/v1/news/?q=stock+market', {
headers: {
'X-Api-Key': 'YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data);
Using Python
import requests
headers = {
'X-Api-Key': 'YOUR_API_KEY'
}
response = requests.get(
'https://api.serply.io/v1/news/?q=stock+market',
headers=headers
)
data = response.json()
print(data)
Response
The API returns a JSON object containing a feed object with news feed metadata and an entries array of news articles.
Response Structure
{
"feed": {
"title": "News Feed Title",
"generator": "Google News",
"generator_detail": {},
"link": "https://news.google.com/...",
"links": {},
"language": "en",
"publisher": "Google News",
"publisher_detail": "...",
"rights": "...",
"rights_detail": "...",
"updated": "2024-01-01T00:00:00Z",
"updated_parsed": "...",
"subtitle": "...",
"subtitle_detail": "...",
"entries": [
{
"title": "Article Title",
"title_detail": {},
"links": [{"href": "https://news.google.com/rss/articles/CBMi..."}],
"link": "https://news.google.com/rss/articles/CBMi...",
"id": "article-id",
"guidislink": false,
"published": "2024-01-01T00:00:00Z",
"published_parsed": "...",
"summary": "Article summary...",
"summary_detail": {},
"source": "Source Name",
"sub_articles": "..."
}
]
},
"entities": [
{
"title": "Article Title",
"links": []
}
]
}
Response Fields
feed(object): News feed metadata and entriestitle(string): Feed titlegenerator(string): Feed generator namelink(string): Feed URLlanguage(string): Feed languagepublisher(string): Publisher nameupdated(string): Last update timestampentries(array): Array of news article objectstitle(string): Article titlelink(string): Article URL. Anews.google.com/rss/articles/...redirect by default; the publisher's URL whenresolve_links=truegoogle_link(string): The original Google redirect. Only present whenresolve_links=truelink_resolved(boolean): Whetherlinkwas rewritten to the publisher's URL. Only present whenresolve_links=truesummary(string): Article summary/descriptionpublished(string): Publication datesource(string): News source name
links_resolved(integer): How many entries were rewritten to publisher URLs. Only present whenresolve_links=trueentities(array): Array of entity objects with titles and links
Example Response
{
"feed": {
"title": "stock market - Google News",
"generator": "Google News",
"link": "https://news.google.com/rss/search?q=stock+market",
"language": "en",
"publisher": "Google News",
"updated": "2024-01-15T12:00:00Z",
"entries": [
{
"title": "Stock Market Reaches New High - Financial Times",
"link": "https://news.google.com/rss/articles/CBMi...?oc=5",
"summary": "<a href=\"https://news.google.com/rss/articles/CBMi...\">Stock Market Reaches New High</a> <font color=\"#6f6f6f\">Financial Times</font>",
"published": "Mon, 15 Jan 2024 10:00:00 GMT",
"source": {"href": "https://www.ft.com", "title": "Financial Times"}
}
]
},
"entities": [
{
"title": "Stock Market Reaches New High",
"links": []
}
]
}
Example Response with resolve_links=true
{
"feed": { "title": "stock market - Google News", "...": "..." },
"entries": [
{
"title": "Stock Market Reaches New High - Financial Times",
"link": "https://www.ft.com/content/stock-market-reaches-new-high",
"google_link": "https://news.google.com/rss/articles/CBMi...?oc=5",
"link_resolved": true,
"published": "Mon, 15 Jan 2024 10:00:00 GMT",
"source": {"href": "https://www.ft.com", "title": "Financial Times"}
}
],
"links_resolved": 1
}
Status Codes
- 200 OK - Successful response
- 404 Not Found - The requested resource was not found
- 422 Unprocessable Entity - The request was well-formed but contains semantic errors
- 429 Too Many Requests - Rate limit exceeded
Error Responses
See the Errors guide for information on error response formats.