The Google News Scraper is a cutting-edge tool designed to extract and organize news content from Google News. This powerful scraper offers an efficient method to collect news articles, headlines, and associated information from numerous sources worldwide, providing valuable insights for various industries and applications.
Data Point | Description | Example |
---|---|---|
URL | Web address of the article | https://www.fourfourtwo.com/news/manchester-united-in-talks-over-sensational-deal-for-england-man-report |
Title | Headline of the news article | Manchester United in talks over sensational deal for England man: report |
Publisher | Source of the news article | FourFourTwo |
Date | Publication date and time | 2024-08-28T11:30:17.000Z |
Category | News category | Top News |
Keyword | Main topic or focus of the article | Premier league |
Country | Country of publication | GB |
The Google News Scraper is a valuable asset for various sectors, including:
The Google News Scraper API allows you to extract news articles and information from Google News. This powerful tool enables developers to integrate Google News content into their applications, conduct news analysis, or monitor current events and trends across various sources aggregated by Google News.
To use the Google News Scraper API, you'll need to authenticate your requests using your API key. The API provides an endpoint for retrieving news information:
Include your API key in the request headers:
Authorization: Bearer YOUR_API_KEY
The request body should be a JSON object with the following structure:
{
"url": "https://news.google.com/articles/[article-id]"
}
Please note that usage is subject to rate limiting. Refer to your plan details for specific limits.
While we don't have a specific sample response, you can generally expect the API to return data including:
The exact structure and fields may vary based on the information available for each article.
import requests
import json
# Your API Key
api_key = 'YOUR_API_KEY'
# API Endpoint
url = 'https://taskagi.net/api/news/google-news-scraper/articles'
# Headers
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
# Request Body
data = {
'url': 'https://news.google.com/articles/CBMiT2h0dHBzOi8vd3d3LmV4YW1wbGUuY29tL25ld3MvMjAyNC8wNy8wOC9zYW1wbGUtZ29vZ2xlLW5ld3MtYXJ0aWNsZS11cmwtaGVyZdIBAA'
}
# Send POST request
response = requests.post(url, headers=headers, json=data)
# Check if the request was successful
if response.status_code == 200:
# Parse the JSON response
article_data = response.json()
# Print the article information
print(json.dumps(article_data, indent=2))
else:
print(f"Error: {response.status_code}")
print(response.text)