News Search
Discover the latest stories with our News Search API. Provide a query, and our algorithm fetches real-time news articles and updates from various trusted sources.
cURL 'https://api.enrich.so/v1/api/search-news-on-google?query=Oscars&page_size=5&page=1' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json'
const axios = require('axios');
axios.get('https://api.enrich.so/v1/api/search-news-on-google?query=Oscars&page_size=5&page=1', {
headers: {accept: 'application/json', Authorization: 'Bearer <token>'}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.log(error);
});// Some code
import requests
payload = {'query': 'Oscars', 'page_size': 5, 'page': 1}
headers = {'accept': 'application/json', 'authorization': 'Bearer <token>'}
resp = requests.get('https://api.enrich.so/v1/api/search-news-on-google', params=payload, headers=headers)
print (resp.text)
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://api.enrich.so/v1/api/search-news-on-google?query=Oscars&page_size=5&page=1")
.get()
.addHeader("accept", "application/json")
.addHeader("authorization", "Bearer <token>")
.build();
Response response = client.newCall(request).execute();
require 'uri'
require 'net/http'
url = URI("https://api.enrich.so/v1/api/search-news-on-google?query=Oscars&page_size=5&page=1")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.enrich.so/v1/api/search-news-on-google?query=Oscars&page_size=5&page=1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"accept: application/json",
"authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
Example response
Status Code: 200 OK
{
"success": true,
"message": "Search successfully executed.",
"data": {
"request_parameters": {
"query": "\"Technology\"",
"type": "articles",
"page_size": 5,
"current_page": 2,
"engine": "bing"
},
"result": [
{
"title": "Breakthrough in Quantum Computing Achieved by MIT Researchers",
"link": "https://www.sciencenews.org/2024/12/17/mit-quantum-computing-breakthrough",
"snippet": "MIT researchers unveiled a new quantum algorithm that promises exponential speed-ups for complex computations...",
"date": "5 hours ago",
"source": "Science News",
"imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTcC_FJG3qvytcPHGlqOUa5DUkXeQctzEoQhg&usqp=CAU",
"position": 1
},
{
"title": "Tech Giants Collaborate on AI Ethics Guidelines",
"link": "https://www.techworld.com/article/ai-ethics-guidelines.html",
"snippet": "Microsoft, Google, and OpenAI are partnering to create comprehensive guidelines for the ethical development and deployment of AI systems...",
"date": "6 hours ago",
"source": "TechWorld",
"imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTl-FvcBdEzi6g42kOtsKG3DQaHShUwOxZOFA&usqp=CAU",
"position": 2
},
{
"title": "Elon Musk Announces Mars Mission Timeline Update",
"link": "https://www.spaceupdates.com/mars-mission-elon-musk",
"snippet": "SpaceX has moved up the timeline for its first crewed Mars mission, aiming to launch in 2026, two years earlier than initially planned...",
"date": "3 hours ago",
"source": "Space Updates",
"imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ4o1MU7JKVFC65I9hv0m3q1bM8O0Huoa95xw&usqp=CAU",
"position": 3
},
{
"title": "Breakthrough in Renewable Energy Storage Solutions",
"link": "https://www.greenenergynews.com/renewable-storage-breakthrough",
"snippet": "A new battery technology capable of storing renewable energy for weeks is being hailed as a game-changer...",
"date": "4 hours ago",
"source": "Green Energy News",
"imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTc2z0CTwqYZKoFHnGvmzvomNsEUst59lrOpp1Fu3IgY9sqNq_XCaf5ohHUTw&s",
"position": 4
},
{
"title": "Startups Drive Innovation in Electric Vehicle Charging",
"link": "https://www.evnews.com/startups-ev-charging-innovation",
"snippet": "Several startups are introducing novel solutions for fast and efficient electric vehicle charging, attracting significant venture capital...",
"date": "2 hours ago",
"source": "EV News",
"imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQvbyLUsEDsxsqjGKf4KTXnhAJ7wh2r7KDzImD5xidfcnm0j5Ixw-upuNElgQ&s",
"position": 5
}
]
},
"total_credits": 200,
"credits_used": 50.5,
"credits_remaining": 149.5
}
Status code: 404 NOT FOUND
{
"message": "We couldn't find results for your query"
}
Last updated