# Yahoo Finance Price History & Quote Scraper (`rasareka/yahoo-finance-history`) Actor

Download Yahoo Finance historical prices (OHLCV, adjusted close), dividends, splits and latest quotes for stocks, ETFs, crypto, indices and forex worldwide. Daily, weekly, monthly or intraday bars, plus return and volatility stats. No API key.

- **URL**: https://apify.com/rasareka/yahoo-finance-history.md
- **Developed by:** [Rasa Reka](https://apify.com/rasareka) (community)
- **Categories:** AI, Developer tools
- **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 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/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 Price History & Quote Scraper

Download **Yahoo Finance historical prices** (open, high, low, close, adjusted close, volume) with **dividends and stock splits** for stocks, ETFs, crypto, indices and forex on exchanges worldwide. Pick daily, weekly, monthly or intraday bars, or get a **one-row-per-symbol summary** with the latest quote, period return, high/low, average volume and volatility.

### What you get

- 📈 **OHLCV price bars**: open, high, low, close, adjusted close, volume
- 🗓️ Any range from 1 day to the full history (`max`), or exact start and end dates
- ⏱️ Intervals from 1 minute to 1 month
- 💵 **Dividends and splits** on the matching bar and as lists in the summary
- 🌍 US and international listings (Tokyo `7203.T`, Bursa Malaysia `1155.KL`, London `VOD.L`...), crypto (`BTC-USD`), indices (`^GSPC`), forex (`EURUSD=X`)
- 🔎 **Company name search**: type "Toyota" or "Maybank" and the Actor finds the ticker
- 📊 **Summary of each symbol**: latest price, previous close, day high/low, 52-week high/low, period return %, period high/low, average volume, volatility. Saved as the `SUMMARY` record on every run, at no charge

### Why this Actor

| | This Actor |
|---|---|
| Asset types | Stocks, ETFs, crypto, indices, forex, international listings |
| Input | Tickers **or company names** |
| Output | One item per bar **or** one item per symbol |
| Dividends and splits | Included |
| Stats | Period return, high/low, average volume, volatility |
| Exact dates | Yes (`startDate` / `endDate`) |
| Intraday limits | Checked for you. A range that is too long is shortened with a warning instead of failing |
| API key / login / proxies | Not needed |

### Use cases

- **Backtesting and quant research:** pull years of daily adjusted prices for a watchlist in one run
- **Portfolio dashboards:** schedule a daily summary run and send it to Google Sheets, Looker Studio or your database
- **Spreadsheets and reports:** export clean CSV/Excel price history without copying from websites
- **AI / LLM pipelines:** feed structured price history and summary stats into agents or RAG
- **Dividend tracking:** list every dividend and split for a set of tickers

### Input example

```json
{
  "symbols": ["AAPL", "MSFT", "BTC-USD", "^GSPC", "EURUSD=X", "7203.T", "1155.KL"],
  "searchQueries": ["Toyota", "Maybank"],
  "range": "1y",
  "interval": "1d",
  "outputMode": "bars",
  "includeEvents": true,
  "adjustedClose": true
}
```

Use `startDate` / `endDate` (YYYY-MM-DD) instead of `range` for an exact window:

```json
{ "symbols": ["AAPL"], "startDate": "2020-08-24", "endDate": "2020-09-04", "interval": "1d" }
```

#### Interval limits (set by Yahoo)

| Interval | How far back | Longest window per run |
|---|---|---|
| `1m` | ~30 days | 8 days (range `1d` or `5d`) |
| `5m`, `15m`, `30m` | 60 days | range up to `1mo` |
| `60m` | 730 days | range up to `1y` |
| `1d`, `1wk`, `1mo` | full history | any range, including `max` |

If you ask for more than Yahoo allows (for example `1m` bars for `1y`), the Actor shortens the range to the longest allowed one and logs a warning.

### Output example: price bars

Real items from a local test run on 2026-11-07 (`range: "1y"`, `interval: "1d"`):

```json
{
  "symbol": "AAPL",
  "date": "2026-11-05T14:30:00.000Z",
  "timestamp": 1793889000,
  "open": 353.89,
  "high": 355.38,
  "low": 342.06,
  "close": 344.17,
  "adjClose": 344.17,
  "volume": 75678900,
  "currency": "USD",
  "exchange": "NasdaqGS",
  "timezone": "America/New_York",
  "interval": "1d",
  "dividend": null,
  "split": null
}
```

A bar with a split (`startDate: "2020-08-24"`, `endDate: "2020-09-04"`):

```json
{
  "symbol": "AAPL",
  "date": "2020-08-31T13:30:00.000Z",
  "timestamp": 1598880600,
  "open": 127.58,
  "high": 131,
  "low": 126,
  "close": 129.04,
  "adjClose": 125.0575,
  "volume": 225702700,
  "currency": "USD",
  "exchange": "NasdaqGS",
  "timezone": "America/New_York",
  "interval": "1d",
  "dividend": null,
  "split": "4:1"
}
```

`date` is the bar's start time in UTC. When you use `searchQueries`, each bar also has a `searchQuery` field.

### Output example: summary mode

`"outputMode": "summary"`, `range: "1y"`, `interval: "1d"` (real local test output; dividends list shortened):

```json
{
  "symbol": "AAPL",
  "name": "Apple Inc.",
  "exchange": "NasdaqGS",
  "instrumentType": "EQUITY",
  "currency": "USD",
  "timezone": "America/New_York",
  "regularMarketPrice": 342.37,
  "previousClose": 344.17,
  "dayChangePct": -0.523,
  "dayHigh": 345.79,
  "dayLow": 338.3,
  "dayVolume": 43750861,
  "fiftyTwoWeekHigh": 355.38,
  "fiftyTwoWeekLow": 243.42,
  "regularMarketTime": "2026-11-06T21:00:01.000Z",
  "firstTradeDate": "1980-12-12T14:30:00.000Z",
  "range": "1y",
  "interval": "1d",
  "periodStart": "2025-11-07T14:30:00.000Z",
  "periodEnd": "2026-11-06T14:30:00.000Z",
  "bars": 251,
  "periodOpen": 269.8,
  "periodClose": 342.37,
  "periodReturnPct": 27.53,
  "periodHigh": 355.38,
  "periodLow": 243.42,
  "avgVolume": 47980084,
  "volatilityPct": 24.9,
  "volatilityAnnualized": true,
  "dividends": [
    { "date": "2025-11-10T14:30:00.000Z", "amount": 0.26 },
    { "date": "2026-08-10T13:30:00.000Z", "amount": 0.27 }
  ],
  "splits": []
}
```

A company-name search (`"searchQueries": ["Maybank"]`, `range: "3mo"`, `interval: "1wk"`) adds the search hit:

```json
{
  "symbol": "1155.KL",
  "name": "Malayan Banking Berhad",
  "exchange": "Kuala Lumpur",
  "currency": "MYR",
  "regularMarketPrice": 10.12,
  "periodReturnPct": -5.24,
  "volatilityPct": 8.44,
  "dividends": [{ "date": "2026-09-23T01:00:00.000Z", "amount": 0.31 }],
  "searchHit": {
    "query": "Maybank",
    "symbol": "1155.KL",
    "name": "Malayan Banking Berhad",
    "quoteType": "EQUITY",
    "exchange": "KLS",
    "exchangeName": "Kuala Lumpur Stock Exchange",
    "sector": "Financial Services",
    "industry": "Banks—Regional",
    "otherMatches": [{ "symbol": "BNII.JK", "name": "PT Bank Maybank Indonesia Tbk", "exchange": "Jakarta", "quoteType": "EQUITY" }]
  }
}
```

**How the stats are calculated**

- `periodReturnPct`: last close ÷ first close in the period, minus 1 (unadjusted closes)
- `periodHigh` / `periodLow`: highest high and lowest low of the bars
- `avgVolume`: mean volume per bar (forex has no volume, so 0)
- `volatilityPct`: standard deviation of bar-to-bar close returns. Annualized for daily (×√252, crypto ×√365), weekly (×√52) and monthly (×√12) bars; not annualized for intraday bars (`volatilityAnnualized: false`)
- `previousClose`: taken from the chart data, or worked out from today's change % when Yahoo doesn't send it

Export to JSON, CSV, Excel, or connect to Google Sheets, Make, Zapier, n8n or your own code through the Apify API.

### SUMMARY record

Every run writes the per-symbol summary to **Storage → Key-value store → SUMMARY**, in both output modes. You are not charged for it. Symbols or names that could not be found are listed in the **FAILED** record and are not charged.

### Pricing

Pay per result: **you pay only for items saved to the dataset** (one price bar, or one symbol in summary mode). The SUMMARY and FAILED records are free, and unknown symbols cost nothing. Set a **maximum cost per run** in the run options and the Actor stops when it is reached.

### Limits (please read)

- **Data source:** public Yahoo Finance chart and search endpoints. This Actor is not affiliated with or endorsed by Yahoo. Yahoo can change or limit these endpoints at any time.
- **Delayed data:** quotes and bars may be delayed (often 15+ minutes for stock exchanges) and can contain gaps or errors. Today's daily bar is filled from the latest quote, so it changes until the market closes.
- **Not for trading decisions.** Do not use this data for live or automated trading.
- **No fundamentals:** no financial statements, earnings, ratios, analyst targets, options or company profiles. Only price history, the latest quote fields from the chart data, dividends and splits.
- **Intraday limits** are set by Yahoo (see the table above). `adjClose` is only available for daily, weekly and monthly bars.
- Company name search uses Yahoo's best match. Check the `searchHit` / `otherMatches` fields, or use the exact ticker.

### Disclaimer

**This is not financial advice.** The data is provided as is, for information and research only, with no guarantee of accuracy, completeness or timeliness. Check prices with an official source before you make any financial decision.

### Using an AI agent?

The same data is available as an MCP server for Claude, Cursor, VS Code, n8n and other AI clients: [Finance MCP: Stock, ETF & Crypto Prices, Returns, Risk](https://apify.com/rasareka/finance-mcp). Your agent asks in plain English and gets compact answers and summaries, billed per call.

### FAQ

**Do I need a Yahoo account or API key?**
No. You only need an Apify account.

**Which symbol format should I use?**
The same one Yahoo Finance uses: exchange suffix for non-US listings (`7203.T`, `1155.KL`, `VOD.L`), `-USD` for crypto, `^` for indices, `=X` for forex. If you're not sure, put the company name in `searchQueries`.

**How many symbols can I run at once?**
As many as you like. Requests are paced (about 300 ms apart) and retried automatically on rate limits or server errors.

**Is this legal?**
The Actor reads publicly available market data, with no login and no personal data. You are responsible for how you use the data and for following Yahoo's terms and any data licensing rules that apply to you. The output contains no personal data, so GDPR is not a concern for the data itself.

# Actor input Schema

## `symbols` (type: `array`):

Yahoo Finance tickers. Stocks (AAPL), ETFs (SPY), crypto (BTC-USD), indices (^GSPC), forex (EURUSD=X) and international listings with the exchange suffix (7203.T Tokyo, 1155.KL Bursa Malaysia, VOD.L London, RELIANCE.NS India).

## `searchQueries` (type: `array`):

Don't know the ticker? Enter company names (e.g. "Toyota", "Maybank"). Each is looked up with Yahoo Finance search and the best match is added to the run. The search hit (symbol, name, exchange, sector, other matches) is included in the summary.

## `range` (type: `string`):

How far back to go. Ignored when Start date is set. Intraday intervals have shorter limits (see Interval); a range that is too long is shortened automatically with a warning.

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

Size of each price bar. Yahoo limits intraday data: 1m only for the last ~30 days and max 8 days per run (range 1d or 5d); 5m/15m/30m only for the last 60 days (range up to 1mo); 60m for the last 730 days (range up to 1y). Daily, weekly and monthly bars go back to the first trade date.

## `startDate` (type: `string`):

Exact start date (YYYY-MM-DD, UTC). Overrides Range. Sent to Yahoo as period1.

## `endDate` (type: `string`):

Exact end date (YYYY-MM-DD, UTC, inclusive). Needs a start date. Defaults to now. Sent to Yahoo as period2.

## `outputMode` (type: `string`):

"Price bars" saves one dataset item per OHLCV bar. "Summary" saves one item per symbol: latest quote, period return, high/low, average volume, volatility, dividends and splits. The SUMMARY record in the key-value store is written in both modes.

## `includeEvents` (type: `boolean`):

Fetch dividend and stock split events. They appear on the matching bar (dividend, split) and as lists in the summary.

## `adjustedClose` (type: `boolean`):

Add the adjClose field (close adjusted for splits and dividends). Only available for daily, weekly and monthly bars; null for intraday bars.

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "MSFT",
    "BTC-USD",
    "^GSPC",
    "EURUSD=X"
  ],
  "range": "1y",
  "interval": "1d",
  "outputMode": "bars",
  "includeEvents": true,
  "adjustedClose": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (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 = {
    "symbols": [
        "AAPL",
        "MSFT",
        "BTC-USD",
        "^GSPC",
        "EURUSD=X"
    ]
};

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

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

```

## MCP server setup

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

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/tTG1WHchy43uY9qPK/builds/rgDx2Cj8f5fgaKdNm/openapi.json
