# Yahoo Finance Analyst Ratings & Consensus Tracker (`nimbryxo-studio/yahoo-finance-analyst-ratings-and-consensus`) Actor

Get buy/hold/sell analyst consensus and price targets, or a full history of individual analyst rating changes, for any list of stock tickers.

- **URL**: https://apify.com/nimbryxo-studio/yahoo-finance-analyst-ratings-and-consensus.md
- **Developed by:** [Nimbryxo-studio](https://apify.com/nimbryxo-studio) (community)
- **Categories:** Automation, News, Other
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## TipRanks Analyst Ratings & Consensus Tracker

Wall Street sends a constant stream of upgrades, downgrades and price-target changes. This actor turns TipRanks' public stock, analyst and market pages into structured records so you can follow consensus, rating history, price targets, screener results and ownership activity without opening a browser tab for every ticker.

No TipRanks account, cookie or API key is required. Give it a ticker list, a screener filter or an analyst name and it returns clean JSON.

### Modes

| Mode | What it returns |
|---|---|
| `stockConsensus` | One snapshot per ticker: buy/hold/sell analyst counts, consensus label and score, average price target, upside, Smart Score, price and company profile. |
| `analystRatings` | One record per analyst rating action: firm, analyst, new rating, action, price target, rating date and the linked article. |
| `priceTargets` | One record per ticker: all-analyst average target and upside, top-analyst target, high/low targets and statistics from recent rating actions. |
| `stockProfile` | One record per ticker: company description, sector, industry, CEO, employees, price, market cap, P/E, Smart Score, 52-week range and analyst consensus. |
| `stocks` | Stock-screener rows with server-side filters and sorts: price, change, market cap, P/E, dividend yield, analyst consensus, price-target upside, sector, exchange, earnings date and more. |
| `analysts` | One record per analyst: rank, star score, success rate, average return, coverage list, best call and latest rating per covered ticker. |
| `news` | Stock news articles and TipRanks blog posts, with source, date and article sentiment where TipRanks provides it. |
| `insiderTrades` | Insider transactions: officer/director/owner, buy or sale, shares, reported value, transaction date and SEC filing link. |
| `hedgeFundActivity` | Hedge-fund positions: fund and manager, reported position value, change, portfolio allocation and report date. |
| `search` | TipRanks search results across tickers, ETFs, funds, crypto, forex, commodities, analysts, insiders, hedge funds and bloggers. |

Switch mode with the `mode` input. Ticker modes accept symbols, `$TICKER`, `NASDAQ:TICKER`, or TipRanks/Yahoo Finance stock URLs.

### Input examples

#### Consensus snapshot for a watchlist

```json
{
  "mode": "stockConsensus",
  "tickers": ["AAPL", "MSFT", "NVDA"],
  "maxItems": 10
}
```

#### Upgrades and downgrades for one stock

```json
{
  "mode": "analystRatings",
  "tickers": ["TSLA"],
  "ratingAction": "downgraded",
  "maxItems": 50
}
```

#### Strong-buy technology stocks above $10B

```json
{
  "mode": "stocks",
  "marketCountry": "United States",
  "sector": "Technology",
  "analystConsensus": "Strong Buy",
  "marketCapBucket": "Mega (Over $200B)",
  "sortBy": "Analyst Price Target",
  "sortDirection": "Descending",
  "maxItems": 100
}
```

#### An analyst's full public profile

```json
{
  "mode": "analysts",
  "analysts": ["Andrew Marok", "https://www.tipranks.com/experts/analysts/andrew-marok"],
  "maxItems": 5
}
```

#### Insider purchases above $1 million

```json
{
  "mode": "insiderTrades",
  "tickers": ["AAPL"],
  "transactionType": "buy",
  "minTransactionValue": 1000000,
  "maxItems": 50
}
```

### Output fields

#### Consensus (`recordType: "consensus"`)

`ticker`, `companyName`, `currency`, `exchange`, `sector`, `industry`, `price`, `priceChangePercent`, `marketCap`, `smartScore`, `fiftyTwoWeekHigh`, `fiftyTwoWeekLow`, `buyCount`, `holdCount`, `sellCount`, `totalAnalysts`, `consensusScore`, `consensus`, `ratingId`, `priceTarget`, `upsidePercent`, `bestAnalystPriceTarget`, `bestAnalystUpsidePercent`, `bestAnalystPriceTargetHigh`, `bestAnalystPriceTargetLow`, `priceTargetHigh`, `priceTargetLow`, `recentPriceTargetAverage`, `recentPriceTargetHigh`, `recentPriceTargetLow`, `recentPriceTargetCount`, `lastRatingDate`, `stockUrl`, `recordType`, `scrapedAt`.

TipRanks publishes a three-way analyst consensus (buy / hold / sell). `consensusScore` is a 1–5 weighted score derived from those three buckets (1 = strongest buy, 5 = strongest sell) so existing dashboards keep a comparable number. `priceTarget` is the all-analyst average. `priceTargetHigh` / `priceTargetLow` are the high and low targets in the returned rating history; `bestAnalystPriceTargetHigh` / `bestAnalystPriceTargetLow` are TipRanks' top-analyst range. `recentPriceTarget*` summarize the same rating-history targets.

#### Rating history (`recordType: "analystRating"`)

`ticker`, `companyName`, `ratingId`, `firm`, `firmType`, `analystName`, `analystSlug`, `analystImageUrl`, `analystRankPosition`, `analystRankPercentile`, `analystAverageReturnPercent`, `analystSuccessRatePercent`, `analystRatingsSuccessful`, `analystRatingsTotal`, `rating`, `ratingBucket`, `action`, `priceTarget`, `previousPriceTarget`, `priceTargetChange`, `priceTargetChangePercent`, `currency`, `gradeDate`, `articleTitle`, `articleUrl`, `articleSite`, `articleDate`, `stockUrl`, `recordType`, `scrapedAt`.

`previousPriceTarget` and the price-target change fields are filled when the same analyst has an older rating in the returned history. When TipRanks only shows a single target for that call, the change fields are omitted rather than guessed.

TipRanks also publishes AI-generated ratings. They are excluded by default so the feed matches the human analyst table. Set `includeAiAnalysts` to `true` to include them; those records add `isAiAnalyst`, `aiProvider` and `aiModel`.

#### Price targets (`recordType: "priceTarget"`)

`ticker`, `companyName`, `currency`, `exchange`, `price`, `consensusPriceTarget`, `upsidePercent`, `analystCount`, `ratingId`, `lastRatingDate`, `bestAnalystPriceTarget`, `bestAnalystUpsidePercent`, `bestAnalystPriceTargetHigh`, `bestAnalystPriceTargetLow`, `bestAnalystCount`, `priceTargetHigh`, `priceTargetLow`, `recentPriceTargetAverage`, `recentPriceTargetHigh`, `recentPriceTargetLow`, `recentPriceTargetCount`, `stockUrl`, `recordType`, `scrapedAt`.

#### Stock profile (`recordType: "stockProfile"`)

`ticker`, `companyName`, `fullName`, `description`, `sector`, `industry`, `ceo`, `employees`, `exchange`, `currency`, `price`, `priceChange`, `priceChangePercent`, `marketCap`, `peRatio`, `smartScore`, `smartScoreUpdatedAt`, `followers`, `fiftyTwoWeekHigh`, `fiftyTwoWeekLow`, `analystConsensus`, `stockUrl`, `recordType`, `scrapedAt`.

#### Screener (`recordType: "stock"`)

`rank`, `ticker`, `companyName`, `sector`, `industry`, `exchange`, `currency`, `price`, `priceChangePercent`, `marketCap`, `enterpriseValue`, `peRatio`, `forwardPe`, `pegRatio`, `beta`, `epsTtm`, `epsForecast`, `revenueActual`, `revenueForecast`, `earningsDate`, `dividendYield`, `dividendFrequency`, `payoutRatio`, `buyCount`, `holdCount`, `sellCount`, `totalAnalysts`, `consensus`, `smartScore`, `fiftyTwoWeekHigh`, `fiftyTwoWeekLow`, `avgVolume3M`, `dollarVolume`, `relativeVolume`, `followers`, `yearlyGainPercent`, `lastRatingDate`, `performance`, `technicalIndicators`, `stockUrl`, `recordType`, `scrapedAt`.

#### Analyst profile (`recordType: "analyst"`)

`slug`, `name`, `firm`, `type`, `pictureUrl`, `rank`, `rankOutOf`, `globalRank`, `globalRankOutOf`, `stars`, `successRatePercent`, `averageReturnPercent`, `followers`, `recommendationsGood`, `recommendationsTotal`, `distribution`, `mainSector`, `industry`, `geoCoverage`, `bestRating`, `coverage`, `period`, `benchmark`, `profileUrl`, `recordType`, `scrapedAt`.

#### News (`recordType: "newsArticle"` or `"newsPost"`)

`ticker`, `companyName`, `contentType`, `title`, `description`, `url`, `source`, `author`, `category`, `publishedAt`, `sentiment`, `imageUrl`, `thumbnailUrl`, `stockUrl`, `recordType`, `scrapedAt`.

#### Insider trades (`recordType: "insiderTransaction"`)

`ticker`, `companyName`, `transactionId`, `insiderName`, `insiderSlug`, `insiderRole`, `insiderImageUrl`, `isOfficer`, `isDirector`, `isTenPercentOwner`, `transactionType`, `action`, `isInformative`, `transactionDate`, `shares`, `transactionValue`, `currency`, `holdingDescription`, `filingUrl`, `secAccessionNumber`, `secTransactionCode`, `articleTitle`, `articleUrl`, `stockUrl`, `recordType`, `scrapedAt`.

#### Hedge-fund activity (`recordType: "hedgeFundPosition"`)

`ticker`, `companyName`, `positionId`, `managerName`, `managerSlug`, `fundName`, `fundType`, `managerRankPosition`, `managerRankPercentile`, `managerImageUrl`, `reportDate`, `positionAction`, `positionValue`, `holdingChangePercent`, `portfolioAllocationPercent`, `currency`, `stockUrl`, `recordType`, `scrapedAt`.

#### Search (`recordType: "searchResult"`)

`query`, `category`, `label`, `value`, `ticker`, `name`, `firm`, `slug`, `uid`, `market`, `marketCap`, `sector`, `followers`, `profileUrl`, `recordType`, `scrapedAt`.

Every record is omit-empty: a field TipRanks does not publish for that entity is absent rather than `null` or an empty string.

### Filters and sorting

The screener supports server-side filters for sector, analyst consensus, analyst price-target upside, market-cap bucket, dividend yield, P/E bucket, exchange and upcoming earnings date. Sort by market cap, Smart Score, analyst consensus, analyst price target, price, volume, average 3-month volume, dividend yield, yearly gain or last rating date, in either direction. `includeSecondaryListings` opens up OTC and other secondary US listings when you need a wider universe than the site's primary screener. In `search` mode, `marketCountry` biases the autocomplete results toward that market (for example, Japan surfaces `JP:7203`).

Analyst rating history and insider/hedge-fund activity add post-fetch filters so a run can focus on upgrades, sales above a value threshold, added hedge-fund positions, or a specific news sentiment.

### Use cases

- **Watchlist monitoring** — compare consensus and price targets across a basket of tickers.
- **Rating-change alerts** — pull only upgrades or downgrades and link each call to its article.
- **Screener research** — build a candidate list from consensus, upside, market cap and dividend filters.
- **Analyst tracking** — follow an analyst's coverage, hit rate and current calls.
- **Ownership signals** — combine insider sales and hedge-fund position changes with analyst sentiment.
- **News research** — collect ticker-specific articles with sentiment for a research notebook or BI model.

### Input reference

| Input | Default |
|---|---|
| `mode` | `"stockConsensus"` |
| `tickers` | `["AAPL"]` |
| `analysts` | `[]` |
| `searchQuery` | `""` |
| `maxItems` | `50` |
| `ratingPosition` | `"all"` |
| `includeAiAnalysts` | `false` |
| `ratingAction` | `"all"` |
| `newsSentiment` | `"all"` |
| `newsContent` | `"all"` |
| `transactionType` | `"all"` |
| `minTransactionValue` | `0` |
| `positionAction` | `"all"` |
| `minPositionValue` | `0` |
| `marketCountry` | `"United States"` |
| `sector` | `"Any"` |
| `analystConsensus` | `"Any"` |
| `priceTargetUpside` | `"Any"` |
| `marketCapBucket` | `"Any"` |
| `dividendYield` | `"Any"` |
| `peRatio` | `"Any"` |
| `includeSecondaryListings` | `false` |
| `exchange` | `"All US primary exchanges"` |
| `earningsDate` | `"Any"` |
| `sortBy` | `"Market Cap"` |
| `sortDirection` | `"Descending"` |
| `pageSize` | `100` |

### FAQ

**Do I need a TipRanks account?** No. The actor uses TipRanks' public page data and needs no login, cookie or API key.

**Which tickers work?** US-listed stocks and other symbols that TipRanks covers. Use TipRanks' market-prefixed symbols for non-US stocks, such as `JP:7203` (Toyota), `FR:MC` (LVMH), `TSE:RY` (RBC), `GB:HSBA` (HSBC) or `DE:SAP`. Yahoo-style suffixes such as `7203.T`, `SHOP.TO` or `HSBA.L` are converted to the TipRanks prefix. Symbols with a dot, such as `BRK.B`, are supported. The screener also covers the non-US markets listed in the input.

**Why are some fields missing?** TipRanks does not publish every field for every entity. Fields are omitted when the source has no value; records are never padded with guesses. Recent US insider rows are filled from SEC EDGAR; non-US insider rows and some non-US Smart Scores have no public equivalent and stay omitted.

**Why do some analyst counts differ from another site?** TipRanks counts its own tracked analyst universe and applies its own three-month consensus window. Counts and average targets are TipRanks' figures, not another provider's.

**Why are some top-analyst names hidden?** TipRanks keeps parts of its expert leaderboard behind a subscription. This actor returns the public data it can verify; individual public analyst profiles and the analysts named in stock rating history are fully supported.

**Why is a hedge-fund position value missing?** Funds report positions quarterly and some filings arrive with partial data. The actor reports the fields TipRanks publishes for that filing and omits the rest.

**Why are some insider shares, values or actions missing?** TipRanks leaves the newest five insider rows per issuer without shares, value, action and the SEC link. For US issuers the actor fills those fields from the same Form 4 on SEC EDGAR and adds `secAccessionNumber`, `secTransactionCode` and the SEC `filingUrl`. Non-US issuers are not covered by SEC EDGAR, so their missing fields are omitted rather than guessed.

**Why is Smart Score missing from some screener rows?** TipRanks shows Smart Score on stock pages but redacts that column in the anonymous screener view. For US stocks, `stockProfile` and `stockConsensus` return it. Some non-US profiles do not publish a Smart Score (for example, Toyota and LVMH return none), so the field is omitted there.

**Why do stock and article URLs sometimes answer 403 to a command-line client?** TipRanks protects its HTML pages with a browser bot check. The URLs are the real TipRanks pages and open normally in a browser; a non-browser `curl` request may receive a challenge. The actor never fabricates a URL.

**How fresh is the data?** Tickers, ratings and prices are fetched from TipRanks at run time. TipRanks may cache pages for a few minutes.

**How many records can one run return?** Up to `maxItems` (1–20,000). Ticker modes share the cap across all tickers; the screener paginates until the cap or the source's own result count is reached.

**Does the actor use a proxy?** It works from a normal Apify run without proxy setup. The actor calls TipRanks' public JSON endpoints directly; if TipRanks blocks the run, it stops with a clear status instead of inventing data. No proxy configuration is required from you.

**What happens when TipRanks changes its public data pages?** The actor returns a clear status message instead of inventing data. Update the actor and retry; no fabricated TipRanks records are ever emitted.

# Actor input Schema

## `mode` (type: `string`):

What to collect. Ticker-based modes use the tickers below; the screener uses the stock filters; the analyst mode uses the analysts list; search uses the search query.

## `tickers` (type: `array`):

Stock tickers for ticker-based modes. Accepts symbols such as AAPL, BRK.B, $TSLA, or a TipRanks/Yahoo Finance stock URL.

## `analysts` (type: `array`):

Analyst names, slugs or TipRanks profile URLs for mode=analysts. Examples: Andrew Marok, andrew-marok, https://www.tipranks.com/experts/analysts/andrew-marok.

## `searchQuery` (type: `string`):

Company, ticker or expert name for mode=search. Examples: Apple, NVDA, Andrew Marok.

## `maxItems` (type: `integer`):

Maximum number of records to save across tickers and pages.

## `ratingPosition` (type: `string`):

Only keep analyst ratings with this position (mode=analystRatings).

## `includeAiAnalysts` (type: `boolean`):

Include TipRanks' AI-generated analyst ratings in mode=analystRatings. Off by default to match the human analyst table.

## `ratingAction` (type: `string`):

Only keep analyst ratings with this action (mode=analystRatings).

## `newsSentiment` (type: `string`):

Only keep articles with this sentiment (mode=news). Blog posts have no sentiment and are skipped when a sentiment is selected.

## `newsContent` (type: `string`):

Choose articles, TipRanks blog posts, or both (mode=news).

## `transactionType` (type: `string`):

Only keep insider transactions of this type (mode=insiderTrades).

## `minTransactionValue` (type: `integer`):

Skip insider transactions below this reported value (mode=insiderTrades). Use 0 for no minimum.

## `positionAction` (type: `string`):

Only keep hedge-fund positions with this change (mode=hedgeFundActivity).

## `minPositionValue` (type: `integer`):

Skip hedge-fund positions below this reported value (mode=hedgeFundActivity). Use 0 for no minimum.

## `marketCountry` (type: `string`):

Market to screen (mode=stocks) and country hint for non-US search results (mode=search). US uses the major primary exchanges by default.

## `sector` (type: `string`):

Only keep stocks in this sector (mode=stocks).

## `analystConsensus` (type: `string`):

Only keep stocks with this analyst consensus (mode=stocks).

## `priceTargetUpside` (type: `string`):

Only keep stocks in this analyst price-target upside bucket (mode=stocks).

## `marketCapBucket` (type: `string`):

Only keep stocks in this market-cap bucket (mode=stocks).

## `dividendYield` (type: `string`):

Only keep stocks in this dividend-yield bucket (mode=stocks).

## `peRatio` (type: `string`):

Only keep stocks in this P/E bucket (mode=stocks).

## `includeSecondaryListings` (type: `boolean`):

Include OTC and other secondary listings in the screener (mode=stocks). Off by default so results match the site's primary screener.

## `exchange` (type: `string`):

Exchange filter for the US screener (mode=stocks).

## `earningsDate` (type: `string`):

Only keep stocks with earnings in this window (mode=stocks).

## `sortBy` (type: `string`):

Sort order for the stock screener (mode=stocks).

## `sortDirection` (type: `string`):

Direction of the screener sort (mode=stocks).

## `pageSize` (type: `integer`):

Rows requested per screener page (mode=stocks). Larger pages reduce requests.

## Actor input object example

```json
{
  "mode": "stockConsensus",
  "tickers": [
    "AAPL"
  ],
  "analysts": [],
  "searchQuery": "",
  "maxItems": 2,
  "ratingPosition": "all",
  "includeAiAnalysts": false,
  "ratingAction": "all",
  "newsSentiment": "all",
  "newsContent": "all",
  "transactionType": "all",
  "minTransactionValue": 0,
  "positionAction": "all",
  "minPositionValue": 0,
  "marketCountry": "United States",
  "sector": "Any",
  "analystConsensus": "Any",
  "priceTargetUpside": "Any",
  "marketCapBucket": "Any",
  "dividendYield": "Any",
  "peRatio": "Any",
  "includeSecondaryListings": false,
  "exchange": "All US primary exchanges",
  "earningsDate": "Any",
  "sortBy": "Market Cap",
  "sortDirection": "Descending",
  "pageSize": 100
}
```

# Actor output Schema

## `records` (type: `string`):

Dataset containing every collected record. Filter by recordType to separate consensus snapshots, rating history, screener rows, analyst profiles, news, insider trades and hedge-fund positions.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "stockConsensus",
    "tickers": [
        "AAPL"
    ],
    "analysts": [],
    "searchQuery": "",
    "maxItems": 2,
    "ratingPosition": "all",
    "includeAiAnalysts": false,
    "ratingAction": "all",
    "newsSentiment": "all",
    "newsContent": "all",
    "transactionType": "all",
    "minTransactionValue": 0,
    "positionAction": "all",
    "minPositionValue": 0,
    "marketCountry": "United States",
    "sector": "Any",
    "analystConsensus": "Any",
    "priceTargetUpside": "Any",
    "marketCapBucket": "Any",
    "dividendYield": "Any",
    "peRatio": "Any",
    "includeSecondaryListings": false,
    "exchange": "All US primary exchanges",
    "earningsDate": "Any",
    "sortBy": "Market Cap",
    "sortDirection": "Descending",
    "pageSize": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("nimbryxo-studio/yahoo-finance-analyst-ratings-and-consensus").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "stockConsensus",
    "tickers": ["AAPL"],
    "analysts": [],
    "searchQuery": "",
    "maxItems": 2,
    "ratingPosition": "all",
    "includeAiAnalysts": False,
    "ratingAction": "all",
    "newsSentiment": "all",
    "newsContent": "all",
    "transactionType": "all",
    "minTransactionValue": 0,
    "positionAction": "all",
    "minPositionValue": 0,
    "marketCountry": "United States",
    "sector": "Any",
    "analystConsensus": "Any",
    "priceTargetUpside": "Any",
    "marketCapBucket": "Any",
    "dividendYield": "Any",
    "peRatio": "Any",
    "includeSecondaryListings": False,
    "exchange": "All US primary exchanges",
    "earningsDate": "Any",
    "sortBy": "Market Cap",
    "sortDirection": "Descending",
    "pageSize": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("nimbryxo-studio/yahoo-finance-analyst-ratings-and-consensus").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "stockConsensus",
  "tickers": [
    "AAPL"
  ],
  "analysts": [],
  "searchQuery": "",
  "maxItems": 2,
  "ratingPosition": "all",
  "includeAiAnalysts": false,
  "ratingAction": "all",
  "newsSentiment": "all",
  "newsContent": "all",
  "transactionType": "all",
  "minTransactionValue": 0,
  "positionAction": "all",
  "minPositionValue": 0,
  "marketCountry": "United States",
  "sector": "Any",
  "analystConsensus": "Any",
  "priceTargetUpside": "Any",
  "marketCapBucket": "Any",
  "dividendYield": "Any",
  "peRatio": "Any",
  "includeSecondaryListings": false,
  "exchange": "All US primary exchanges",
  "earningsDate": "Any",
  "sortBy": "Market Cap",
  "sortDirection": "Descending",
  "pageSize": 100
}' |
apify call nimbryxo-studio/yahoo-finance-analyst-ratings-and-consensus --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/yahoo-finance-analyst-ratings-and-consensus"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Z7fDzrmbh5Xgm2Usu/builds/fSERFJhIOwV8Gck7b/openapi.json
