Trending symbols
The stock tickers with the most coverage right now.
GEThttps://api.marketnewsapi.com/v1/trending
Ranks symbols by article count in the chosen window. Great for a "most talked about" widget, a screener input, or detecting unusual news volume.
Requires an API key. See authentication.
Query parameters
|
windowstring
Look-back window. Default:
24h.1h24h7d
|
|
kindstring
Stock tickers. Default:
ticker.ticker
|
|
categorystring
Only count articles in this category.
stocks
|
|
limitinteger
Number of symbols, 1–50. Default:
20. |
Example request
curl "https://api.marketnewsapi.com/v1/trending?window=24h&limit=10" \
-H "Authorization: Bearer $MARKETNEWSAPI_KEY"import json
import os
import requests
resp = requests.get(
"https://api.marketnewsapi.com/v1/trending",
params={"window": "24h", "limit": 10},
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({ window: "24h", limit: "10" });
const res = await fetch(`https://api.marketnewsapi.com/v1/trending?${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/trending?window=24h&limit=10", 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(['window' => '24h', 'limit' => 10]);
$ch = curl_init("https://api.marketnewsapi.com/v1/trending?$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/trending")
uri.query = URI.encode_www_form(window: "24h", limit: 10)
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/trending?window=24h&limit=10");
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/trending?window=24h&limit=10"))
.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": [
{
"symbol": "NVDA",
"kind": "ticker",
"articles": 142
},
{
"symbol": "AAPL",
"kind": "ticker",
"articles": 118
},
{
"symbol": "TSLA",
"kind": "ticker",
"articles": 97
}
],
"meta": {
"window": "24h",
"category": null
}
}Try it
GET
https://api.marketnewsapi.com/v1/trendingResponse
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).