List sources
Every publisher and wire service in the feed, with 30-day volume.
GEThttps://api.marketnewsapi.com/v1/sources
Use the returned domain values with the sources and exclude_sources filters.
Requires an API key. See authentication.
Query parameters
|
categorystring
Only sources that published in this category.
stocks
|
|
typestring
Only sources of this article type.
newspress_releaselegal
|
Example request
curl "https://api.marketnewsapi.com/v1/sources?category=stocks" \
-H "Authorization: Bearer $MARKETNEWSAPI_KEY"import json
import os
import requests
resp = requests.get(
"https://api.marketnewsapi.com/v1/sources",
params={"category": "stocks"},
headers={"Authorization": f"Bearer {os.environ['MARKETNEWSAPI_KEY']}"},
timeout=10,
)
resp.raise_for_status()
print(json.dumps(resp.json(), indent=2))const params = new URLSearchParams({ category: "stocks" });
const res = await fetch(`https://api.marketnewsapi.com/v1/sources?${params}`, {
headers: { Authorization: `Bearer ${process.env.MARKETNEWSAPI_KEY}` },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.marketnewsapi.com/v1/sources?category=stocks", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("MARKETNEWSAPI_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$query = http_build_query(['category' => 'stocks']);
$ch = curl_init("https://api.marketnewsapi.com/v1/sources?$query");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('MARKETNEWSAPI_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($body);require "json"
require "net/http"
uri = URI("https://api.marketnewsapi.com/v1/sources")
uri.query = URI.encode_www_form(category: "stocks")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch('MARKETNEWSAPI_KEY')}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
puts JSON.pretty_generate(JSON.parse(res.body))using System.Net.Http.Headers;
using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
"Bearer", Environment.GetEnvironmentVariable("MARKETNEWSAPI_KEY"));
var json = await http.GetStringAsync("https://api.marketnewsapi.com/v1/sources?category=stocks");
Console.WriteLine(json);import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.marketnewsapi.com/v1/sources?category=stocks"))
.header("Authorization", "Bearer " + System.getenv("MARKETNEWSAPI_KEY"))
.build();
HttpResponse<String> res = HttpClient.newHttpClient()
.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
}
}Example response
200 OK
{
"data": [
{
"name": "GlobeNewswire",
"domain": "globenewswire.com",
"categories": [
"stocks"
],
"types": [
"press_release"
],
"articles_30d": 18432
},
{
"name": "Business Wire",
"domain": "businesswire.com",
"categories": [
"stocks"
],
"types": [
"press_release"
],
"articles_30d": 15207
},
{
"name": "Example Publisher",
"domain": "example-publisher.com",
"categories": [
"stocks"
],
"types": [
"news"
],
"articles_30d": 2310
}
],
"meta": {
"count": 3
}
}Try it
GET
https://api.marketnewsapi.com/v1/sourcesResponse
Press Send to call the live API with your key. No key yet? Get one free.Errors
This endpoint returns the standard error format. The most common errors are 400 invalid_parameter, 401 invalid_api_key and 429 daily_limit_reached (Free plan).