Analyst Ratings API
The Analyst Ratings API returns Wall Street analyst ratings and price targets for US-listed stocks as JSON: every upgrade, downgrade, initiation, reiteration and price target change, with the research firm, the rating and price target before and after, and the date. It covers over 3,500 stocks and over 130 research firms, and new analyst actions are added every 15 minutes.
/v1/pricetarget returns the current picture for a stock: the consensus price target (average, median, high and low), the number of buy, hold and sell ratings, a consensus rating, and each firm's latest rating and price target.
Available on paid plans, with analyst actions from the last 12 months. The full history is available on Business tier and above.
Use it to show analyst ratings and price targets in an investing app, screen for upgrades and downgrades, get alerted to price target changes, or test how stocks move after analyst actions.
From 6,781 users
Application used this API in the last 28 days.
API Status
Didn't find what you were looking for? Suggest an improvement
Premium only
https://api.api-ninjas.com/v1/analystratings
Returns analyst ratings and price target changes for a stock, newest first: every initiation, upgrade, downgrade, reiteration and price target change, with the research firm and the rating and price target before and after. Or pass a date to list every analyst action on that day. Each action is one of: initiated (the firm starts covering the stock), upgrade or downgrade (it raises or lowers its rating, e.g. from Hold to Buy), target_raised or target_lowered (it raises or lowers its price target and keeps its rating), target_set (it states a price target without saying whether it changed), reiterated (it repeats its rating, and its price target if it has one), assumed (a new analyst at the firm takes over coverage), resumed (coverage resumes after a pause), reinstated (the firm reinstates its rating after a pause, e.g. after advising on a deal) or rating_change (a new rating that is neither higher nor lower, e.g. on a new rating scale).
Parameters
Either ticker or date is required.
tickeroptionalStock ticker, e.g.
AAPL.Write the symbol the way you normally would. Share classes work as
BRK.B,BRK-B,BRK/BorBRKB, and preferred shares asBAC.PRL,BAC-PLorBAC^L.- Share classes:
BRK.B,BRK/B,BRK B,BRKB→BRK-B - Preferred shares:
BAC.PRL,BAC PR L,BAC^L,BACpL→BAC-PL - Warrants:
BKKT.WS,BKKT+,BKKT/WS→BKKT-WT - Units:
AAC.U,AAC=,AAC/U→AAC-UN - US exchange prefix:
NYSE:BRK.B→BRK-B - Lower case or a $ prefix:
brk.b,$BRK.B→BRK-B
- Share classes:
dateoptionalA single date (YYYY-MM-DD). Returns every analyst action on that day, for every stock or, with
ticker, for one stock.start_dateoptionalEarliest date (YYYY-MM-DD), inclusive. Paid plans include the last 12 months; the full history is available on Business tier and above.
end_dateoptionalLatest date (YYYY-MM-DD), inclusive.
firmoptionalResearch firm name, e.g.
Morgan StanleyorGoldman. Common spellings of a firm match, e.g.BofAandBank of America.actionoptionalOne action, e.g.
upgradeortarget_raised. The actions are listed in the endpoint description above.limitoptionalNumber of actions to return (1-100). Default
20.offsetoptionalNumber of actions to skip, for paging. Default
0.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
The /v1/analystratings endpoint returns a JSON array of analyst actions with the following fields (an empty array when nothing matches), or an error if the request is unsuccessful (see errors).
tickerStock ticker.
dateDate of the action (YYYY-MM-DD).
firmThe research firm, e.g.
Morgan Stanley.actionWhat the firm did, e.g.
upgradeortarget_raised. The actions are listed in the endpoint description above.ratingThe firm's rating after the action, in its own words, e.g.
Buy,OverweightorMarket Perform.nullwhen the action did not state one.rating_priorThe firm's rating before the action.
price_targetThe firm's 12-month price target after the action.
nullwhen the action did not state one.price_target_priorThe firm's price target before the action.
currencyCurrency of the price targets, e.g.
USD.
Live Demo
Code Examples
curl -X GET "https://api.api-ninjas.com/v1/analystratings?ticker=AAPL" \
-H "X-Api-Key: YOUR_API_KEY"Premium only
https://api.api-ninjas.com/v1/pricetarget
Returns the consensus price target and analyst rating for a stock: the average, median, high and low of the analysts' price targets, the number of buy, hold and sell ratings, and each research firm's latest rating and price target.
Parameters
tickerrequiredStock ticker, e.g.
AAPL.Write the symbol the way you normally would. Share classes work as
BRK.B,BRK-B,BRK/BorBRKB, and preferred shares asBAC.PRL,BAC-PLorBAC^L.- Share classes:
BRK.B,BRK/B,BRK B,BRKB→BRK-B - Preferred shares:
BAC.PRL,BAC PR L,BAC^L,BACpL→BAC-PL - Warrants:
BKKT.WS,BKKT+,BKKT/WS→BKKT-WT - Units:
AAC.U,AAC=,AAC/U→AAC-UN - US exchange prefix:
NYSE:BRK.B→BRK-B - Lower case or a $ prefix:
brk.b,$BRK.B→BRK-B
- Share classes:
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
The /v1/pricetarget endpoint returns a JSON object with the following fields, or an error if the request is unsuccessful (see errors).
tickerStock ticker.
price_target_averageAverage of each firm's latest price target from the last 6 months.
price_target_medianMedian of those price targets.
price_target_high, price_target_lowHighest and lowest of those price targets.
number_of_price_targetsNumber of firms behind the price target figures.
currencyCurrency of the price targets,
USD.consensus_ratingBuy,HoldorSell, from the buy, hold and sell ratings below.buy_ratings, hold_ratings, sell_ratingsNumber of firms whose latest rating from the last 12 months is a buy (e.g. Buy, Outperform, Overweight), a hold (e.g. Hold, Neutral, Market Perform) or a sell (e.g. Sell, Underperform, Underweight).
last_updatedDate of the latest analyst action on the stock (YYYY-MM-DD).
firmsEach firm with an action in the last 12 months, latest first, with the fields below.
firms[].firm, firms[].date, firms[].actionThe research firm, and the date and type of its latest action.
firms[].rating, firms[].price_target, firms[].currencyThe firm's current rating and price target.
Live Demo
Code Examples
curl -X GET "https://api.api-ninjas.com/v1/pricetarget?ticker=AAPL" \
-H "X-Api-Key: YOUR_API_KEY"Errors
An invalid request returns HTTP 400 with a JSON body holding a readable error message, e.g. {"error": "ticker is required."}. Authentication and quota errors use the standard format described in error codes.
| Cause | Example error |
|---|---|
Neither ticker nor date | Provide a ticker, or a date to list every action on that day. |
| An unknown parameter | Unknown parameter: foo. |
A date that is not valid, e.g. start_date=2026-13-01 | start_date must be a valid date in YYYY-MM-DD format. |
An action that is not listed | action must be one of: initiated, upgrade, downgrade, ... |
A start_date more than 12 months back on a Developer plan | Paid plans include analyst actions from the last 12 months (since 2025-12-03). The full history is available on Business, Professional and Enterprise plans: https://api-ninjas.com/pricing |
| Any request on the free plan | The Analyst Ratings API is available on paid plans only: https://api-ninjas.com/pricing |
Frequently Asked Questions
Can I use the Analyst Ratings API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Analyst Ratings API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the Analyst Ratings API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the Analyst Ratings API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.What are analyst ratings and price targets?
Analysts at banks and research firms rate the stocks they cover, e.g. Buy, Hold or Sell (or Outperform, Overweight and similar), and most set a 12-month price target: the price they expect the stock to reach. When they change either, it is an upgrade, a downgrade or a price target change. The Analyst Ratings API returns these actions for US-listed stocks as JSON, with the research firm, the rating and price target before and after, and the date.How is the consensus price target calculated?
/v1/pricetargettakes each research firm's latest price target from the last 6 months and returns their average, median, high and low, with the number of firms. The buy, hold and sell counts use each firm's latest rating from the last 12 months, andconsensus_ratingis Buy, Hold or Sell from those counts.How often are analyst ratings updated?
New analyst actions are added every 15 minutes.Which plans include analyst ratings and price targets?
Every paid plan, with analyst actions from the last 12 months. Business, Professional and Enterprise plans include the full history.
Explore API integration use cases for recommended APIs and workflow examples.