# Yahoo Finance Market Data API (`philzx/yahoo-finance-market-data`) Actor

Fast Yahoo Finance scraper for quotes, history, fundamentals, news, options, holders, recommendations, dividends, splits, and earnings.

- **URL**: https://apify.com/philzx/yahoo-finance-market-data.md
- **Developed by:** [Filipe Alves](https://apify.com/philzx) (community)
- **Categories:** Automation, Developer tools, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.75 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Yahoo Finance Market Data API

Fetch comprehensive Yahoo Finance market data for stocks, ETFs, indices, crypto, and FX tickers. Built as a fast Apify Actor with structured JSON output and per-module controls.

### Why this Actor

- **Cheaper than the leading Yahoo Finance Actor**: **$0.75 / 1,000 ticker records** instead of $0.90 / 1,000.
- **More control**: choose period, interval, enabled modules, max news, max options expirations, and max rows per table.
- **Batch-ready**: fetch many symbols in one run.
- **Failure-tolerant**: if one module fails for a ticker, the Actor still returns the rest of the data plus an `errors` array.
- **Analysis-ready JSON**: output works well for APIs, spreadsheets, databases, dashboards, and AI agents.

### Input example

```json
{
  "tickers": ["AAPL", "MSFT", "TSLA"],
  "period": "1y",
  "interval": "1d",
  "includeHistory": true,
  "includeFinancials": true,
  "includeNews": true,
  "includeOptions": true,
  "maxOptionExpirations": 1,
  "maxNews": 10,
  "maxRowsPerTable": 500
}
```

You can also use custom historical date ranges:

```json
{
  "tickers": ["AAPL", "BTC-USD", "^GSPC"],
  "start_date": "2025-01-01",
  "end_date": "2025-06-30",
  "interval": "1d"
}
```

### Input fields

- `tickers` — required list of Yahoo Finance symbols, e.g. `AAPL`, `MSFT`, `BTC-USD`, `EURUSD=X`, `^GSPC`.
- `period` — historical range when `start_date` is empty: `1d`, `5d`, `1mo`, `3mo`, `6mo`, `1y`, `2y`, `5y`, `10y`, `ytd`, `max`.
- `interval` — candle interval: `1m`, `2m`, `5m`, `15m`, `30m`, `60m`, `90m`, `1h`, `1d`, `5d`, `1wk`, `1mo`, `3mo`.
- `start_date`, `end_date` — optional custom date range in `YYYY-MM-DD` format.
- `includeHistory` — OHLCV price history.
- `includeFinancials` — income statement, balance sheet, cash flow.
- `includeDividends` — dividend history.
- `includeSplits` — stock split history.
- `includeNews` + `maxNews` — latest Yahoo Finance news.
- `includeRecommendations` — analyst recommendations and upgrades/downgrades.
- `includeHolders` — major, institutional, and mutual fund holders.
- `includeOptions` + `maxOptionExpirations` — options expiration list and chains.
- `includeEarnings` — earnings dates and earnings-related tables.
- `maxRowsPerTable` — safety limit for nested tables; set to `0` for no limit.

### Output

Each dataset item is one ticker record:

```json
{
  "ticker": "AAPL",
  "fetched_at": "2026-07-06T18:30:00Z",
  "stock_info": {
    "symbol": "AAPL",
    "name": "Apple Inc.",
    "quote_type": "EQUITY",
    "exchange": "NMS",
    "currency": "USD",
    "sector": "Technology",
    "industry": "Consumer Electronics",
    "market_cap": 2922039738368,
    "current_price": 195.64,
    "previous_close": 198.42,
    "day_high": 198.7,
    "day_low": 195.2,
    "pe_ratio": 30.1,
    "dividend_yield": 0.005,
    "beta": 1.2
  },
  "price_info": {
    "symbol": "AAPL",
    "current_price": 195.64,
    "previous_close": 198.42,
    "change": -2.78,
    "change_percent": -1.40,
    "timestamp": "2026-07-06T18:30:00Z"
  },
  "history": {
    "symbol": "AAPL",
    "period": "1y",
    "interval": "1d",
    "data": [
      {"Date": "2025-07-07T04:00:00Z", "Open": 210.0, "High": 212.0, "Low": 208.0, "Close": 211.0, "Volume": 12345678}
    ]
  },
  "financials": {
    "symbol": "AAPL",
    "income_statement": [],
    "balance_sheet": [],
    "cash_flow": []
  },
  "dividends": {"symbol": "AAPL", "dividends": []},
  "splits": {"symbol": "AAPL", "splits": []},
  "news": {"symbol": "AAPL", "news": []},
  "recommendations": {"symbol": "AAPL", "recommendations": [], "upgrades_downgrades": []},
  "holders": {"symbol": "AAPL", "major_holders": [], "institutional_holders": [], "mutualfund_holders": []},
  "options": {"symbol": "AAPL", "available_expirations": [], "chains": []},
  "earnings": {"symbol": "AAPL", "earnings_dates": []},
  "errors": []
}
```

### Notes

Yahoo Finance availability varies by symbol and asset type. Some modules are not available for indices, crypto, currencies, or thinly traded instruments. When a module is unavailable, the Actor returns an empty array and/or a clear entry in `errors` instead of failing the whole run.

# Actor input Schema

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

Ticker symbols to fetch. Examples: AAPL, MSFT, TSLA, BTC-USD, EURUSD=X, ^GSPC.

## `start_date` (type: `string`):

Optional start date for historical candles in YYYY-MM-DD format. If provided, overrides period.

## `end_date` (type: `string`):

Optional end date for historical candles in YYYY-MM-DD format.

## `period` (type: `string`):

Historical range when start\_date is empty.

## `interval` (type: `string`):

Historical candle interval. Intraday intervals are limited by Yahoo Finance availability.

## `includeHistory` (type: `boolean`):

Include OHLCV historical candles.

## `includeFinancials` (type: `boolean`):

Include income statement, balance sheet, and cash flow.

## `includeDividends` (type: `boolean`):

Include dividend history.

## `includeSplits` (type: `boolean`):

Include stock split history.

## `includeNews` (type: `boolean`):

Include latest Yahoo Finance news for each ticker.

## `maxNews` (type: `integer`):

Maximum news articles per ticker.

## `includeRecommendations` (type: `boolean`):

Include analyst recommendation trends and upgrades/downgrades when available.

## `includeHolders` (type: `boolean`):

Include major and institutional holders when available.

## `includeOptions` (type: `boolean`):

Include options calls/puts for the first N expirations.

## `maxOptionExpirations` (type: `integer`):

Maximum option expiration dates to fetch per ticker. Use 0 to return only the expiration list.

## `includeEarnings` (type: `boolean`):

Include earnings dates and earnings-related tables when available.

## `maxRowsPerTable` (type: `integer`):

Safety limit for large nested tables such as history, news, recommendations, holders, and options. 0 means no limit.

## Actor input object example

```json
{
  "tickers": [
    "AAPL",
    "MSFT",
    "TSLA"
  ],
  "start_date": "",
  "end_date": "",
  "period": "1y",
  "interval": "1d",
  "includeHistory": true,
  "includeFinancials": true,
  "includeDividends": true,
  "includeSplits": true,
  "includeNews": true,
  "maxNews": 10,
  "includeRecommendations": true,
  "includeHolders": true,
  "includeOptions": true,
  "maxOptionExpirations": 1,
  "includeEarnings": true,
  "maxRowsPerTable": 500
}
```

# Actor output Schema

## `results` (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 = {
    "tickers": [
        "AAPL",
        "MSFT",
        "TSLA"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("philzx/yahoo-finance-market-data").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 = { "tickers": [
        "AAPL",
        "MSFT",
        "TSLA",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("philzx/yahoo-finance-market-data").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "tickers": [
    "AAPL",
    "MSFT",
    "TSLA"
  ]
}' |
apify call philzx/yahoo-finance-market-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=philzx/yahoo-finance-market-data",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/BT108eVxJkiCSw5k2/builds/kPQ0xMX9Y3pvqB0Q5/openapi.json
