Skip to content

Recent Activity API

Recent endpoints return the latest data entries sorted by date across all tracked stocks. Use these endpoints to stay on top of breaking news and fresh analyst actions without querying tickers individually.

Supports multiple authentication methods (in order of preference):

MethodExample
Bearer token (recommended)Authorization: Bearer YOUR_API_KEY
X-API-Key headerX-API-Key: YOUR_API_KEY
Query parameter?apiKey=YOUR_API_KEY
Legacy query parameter?token=YOUR_API_KEY
EndpointDescription
GET /v2/recent/newsMost recent news articles
GET /v2/recent/analyst-ratingsMost recent analyst ratings
ParameterTypeRequiredDescription
apiKeystringNoYour API key (if not using header auth)
limitintegerNoNumber of results to return (1-20,000, default 100)
marketstringNoFilter by market name (e.g., NASDAQ, S&P 500)
regionstringNoFilter by region code (e.g., US, UK)
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
# Recent news
df = fb.recent.news(limit=20, as_dataframe=True)
print(df)
# Recent analyst ratings
df = fb.recent.analyst_ratings(limit=10, as_dataframe=True)
print(df)
Terminal window
# Get 100 most recent analyst ratings (default)
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.finbrain.tech/v2/recent/analyst-ratings"
# Filter by region
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.finbrain.tech/v2/recent/analyst-ratings?region=US&limit=200"
{
"success": true,
"data": {
"data": [
{
"symbol": "VRT",
"name": "Vertiv Holdings Co",
"date": "2026-01-19",
"headline": "Amazon, Carvana And Others: Bank Of America Reveals 5 Stocks",
"source": "Benzinga",
"url": "https://www.benzinga.com/news/280015",
"sentiment": 0.6705
}
],
"summary": {
"totalArticles": 100,
"totalTickers": 87,
"averageSentiment": 0.42
}
},
"meta": { "timestamp": "2026-01-19T15:23:13.813Z" }
}
FieldTypeDescription
symbolstringStock ticker symbol
namestringCompany name
datestringArticle date (YYYY-MM-DD)
headlinestringNews article headline
sourcestringNews source (e.g., Benzinga, Reuters)
urlstringLink to the original article
sentimentnumberSentiment score from -1 (bearish) to 1 (bullish)
FieldTypeDescription
totalArticlesintegerTotal number of articles returned
totalTickersintegerNumber of unique tickers mentioned
averageSentimentnumberAverage sentiment across all articles
{
"success": true,
"data": {
"data": [
{
"symbol": "AFYA",
"name": "Afya Ltd",
"date": "2026-01-16",
"institution": "UBS",
"action": "Downgrade",
"rating": "Buy → Neutral",
"targetPrice": "$16"
}
],
"summary": {
"totalRatings": 100,
"totalTickers": 95,
"upgradeCount": 18,
"downgradeCount": 12
}
},
"meta": { "timestamp": "2026-01-19T15:23:11.771Z" }
}
FieldTypeDescription
symbolstringStock ticker symbol
namestringCompany name
datestringRating date (YYYY-MM-DD)
institutionstringAnalyst firm (e.g., UBS, Goldman Sachs)
actionstringRating action (e.g., Upgrade, Downgrade, Initiate, Reiterate)
ratingstringRating change (e.g., “Buy to Neutral”)
targetPricestringPrice target set by the analyst
FieldTypeDescription
totalRatingsintegerTotal number of ratings returned
totalTickersintegerNumber of unique tickers with ratings
upgradeCountintegerNumber of upgrades
downgradeCountintegerNumber of downgrades
import requests
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get(
"https://api.finbrain.tech/v2/recent/news",
headers=headers,
params={"limit": 500}
)
result = response.json()
# Group articles by ticker
from collections import defaultdict
by_ticker = defaultdict(list)
for article in result["data"]["data"]:
by_ticker[article["symbol"]].append(article)
# Find tickers with the most news activity
print("Most mentioned tickers:")
for symbol, articles in sorted(by_ticker.items(), key=lambda x: -len(x[1]))[:10]:
avg_sentiment = sum(a["sentiment"] for a in articles) / len(articles)
print(f" {symbol:>6}: {len(articles)} articles, avg sentiment {avg_sentiment:.3f}")
import requests
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get(
"https://api.finbrain.tech/v2/recent/analyst-ratings",
headers=headers,
params={"limit": 500}
)
result = response.json()
upgrades = [r for r in result["data"]["data"] if r["action"] == "Upgrade"]
downgrades = [r for r in result["data"]["data"] if r["action"] == "Downgrade"]
print(f"Recent Upgrades ({len(upgrades)}):")
for r in upgrades[:5]:
print(f" {r['symbol']:>6} - {r['institution']}: {r['rating']} (Target: {r['targetPrice']})")
print(f"\nRecent Downgrades ({len(downgrades)}):")
for r in downgrades[:5]:
print(f" {r['symbol']:>6} - {r['institution']}: {r['rating']} (Target: {r['targetPrice']})")
CodeErrorDescription
400Bad RequestInvalid parameters
401UnauthorizedInvalid or missing API key
404Not FoundEndpoint not found
500Internal Server ErrorServer-side error