Get news sentiment for a symbol
curl --request GET \
--url https://api.example.com/api/graph/v1/news/sentiment/{symbol}import requests
url = "https://api.example.com/api/graph/v1/news/sentiment/{symbol}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/graph/v1/news/sentiment/{symbol}', 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://api.example.com/api/graph/v1/news/sentiment/{symbol}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/api/graph/v1/news/sentiment/{symbol}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/graph/v1/news/sentiment/{symbol}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/news/sentiment/{symbol}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"symbol": "<string>",
"source": "<string>",
"sentiment_score": 123,
"sentiment_label": "<string>",
"articles_analyzed": 123,
"top_headlines": [
"<string>"
],
"fetched_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}News
Get news sentiment for a symbol
Get aggregated news sentiment for a stock symbol.
Data Sources
- Database Cache: Returns cached sentiment if available and fresh
- FMP API: Fetches from Financial Modeling Prep if cache is stale
Response Fields
- sentiment_score: 0-100 (0=bearish, 50=neutral, 100=bullish)
- sentiment_label: Human-readable classification
- articles_analyzed: Number of relevant articles in the analysis
- top_headlines: Most relevant headlines
Cache Behavior
- Cache TTL: 1 hour (configurable via FMP_CACHE_TTL)
- Use
refresh=trueto bypass cache and fetch fresh data
GET
/
api
/
graph
/
v1
/
news
/
sentiment
/
{symbol}
Get news sentiment for a symbol
curl --request GET \
--url https://api.example.com/api/graph/v1/news/sentiment/{symbol}import requests
url = "https://api.example.com/api/graph/v1/news/sentiment/{symbol}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/graph/v1/news/sentiment/{symbol}', 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://api.example.com/api/graph/v1/news/sentiment/{symbol}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.example.com/api/graph/v1/news/sentiment/{symbol}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/graph/v1/news/sentiment/{symbol}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/news/sentiment/{symbol}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"symbol": "<string>",
"source": "<string>",
"sentiment_score": 123,
"sentiment_label": "<string>",
"articles_analyzed": 123,
"top_headlines": [
"<string>"
],
"fetched_at": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Path Parameters
Query Parameters
Force refresh from API (bypasses cache)
Response
Successful Response
News sentiment data for a symbol.
Stock ticker symbol
Data source (fmp, database_cache)
Sentiment score 0-100 (0=bearish, 50=neutral, 100=bullish)
Sentiment classification (Bullish, Bearish, Neutral, etc.)
Number of articles analyzed
Top relevant headlines
ISO timestamp of data fetch