curl --request POST \
--url https://local-news.newscatcherapi.com/api/sources \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data '
{
"lang": [
"en",
"es"
],
"countries": [
"US",
"CA"
],
"theme": [
"Business",
"Finance"
]
}
'import requests
url = "https://local-news.newscatcherapi.com/api/sources"
payload = {
"lang": ["en", "es"],
"countries": ["US", "CA"],
"theme": ["Business", "Finance"]
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({lang: ['en', 'es'], countries: ['US', 'CA'], theme: ['Business', 'Finance']})
};
fetch('https://local-news.newscatcherapi.com/api/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://local-news.newscatcherapi.com/api/sources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lang' => [
'en',
'es'
],
'countries' => [
'US',
'CA'
],
'theme' => [
'Business',
'Finance'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-token: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://local-news.newscatcherapi.com/api/sources"
payload := strings.NewReader("{\n \"lang\": [\n \"en\",\n \"es\"\n ],\n \"countries\": [\n \"US\",\n \"CA\"\n ],\n \"theme\": [\n \"Business\",\n \"Finance\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://local-news.newscatcherapi.com/api/sources")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lang\": [\n \"en\",\n \"es\"\n ],\n \"countries\": [\n \"US\",\n \"CA\"\n ],\n \"theme\": [\n \"Business\",\n \"Finance\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://local-news.newscatcherapi.com/api/sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lang\": [\n \"en\",\n \"es\"\n ],\n \"countries\": [\n \"US\",\n \"CA\"\n ],\n \"theme\": [\n \"Business\",\n \"Finance\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"sources": [
"<string>"
],
"user_input": {
"lang": "<string>",
"countries": "<string>",
"theme": "<string>"
}
}{
"message": "Invalid JSON in request body",
"status_code": 400,
"status": "Bad request"
}{
"message": "Invalid api key: INVALID_API_KEY",
"status_code": 401,
"status": "Unauthorized"
}{
"message": "Your plan request date range cannot be greater than 400 days",
"status_code": 403,
"status": "Forbidden"
}{
"message": "Request timed out after 30 seconds",
"status_code": 408,
"status": "Request timeout"
}{
"message": "Invalid date format",
"status_code": 422,
"status": "Validation error"
}{
"message": "Max API requests concurrency reached",
"status_code": 429,
"status": "Too many requests"
}"Internal Server Error"Retrieve sources
Retrieves the list of local news sources available in the database. Filterable by language, country, and theme.
curl --request POST \
--url https://local-news.newscatcherapi.com/api/sources \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data '
{
"lang": [
"en",
"es"
],
"countries": [
"US",
"CA"
],
"theme": [
"Business",
"Finance"
]
}
'import requests
url = "https://local-news.newscatcherapi.com/api/sources"
payload = {
"lang": ["en", "es"],
"countries": ["US", "CA"],
"theme": ["Business", "Finance"]
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({lang: ['en', 'es'], countries: ['US', 'CA'], theme: ['Business', 'Finance']})
};
fetch('https://local-news.newscatcherapi.com/api/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://local-news.newscatcherapi.com/api/sources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lang' => [
'en',
'es'
],
'countries' => [
'US',
'CA'
],
'theme' => [
'Business',
'Finance'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-token: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://local-news.newscatcherapi.com/api/sources"
payload := strings.NewReader("{\n \"lang\": [\n \"en\",\n \"es\"\n ],\n \"countries\": [\n \"US\",\n \"CA\"\n ],\n \"theme\": [\n \"Business\",\n \"Finance\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://local-news.newscatcherapi.com/api/sources")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lang\": [\n \"en\",\n \"es\"\n ],\n \"countries\": [\n \"US\",\n \"CA\"\n ],\n \"theme\": [\n \"Business\",\n \"Finance\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://local-news.newscatcherapi.com/api/sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lang\": [\n \"en\",\n \"es\"\n ],\n \"countries\": [\n \"US\",\n \"CA\"\n ],\n \"theme\": [\n \"Business\",\n \"Finance\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"sources": [
"<string>"
],
"user_input": {
"lang": "<string>",
"countries": "<string>",
"theme": "<string>"
}
}{
"message": "Invalid JSON in request body",
"status_code": 400,
"status": "Bad request"
}{
"message": "Invalid api key: INVALID_API_KEY",
"status_code": 401,
"status": "Unauthorized"
}{
"message": "Your plan request date range cannot be greater than 400 days",
"status_code": 403,
"status": "Forbidden"
}{
"message": "Request timed out after 30 seconds",
"status_code": 408,
"status": "Request timeout"
}{
"message": "Invalid date format",
"status_code": 422,
"status": "Validation error"
}{
"message": "Max API requests concurrency reached",
"status_code": 429,
"status": "Too many requests"
}"Internal Server Error"Authorizations
Body
The language(s) of the search. The only accepted format is the two-letter ISO 639-1 code. To select multiple languages, use a comma-separated string or an array of strings.
To learn more, see Enumerated parameters > Language.
["en", "es"]
The countries where the news publisher is located. The accepted format is the two-letter ISO 3166-1 alpha-2 code. To select multiple countries, use a comma-separated string or an array of strings.
To learn more, see Enumerated parameters > Country.
["US", "CA"]
Filters articles based on their general topic, as determined by NLP analysis. To select multiple themes, use a comma-separated string or an array of strings.
To learn more, see NLP Enrichments.
Available options: Business, Economics, Entertainment, Finance, Health, Politics, Science, Sports, Tech, Crime, Financial Crime, Lifestyle, Automotive, Travel, Weather, General.
["Business", "Finance"]
Response
Successful response containing the list of sources
The response model for the Sources request.
Response field behavior:
- Required fields are guaranteed to be present and non-null.
- Optional fields may be
null/undefinedif the data couldn't be extracted during processing.
Was this page helpful?

