Analyst Ratings API
Retrieve Wall Street analyst ratings, price targets, and recommendation changes. Get consensus ratings and track upgrades/downgrades.
Endpoint
Section titled “Endpoint”GET /v2/analyst-ratings/{symbol}Authentication
Section titled “Authentication”Authenticate using one of the following methods (in order of recommendation):
| Method | Example |
|---|---|
| Bearer token (recommended) | Authorization: Bearer YOUR_API_KEY |
| X-API-Key header | X-API-Key: YOUR_API_KEY |
| Query parameter | ?apiKey=YOUR_API_KEY |
| Legacy query parameter | ?token=YOUR_API_KEY |
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | Yes | Stock ticker symbol (e.g., AAPL, MSFT) |
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
startDate | string | No | Start date (YYYY-MM-DD) |
endDate | string | No | End date (YYYY-MM-DD) |
limit | integer | No | Maximum number of results to return |
Request
Section titled “Request”from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
df = fb.analyst_ratings.ticker("AAPL", date_from="2025-01-01", date_to="2025-06-30", as_dataframe=True)print(df)curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.finbrain.tech/v2/analyst-ratings/AAPL"import requests
url = "https://api.finbrain.tech/v2/analyst-ratings/AAPL"headers = {"Authorization": "Bearer YOUR_API_KEY"}params = {"startDate": "2026-01-01", "endDate": "2026-01-31"}
response = requests.get(url, headers=headers, params=params)data = response.json()
for r in data["data"]["ratings"]: print(f"{r['date']} - {r['institution']}: {r['rating']} (Target: {r['targetPrice']})")#include <iostream>#include <string>#include <curl/curl.h>#include <nlohmann/json.hpp>
using json = nlohmann::json;
size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* userp) { userp->append((char*)contents, size * nmemb); return size * nmemb;}
json get_analyst_ratings(const std::string& symbol, const std::string& api_key) { CURL* curl = curl_easy_init(); std::string response;
if (curl) { std::string url = "https://api.finbrain.tech/v2/analyst-ratings/" + symbol;
struct curl_slist* headers = nullptr; std::string auth_header = "Authorization: Bearer " + api_key; headers = curl_slist_append(headers, auth_header.c_str());
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response); curl_easy_perform(curl); curl_slist_free_all(headers); curl_easy_cleanup(curl); }
return json::parse(response);}
int main() { auto result = get_analyst_ratings("AAPL", "YOUR_API_KEY");
for (auto& r : result["data"]["ratings"]) { std::string target = r["targetPrice"].is_null() ? "N/A" : r["targetPrice"].get<std::string>(); std::cout << r["date"].get<std::string>() << " - " << r["institution"].get<std::string>() << ": " << r["rating"].get<std::string>() << " (Target: " << target << ")" << std::endl; }
return 0;}use reqwest::blocking::Client;use serde::Deserialize;use std::error::Error;
#[derive(Debug, Deserialize)]struct AnalystRating { date: String, institution: String, action: String, rating: String, #[serde(rename = "targetPrice")] target_price: Option<String>,}
#[derive(Debug, Deserialize)]struct RatingsData { symbol: String, name: String, ratings: Vec<AnalystRating>,}
#[derive(Debug, Deserialize)]struct Meta { timestamp: String,}
#[derive(Debug, Deserialize)]struct AnalystRatingsResponse { success: bool, data: RatingsData, meta: Meta,}
fn get_analyst_ratings(symbol: &str, api_key: &str) -> Result<AnalystRatingsResponse, Box<dyn Error>> { let url = format!( "https://api.finbrain.tech/v2/analyst-ratings/{}", symbol );
let client = Client::new(); let response: AnalystRatingsResponse = client .get(&url) .bearer_auth(api_key) .send()? .json()?;
Ok(response)}
fn main() -> Result<(), Box<dyn Error>> { let result = get_analyst_ratings("AAPL", "YOUR_API_KEY")?;
for r in &result.data.ratings { let target = r.target_price.as_deref().unwrap_or("N/A"); println!("{} - {}: {} (Target: {})", r.date, r.institution, r.rating, target); }
Ok(())}const response = await fetch( "https://api.finbrain.tech/v2/analyst-ratings/AAPL", { headers: { "Authorization": "Bearer YOUR_API_KEY" } });const { data } = await response.json();
data.ratings.forEach(r => { console.log(`${r.date} - ${r.institution}: ${r.rating} (Target: ${r.targetPrice})`);});Response
Section titled “Response”Success Response (200 OK)
Section titled “Success Response (200 OK)”{ "success": true, "data": { "symbol": "AAPL", "name": "Apple Inc.", "ratings": [ { "date": "2026-01-09", "institution": "Evercore ISI", "action": "Reiterated", "rating": "Outperform", "targetPrice": "$275" }, { "date": "2026-01-02", "institution": "Raymond James", "action": "Resumed", "rating": "Mkt Perform", "targetPrice": null } ] }, "meta": { "timestamp": "2026-01-19T15:06:13.918Z" }}Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
success | boolean | Whether the request succeeded |
data.symbol | string | Stock ticker symbol |
data.name | string | Company name |
data.ratings | array | Array of analyst ratings |
meta.timestamp | string | Response timestamp (ISO 8601) |
Rating Object Fields
Section titled “Rating Object Fields”| Field | Type | Description |
|---|---|---|
date | string | Rating date (YYYY-MM-DD) |
institution | string | Research firm name |
action | string | Type of action (Reiterated, Resumed, Upgrade, Downgrade, Initiated) |
rating | string | Analyst rating (Outperform, Mkt Perform, Buy, Sell, Hold, etc.) |
targetPrice | string or null | Price target (e.g., “$275”) or null if not provided |
Rating Categories
Section titled “Rating Categories”| Rating | Signal |
|---|---|
| Strong Buy | Very Bullish |
| Buy / Outperform | Bullish |
| Hold / Neutral / Mkt Perform | Neutral |
| Underperform | Bearish |
| Sell | Very Bearish |
Errors
Section titled “Errors”| Code | Error | Description |
|---|---|---|
| 400 | Bad Request | Invalid symbol or parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Authenticated, but not authorized to access this resource |
| 404 | Not Found | Symbol not found |
| 429 | Too Many Requests | Rate limit exceeded — wait and retry |
| 500 | Internal Server Error | Server-side error |
Related
Section titled “Related”- Analyst Ratings Dataset - Use cases and analysis examples
- Sentiments - News sentiment data
- Ticker Predictions - AI predictions
- Put/Call Data - Options market data