The outlets we actively serve
curl --request GET \
--url https://clair-news-api.p.rapidapi.com/v1/sources \
--header 'X-RapidAPI-Key: <api-key>'import requests
url = "https://clair-news-api.p.rapidapi.com/v1/sources"
headers = {"X-RapidAPI-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-RapidAPI-Key': '<api-key>'}};
fetch('https://clair-news-api.p.rapidapi.com/v1/sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://clair-news-api.p.rapidapi.com/v1/sources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-RapidAPI-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://clair-news-api.p.rapidapi.com/v1/sources"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-RapidAPI-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://clair-news-api.p.rapidapi.com/v1/sources")
.header("X-RapidAPI-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://clair-news-api.p.rapidapi.com/v1/sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-RapidAPI-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 38,
"items": [
"ABC News",
"BBC World News",
"Bloomberg - Markets",
"Financial Times",
"Reuters"
]
}{
"error": "too_many_matches",
"message": "<string>",
"matched_at_least": 123
}{
"error": "too_many_matches",
"message": "<string>",
"matched_at_least": 123
}Endpoints
List sources
The news outlets Clair actively serves, by name: the valid values for the sources and exclude_sources filters.
GET
/
v1
/
sources
The outlets we actively serve
curl --request GET \
--url https://clair-news-api.p.rapidapi.com/v1/sources \
--header 'X-RapidAPI-Key: <api-key>'import requests
url = "https://clair-news-api.p.rapidapi.com/v1/sources"
headers = {"X-RapidAPI-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-RapidAPI-Key': '<api-key>'}};
fetch('https://clair-news-api.p.rapidapi.com/v1/sources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://clair-news-api.p.rapidapi.com/v1/sources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-RapidAPI-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://clair-news-api.p.rapidapi.com/v1/sources"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-RapidAPI-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://clair-news-api.p.rapidapi.com/v1/sources")
.header("X-RapidAPI-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://clair-news-api.p.rapidapi.com/v1/sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-RapidAPI-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 38,
"items": [
"ABC News",
"BBC World News",
"Bloomberg - Markets",
"Financial Times",
"Reuters"
]
}{
"error": "too_many_matches",
"message": "<string>",
"matched_at_least": 123
}{
"error": "too_many_matches",
"message": "<string>",
"matched_at_least": 123
}Authorizations
Your RapidAPI key. Also send X-RapidAPI-Host with the value shown on the Clair RapidAPI page.
Response
The active source names, alphabetically.
⌘I