# Yahoo Finance Scraper: Quotes, History, Options, News (`zhtech/yahoo-finance-scraper`) Actor

Yahoo Finance quotes, historical OHLCV prices, company profiles with key stats and financial summary, options chains with Greeks, ticker news, trending tickers and market movers. Stocks, ETFs, indices, crypto, FX. No login, no API key.

- **URL**: https://apify.com/zhtech/yahoo-finance-scraper.md
- **Developed by:** [ZH Tech](https://apify.com/zhtech) (community)
- **Categories:** Business, AI, News
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 quotes

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

Learn more: https://docs.apify.com/actors/running/actors-in-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

## Yahoo Finance Scraper: stock quotes, historical prices, options chains, company profiles and news

Scrape **Yahoo Finance** in one actor: current **stock quotes** (as shown on Yahoo, often delayed), **historical OHLCV prices** with adjusted close, dividends and splits, **company and fund profiles** with key statistics and a financial summary, **options chains with Greeks**, **news for any ticker**, and market lists such as **trending tickers, top gainers, losers, most active stocks, cryptocurrencies and top ETFs**.

Works for stocks, ETFs, mutual funds, indices (^GSPC, ^DJI, ^IXIC), crypto (BTC-USD, ETH-USD), currencies (EURUSD=X), futures (GC=F, CL=F) and non US listings (VOD.L, 7203.T, SAP.DE). No login, no API key, no browser. You only pay for rows you get.

> This is a data tool, not investment advice. Yahoo Finance data can be delayed (often 15 minutes for US stocks, more for some exchanges) and can contain errors. Check the `dataDelayMinutes` field and verify anything important with an official source before acting on it.

### What can this Yahoo Finance scraper do?

| Mode | One row per | What you get |
|---|---|---|
| **Quotes** | ticker | Price, change and change percent, previous close, open, day range, volume, 3 month and 10 day average volume, market cap, trailing and forward PE, EPS, price to book, beta, dividend rate and yield, ex dividend date, 52 week low, high and change, 50 and 200 day averages, shares outstanding, bid and ask, pre market and after hours price, market state, quote time, data delay, analyst target and rating, next earnings date. Crypto rows add circulating supply and 24h volume, fund rows add total assets and NAV. |
| **Historical prices** | bar | Date, ISO timestamp, open, high, low, close, adjusted close, volume, dividend and split ratio on the bar where they happened, currency and exchange time zone. Daily, weekly or monthly bars, any range from 5 days to the full history, or your own start and end dates. |
| **Profile** | ticker | Sector, industry, website, address, employees, business summary, officers with title, age and pay, governance risk scores, enterprise value, PE, PEG, price to book and to sales, EV to revenue and EBITDA, margins, ROE and ROA, revenue and growth, EBITDA, free cash flow, cash and debt, current and quick ratio, short interest, insider and institutional ownership, dividend and split history, analyst price targets and rating counts, yearly and quarterly revenue and earnings, quarterly EPS vs estimate with surprise percent, returns vs the S\&P 500. ETFs add fund family, category, expense ratio, total assets, top holdings and sector weights. |
| **Options** | contract | Contract symbol, call or put, expiration, days to expiration, strike, last price, bid, ask, mid, change, volume, open interest, implied volatility, in the money flag, last trade time, moneyness, and calculated **delta, gamma, theta, vega, rho** and theoretical price. Nearest N expirations or exact dates, calls, puts or both, optional strike window around the current price. |
| **News** | story | Title, link, publisher, publish time (exact when Yahoo provides it, otherwise estimated from "8h ago" and flagged), summary when available, related tickers, thumbnail. Each story is saved once even when it is linked to several of your tickers. |
| **Market lists** | ticker in a list | Trending tickers (US), most active, day gainers, day losers, 52 week gainers and losers, all cryptocurrencies by market cap, top ETFs. Rank, price, change, volume, market cap, PE, sector, industry, analyst rating. Up to 1,000 rows per list. |

### Why this actor

- **Reliable by design.** Every row comes from the same public pages you see on finance.yahoo.com, using the structured data Yahoo embeds in each page. No crumb or cookie handshake that breaks when Yahoo changes it, no CAPTCHA tricks, and only pages that Yahoo's robots.txt allows.
- **Clean, consistent output.** ISO 8601 timestamps, the currency on every row, every percentage in percent units (fields end in `Percent`, 1.25 means 1.25 percent), and float noise removed from prices (249.1, not 249.10000610351562).
- **Fair, granular pricing.** A historical price bar costs less than a full quote, so a year of daily history does not cost like 250 quotes. Error rows, duplicates and invalid input are never charged.
- **Greeks included.** Black-Scholes-Merton Greeks and a theoretical price are calculated for every contract at no extra cost, using Yahoo's implied volatility, the dividend yield and a risk free rate you can set.
- **Unknown or delisted tickers are clear.** You get an error row that says the symbol was not found, instead of an empty or wrong row, and the rest of the run continues.
- **Fast daily runs.** Six quotes take a few seconds.

### Use cases

- **Portfolio and watchlist tracking:** schedule the Quotes mode every hour or day and send prices to Google Sheets, Airtable, Slack or a database.
- **Backtesting and research datasets:** download daily, weekly or monthly OHLCV with adjusted close, dividends and splits for hundreds of tickers.
- **Fundamental screening:** pull profiles with valuation, margins, growth, cash, debt and analyst targets for a universe of stocks and rank them in a spreadsheet.
- **Options analytics:** snapshot full chains or a window of strikes around the price with IV, open interest and Greeks; track how IV changes over time.
- **News monitoring and sentiment:** collect the latest stories for your tickers with publisher and time, ready for a sentiment model or an LLM summary.
- **Market dashboards:** daily trending, gainers, losers and most active lists for newsletters, social posts or alerts.
- **AI agents:** give an assistant live market data as a tool through the Apify MCP server.

### How to use

1. Pick **What to scrape** (the mode).
2. Enter **Ticker symbols** as Yahoo Finance writes them (not needed for Market lists).
3. Adjust the section for your mode (interval and range, expirations, number of news stories, lists).
4. Optional: set **Max results** as a cost cap.
5. Run, then open the **Output** tab. Quotes, history, profiles, options, news, market lists and errors each have their own view. Export to JSON, CSV, Excel, XML or HTML, or read it through the API.

#### Symbol formats

| Asset | Examples |
|---|---|
| US stocks | `AAPL`, `MSFT`, `BRK-B` (Yahoo uses a dash, not a dot, for share classes) |
| Other exchanges | `VOD.L` (London), `7203.T` (Tokyo), `SAP.DE` (Xetra), `SHOP.TO` (Toronto), `RELIANCE.NS` (India) |
| ETFs and funds | `SPY`, `QQQ`, `VTSAX` |
| Indices | `^GSPC` (S\&P 500), `^DJI`, `^IXIC`, `^VIX`, `^FTSE`, `^N225` |
| Crypto | `BTC-USD`, `ETH-USD`, `SOL-USD` |
| Currencies | `EURUSD=X`, `GBPUSD=X`, `JPY=X` |
| Futures | `GC=F` (gold), `CL=F` (crude oil), `ES=F` |

Lowercase, a leading `$` and finance.yahoo.com/quote links are accepted.

### Input examples

Quotes for a mixed watchlist (this is the prefilled example):

```json
{
    "mode": "quotes",
    "tickers": ["AAPL", "MSFT", "SPY", "^GSPC", "BTC-USD", "EURUSD=X"]
}
```

Five years of weekly prices:

```json
{
    "mode": "history",
    "tickers": ["AAPL", "NVDA"],
    "historyInterval": "1wk",
    "historyRange": "5y"
}
```

Daily prices between two dates:

```json
{
    "mode": "history",
    "tickers": ["KO"],
    "historyInterval": "1d",
    "historyStartDate": "2024-01-01",
    "historyEndDate": "2024-12-31"
}
```

Options: the next 3 expirations, 10 strikes on each side of the price, with Greeks:

```json
{
    "mode": "options",
    "tickers": ["SPY"],
    "optionsExpirations": 3,
    "optionsStrikesAroundPrice": 10,
    "optionsType": "both",
    "includeGreeks": true,
    "riskFreeRatePercent": "4"
}
```

Company profiles and fundamentals:

```json
{
    "mode": "profile",
    "tickers": ["AAPL", "MSFT", "SPY"],
    "maxOfficers": 5
}
```

News for several tickers:

```json
{
    "mode": "news",
    "tickers": ["TSLA", "NVDA", "BTC-USD"],
    "maxNewsPerTicker": 10
}
```

Market lists:

```json
{
    "mode": "markets",
    "marketLists": ["trending", "gainers", "losers", "most-active"],
    "maxPerMarketList": 25
}
```

### Output examples

Quote (some fields shortened):

```json
{
    "type": "quote",
    "symbol": "AAPL",
    "name": "Apple Inc.",
    "quoteType": "EQUITY",
    "exchange": "NMS",
    "fullExchangeName": "NasdaqGS",
    "currency": "USD",
    "marketState": "CLOSED",
    "price": 342.56,
    "change": -6.649994,
    "changePercent": -1.904296,
    "previousClose": 349.21,
    "open": 352.63,
    "dayLow": 340.56,
    "dayHigh": 354.3,
    "volume": 80450240,
    "avgVolume3Month": 42444945,
    "marketCap": 4978144444416,
    "peTrailing": 38.883087,
    "peForward": 32.400333,
    "epsTrailing": 8.81,
    "beta": 1.089,
    "dividendRate": 1.08,
    "dividendYieldPercent": 0.31,
    "exDividendDate": "2026-11-12",
    "fiftyTwoWeekLow": 243.42,
    "fiftyTwoWeekHigh": 360.83,
    "postMarketPrice": 344.87,
    "postMarketChangePercent": 0.674334,
    "regularMarketTime": "2026-11-20T21:00:02.000Z",
    "exchangeTimezone": "America/New_York",
    "dataDelayMinutes": 15,
    "targetMeanPrice": 345.6313,
    "recommendationKey": "buy",
    "numberOfAnalysts": 39,
    "nextEarningsDate": "2027-01-28",
    "url": "https://finance.yahoo.com/quote/AAPL/",
    "scrapedAt": "2026-11-21T06:19:30.120Z"
}
```

Historical price bar:

```json
{
    "type": "bar",
    "symbol": "AAPL",
    "interval": "1d",
    "date": "2026-10-21",
    "timestamp": "2026-10-21T13:30:00.000Z",
    "open": 339.36,
    "high": 345.25,
    "low": 338.83,
    "close": 343.99,
    "adjClose": 343.7288,
    "volume": 35614100,
    "dividend": null,
    "splitRatio": null,
    "currency": "USD",
    "exchange": "NMS",
    "exchangeTimezone": "America/New_York",
    "instrumentType": "EQUITY"
}
```

Option contract:

```json
{
    "type": "option",
    "underlyingSymbol": "AAPL",
    "contractSymbol": "AAPL261123P00335000",
    "optionType": "put",
    "expirationDate": "2026-11-23",
    "daysToExpiration": 2,
    "strike": 335,
    "lastPrice": 1.4,
    "bid": 1.24,
    "ask": 1.57,
    "mid": 1.405,
    "volume": 9926,
    "openInterest": 1863,
    "impliedVolatilityPercent": 35.4499,
    "inTheMoney": false,
    "lastTradeDate": "2026-11-20T20:59:55.000Z",
    "currency": "USD",
    "underlyingPrice": 342.56,
    "moneyness": 0.977931,
    "delta": -0.221197,
    "gamma": 0.02892,
    "theta": -0.576407,
    "vega": 0.086049,
    "rho": -0.005514,
    "theoreticalPrice": 1.3246
}
```

News story:

```json
{
    "type": "news",
    "symbol": "AAPL",
    "title": "Startup sues Apple in India over tap-to-share contacts feature",
    "url": "https://finance.yahoo.com/technology/articles/startup-sues-apple-india-over-040000799.html",
    "publisher": "TechCrunch",
    "publishedAt": "2026-11-21T04:00:00.000Z",
    "publishedAtIsEstimate": false,
    "relativeTime": "2h ago",
    "summary": "U.S. startup GG Technologies, maker of the StayTouch app, has sued Apple in India...",
    "relatedTickers": ["AAPL"],
    "articleId": "f60bbaea-e797-3886-9455-5ee45725524f",
    "position": 3
}
```

Market list row:

```json
{
    "type": "market",
    "list": "gainers",
    "rank": 1,
    "symbol": "GPN",
    "name": "Global Payments Inc.",
    "quoteType": "EQUITY",
    "currency": "USD",
    "price": 91.83,
    "change": 8.25,
    "changePercent": 9.870783,
    "volume": 9549720,
    "marketCap": 24301506917,
    "peTrailing": 162.24375,
    "sector": "Industrials",
    "industry": "Specialty Business Services",
    "analystRating": "Buy",
    "url": "https://finance.yahoo.com/quote/GPN/"
}
```

Profile rows are wide (about 100 fields, including `officers`, `financialsYearly`, `financialsQuarterly`, `epsQuarterly`, `performance`, `topHoldings` and `sectorWeightingsPercent`). See the Profiles view in the Output tab.

Error row (never charged):

```json
{
    "type": "error",
    "source": "quote",
    "input": "TWTR",
    "errorCode": "NOT_FOUND",
    "error": "Symbol not found on Yahoo Finance (unknown, delisted or renamed). Yahoo redirects it to its symbol lookup page."
}
```

### Field conventions

- **Times** are ISO 8601 in UTC (`2026-11-20T21:00:02.000Z`). Dates such as `date`, `exDividendDate` and `expirationDate` are `YYYY-MM-DD`; for price bars the date is the trading day in the exchange time zone, and start and end dates are matched against that trading day. While a week or month is still in progress, its last weekly or monthly bar includes the latest trading day.
- **Percentages** are in percent units, always in a field ending in `Percent`: `changePercent: -1.9` means minus 1.9 percent.
- **Money** is in the row's `currency`. Some London listings are quoted in pence (`GBp`). Profile financials use `financialCurrency`, which can differ from the trading currency.
- **Missing values** are `null`. Yahoo does not publish every field for every asset type (an index has no PE, a currency has no market cap).
- **Greeks:** theta is per calendar day, vega and rho are per 1 percentage point change. They are model values calculated by this actor, not quotes from an exchange.

### Pricing

Pay per event, you only pay for what is delivered:

- **Actor start**: a small flat fee once per run.
- **Quote**: per quote row and per market list row.
- **Price bar**: per historical OHLCV bar.
- **Option contract**: per option contract row (Greeks included).
- **Profile**: per profile row (two page loads, about 100 fields).
- **News article**: per news story.

The current prices are on the Pricing tab. Never charged: error rows (not found, invalid symbol, robots.txt, blocked), duplicates (for example a news story linked to two of your tickers), and anything after your max total charge or Max results is reached. Invalid input stops the run before the start fee.

Typical runs: a watchlist of 50 quotes is 1 start plus 50 quote events. One year of daily prices for one ticker is about 250 price bar events. The next expiration of SPY with 10 strikes on each side is 40 option contract events.

### Use with the API, integrations and AI agents

- **API**: `POST https://api.apify.com/v2/acts/zhtech~yahoo-finance-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN` with the JSON input as the body returns the rows in one call. Add `&view=quotes` (or `history`, `profiles`, `options`, `news`, `markets`, `errors`) for a specific view.
- **Clients**: `apify-client` for JavaScript and Python. Example (Python): `client.actor("zhtech/yahoo-finance-scraper").call(run_input={"mode": "history", "tickers": ["AAPL"], "historyRange": "1y"})`.
- **Schedules and integrations**: schedule any mode and connect Google Sheets, Slack, a webhook, Zapier, Make or n8n.
- **LLMs and MCP**: the actor works as a tool through the Apify MCP server (mcp.apify.com), so Claude, ChatGPT, Cursor and other agents can fetch quotes, history, options or news on demand. Set a max total charge on the run to cap the cost.

### FAQ

**Is this investment advice?**
No. It collects data that Yahoo Finance shows publicly. It does not recommend buying or selling anything, and the calculated Greeks are model estimates.

**How fresh is the data?**
As fresh as the Yahoo Finance page at the moment of the run. Many exchanges are delayed (US stocks usually 15 minutes on Yahoo, some international exchanges 15 to 30 minutes); crypto and currencies are near real time. Each quote row has `dataDelayMinutes` and `regularMarketTime`.

**Which bar intervals are available?**
Daily, weekly and monthly, for any range up to the full history (more than 14,000 daily bars for old listings such as KO). Intraday bars (1 minute to 1 hour) are not offered because Yahoo serves them only from endpoints that its robots.txt asks automated clients not to use.

**Can I search for a ticker by company name?**
Not in this actor. Yahoo's symbol lookup page is disallowed for automated clients in its robots.txt. Use the symbol as shown in the URL of the Yahoo Finance quote page.

**Why do some news rows have `publishedAtIsEstimate: true`?**
Yahoo shows some stories only with a relative time such as "8h ago". The actor converts it to a timestamp and flags it as an estimate (accurate to the unit shown, for example the hour). When Yahoo provides the exact time, the flag is false.

**Why does a ticker return NOT_FOUND?**
Yahoo does not know the symbol, or it was delisted or renamed (for example TWTR). Yahoo then sends visitors to its lookup page, which the actor detects. Check the exact symbol format (BRK-B, not BRK.B; VOD.L for London).

**Why are bid, ask or IV odd outside market hours?**
Outside US trading hours Yahoo often shows bid and ask as 0 and an implied volatility based on stale quotes. `mid` is left `null` when bid and ask are both 0. Greeks use Yahoo's IV, so they are most meaningful during market hours.

**Do I need a proxy?**
No. Leave the Proxy field empty. On the Apify platform the actor switches to Apify datacenter proxy by itself only if Yahoo keeps refusing direct requests. Residential proxy is not supported (it is replaced with datacenter proxy). Visitors from the EU and UK can get a cookie consent page from Yahoo; the actor does not click through it and reports a clear BLOCKED error instead, which does not happen on the Apify platform's US servers.

**Is it legal to scrape Yahoo Finance?**
The actor reads publicly available pages without logging in and follows Yahoo's robots.txt. Yahoo's terms restrict some commercial uses of its content and market data are often licensed from exchanges, so check that your use (especially redistribution) is allowed. You are responsible for how you use the data.

### Limitations

- Bar intervals: daily, weekly and monthly only (see FAQ). No symbol search.
- News: the latest stories that Yahoo shows on a ticker's news page (usually 10 to 20). Older stories are not paged.
- Trending tickers are the US list. Gainers, losers, most active and top ETFs are Yahoo's US screeners.
- Full financial statements (every balance sheet and cash flow line) are not included; the profile has the summary metrics, yearly and quarterly revenue and earnings, and quarterly EPS.
- Data is as accurate as Yahoo Finance. If Yahoo changes its pages, the run reports a parse error row instead of returning wrong data.

### Support

Found a wrong field, a symbol that does not work, or need another data point? Open an issue on the Issues tab with the input you used and it will be looked at quickly.

# Actor input Schema

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

Quotes: current price, change, market cap, PE, 52 week range, volume and more, one row per ticker. Historical prices: daily, weekly or monthly OHLCV bars with adjusted close, dividends and splits. Profile: company or fund profile with key statistics, analyst targets and a financial summary. Options: options chain with bid, ask, volume, open interest, implied volatility and Greeks. News: latest news stories for each ticker. Market lists: trending tickers, most active, gainers, losers, crypto and top ETFs (no tickers needed).

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

Symbols as Yahoo Finance writes them. Stocks: AAPL, BRK-B. Non US: VOD.L, 7203.T, SAP.DE. ETFs: SPY. Indices: ^GSPC, ^DJI, ^IXIC. Crypto: BTC-USD, ETH-USD. Currencies: EURUSD=X, JPY=X. Futures: GC=F, CL=F. Links like https://finance.yahoo.com/quote/AAPL/ work too. Not used in Market lists mode.

## `historyInterval` (type: `string`):

Daily, weekly or monthly bars (the intervals the Yahoo Finance history page offers).

## `historyRange` (type: `string`):

How far back to go, counted from today. Ignored when a start date is set.

## `historyStartDate` (type: `string`):

First day to include, YYYY-MM-DD. Overrides the range.

## `historyEndDate` (type: `string`):

Last day to include, YYYY-MM-DD. Leave empty for today.

## `maxBarsPerTicker` (type: `integer`):

Keep only the most recent N bars per ticker. 0 keeps every bar in the range.

## `maxOfficers` (type: `integer`):

How many executives (name, title, age, pay) to include in each profile.

## `optionsExpirations` (type: `integer`):

How many of the nearest expiration dates to scrape per ticker. Each expiration is one page load.

## `optionsExpirationDates` (type: `array`):

Scrape these expirations instead, YYYY-MM-DD, for example 2026-12-18. Dates that are not listed for a ticker return an error row with the listed dates.

## `optionsType` (type: `string`):

Which side of the chain to return.

## `optionsStrikesAroundPrice` (type: `integer`):

Only the N strikes below and N strikes above the underlying price. 0 returns every strike.

## `includeGreeks` (type: `boolean`):

Adds delta, gamma, theta (per day), vega and rho (per 1 percentage point) and a theoretical price, calculated with the Black-Scholes-Merton model from Yahoo's implied volatility, the dividend yield and the risk free rate below.

## `riskFreeRatePercent` (type: `string`):

Annual risk free rate used for the Greeks, for example 4 for 4 percent.

## `maxNewsPerTicker` (type: `integer`):

Yahoo Finance shows about 10 to 20 of the latest stories on a ticker's news page.

## `marketLists` (type: `array`):

Lists to scrape: trending (US trending tickers), most-active, gainers, losers, 52-week-gainers, 52-week-losers, crypto (all cryptocurrencies by market cap), top-etfs.

## `maxPerMarketList` (type: `integer`):

Trending has up to 25 rows. Other lists go deeper in pages of 100.

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

Stop after this many saved rows in total. 0 means no limit. Your maximum cost per run also stops the run cleanly.

## `proxyConfiguration` (type: `object`):

Not needed in most cases, leave it empty. On the Apify platform the actor switches to Apify datacenter proxy by itself if Yahoo keeps refusing direct requests. Residential proxy is not supported and is replaced with datacenter proxy.

## Actor input object example

```json
{
  "mode": "quotes",
  "tickers": [
    "AAPL",
    "MSFT",
    "SPY",
    "^GSPC",
    "BTC-USD",
    "EURUSD=X"
  ],
  "historyInterval": "1d",
  "historyRange": "1mo",
  "maxBarsPerTicker": 0,
  "maxOfficers": 10,
  "optionsExpirations": 1,
  "optionsExpirationDates": [],
  "optionsType": "both",
  "optionsStrikesAroundPrice": 0,
  "includeGreeks": true,
  "riskFreeRatePercent": "4",
  "maxNewsPerTicker": 20,
  "marketLists": [
    "trending"
  ],
  "maxPerMarketList": 25,
  "maxItems": 0
}
```

# Actor output Schema

## `quotes` (type: `string`):

No description

## `history` (type: `string`):

No description

## `profiles` (type: `string`):

No description

## `options` (type: `string`):

No description

## `news` (type: `string`):

No description

## `markets` (type: `string`):

No description

## `errors` (type: `string`):

No description

## `allResults` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# 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": "quotes",
    "tickers": [
        "AAPL",
        "MSFT",
        "SPY",
        "^GSPC",
        "BTC-USD",
        "EURUSD=X"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("zhtech/yahoo-finance-scraper").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": "quotes",
    "tickers": [
        "AAPL",
        "MSFT",
        "SPY",
        "^GSPC",
        "BTC-USD",
        "EURUSD=X",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("zhtech/yahoo-finance-scraper").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": "quotes",
  "tickers": [
    "AAPL",
    "MSFT",
    "SPY",
    "^GSPC",
    "BTC-USD",
    "EURUSD=X"
  ]
}' |
apify call zhtech/yahoo-finance-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zhtech/yahoo-finance-scraper"
        }
    }
}
```

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/16nfBXSw7Hxyy49s5/builds/UKfeBmYGEQBRs6otC/openapi.json
