# Yahoo Finance Historical Price Fetcher (`gochujang/yahoo-finance-history`) Actor

Fetch OHLCV historical price data for stocks, ETFs, indices, forex, and crypto from Yahoo Finance. No API key required.

- **URL**: https://apify.com/gochujang/yahoo-finance-history.md
- **Developed by:** [Hojun Lee](https://apify.com/gochujang) (community)
- **Categories:** Business
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 item processeds

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 Historical Price Fetcher — OHLCV Data, No API Key

Download **OHLCV (open, high, low, close, volume)** historical price data for any ticker available on **Yahoo Finance** — stocks, ETFs, indices, commodities, forex pairs, and crypto. Covers everything from Apple and Tesla to BTC-USD, GC=F (Gold), or EUR=X (Euro). No API key required. Supports intraday bars (1m to 1h) and daily+ intervals (1d to 3mo) going back as far as Yahoo's history allows.

### What You Get

For each bar/candle, the actor returns:

- **OHLCV** — open, high, low, close, volume
- **Adjusted close** — split and dividend-adjusted price
- **VWAP** — (high + low + close) / 3 daily approximation
- **Change %** — percentage change vs. the previous bar
- **Date + timestamp** — ISO 8601 date and Unix timestamp
- **Metadata** — currency, exchange, instrument type

### Supported Tickers

| Asset Class | Examples |
|------------|---------|
| US Stocks | `AAPL`, `TSLA`, `NVDA`, `MSFT`, `JPM` |
| ETFs | `SPY`, `QQQ`, `GLD`, `IBIT`, `ARKK` |
| Indices | `^GSPC` (S\&P 500), `^DJI` (Dow), `^VIX` |
| Crypto | `BTC-USD`, `ETH-USD`, `SOL-USD` |
| Commodities | `GC=F` (Gold), `CL=F` (Crude Oil), `SI=F` (Silver) |
| Forex | `EUR=X`, `JPY=X`, `GBPUSD=X` |
| International | `7203.T` (Toyota), `BABA`, `NIO` |

### Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `symbols` | array | `["AAPL","MSFT","BTC-USD"]` | Yahoo Finance tickers to fetch |
| `interval` | string | `"1d"` | Bar size: `1m` / `5m` / `15m` / `1h` / `1d` / `1wk` / `1mo` |
| `range` | string | `"1y"` | How far back: `1d` / `1mo` / `6mo` / `1y` / `5y` / `10y` / `max` |

**Note:** Intraday intervals (1m–1h) are limited to recent data (1d–60d range). For long-term analysis use `1d` or `1wk` with `range=max`.

### Sample Output

```json
{
  "symbol": "AAPL",
  "date": "2025-01-15T00:00:00Z",
  "timestamp": 1736899200,
  "open": 228.50,
  "high": 232.10,
  "low": 227.80,
  "close": 231.40,
  "adj_close": 231.40,
  "volume": 52400000,
  "vwap": 230.43,
  "change_pct": 1.28,
  "currency": "USD",
  "exchange": "NMS",
  "instrument_type": "EQUITY"
}
```

### Example: Fetch 5 Years of BTC and ETH Daily Data

```json
{
  "symbols": ["BTC-USD", "ETH-USD"],
  "interval": "1d",
  "range": "5y"
}
```

### Example: Intraday — 5-Minute Bars for NVDA (Last Week)

```json
{
  "symbols": ["NVDA"],
  "interval": "5m",
  "range": "5d"
}
```

### Use Cases

- **Backtesting** — pull historical OHLCV for strategy testing in Python/R/Excel
- **Price charting** — feed data into charting libraries (Plotly, TradingView, ECharts)
- **Correlation analysis** — compare multi-asset price series over time
- **Volatility calculation** — compute rolling ATR, Bollinger Bands, VIX-style metrics
- **ETF/crypto research** — get long-term BTC, ETH, SOL, or BTC ETF price history
- **Machine learning** — build price prediction datasets without a paid data provider
- **Portfolio analytics** — reconstruct portfolio returns using historical close prices

### Notes on Data Quality

- **Adjusted close** accounts for stock splits and dividends — always use `adj_close` for return calculations
- **Gaps** — market closures (weekends, holidays) appear as missing timestamps, not null rows
- **Data freshness** — typically reflects the previous session's close plus real-time (15-min delayed) for current session
- **Crypto** — BTC-USD and other crypto pairs run 24/7 with no weekend gaps

### Pricing

Pay-per-event: **$0.001 per symbol per run** — fetch 10 symbols for $0.01 regardless of how many years of history you pull.

### FAQ

**How far back does Yahoo Finance data go?**
Varies by ticker. Most US large-cap stocks have data back to the 1980s or 1990s. BTC-USD goes back to 2014. Some tickers may have shorter history.

**Are splits and dividends handled?**
Yes — the `adj_close` field is split and dividend-adjusted. `close` is the raw unadjusted price.

**Can I fetch multiple symbols in one run?**
Yes — pass as many tickers as needed in the `symbols` array. All are fetched concurrently.

**Does this work for international exchanges?**
Yes — use Yahoo Finance's suffix notation: `7203.T` for Tokyo Stock Exchange, `HSBA.L` for London, etc.

**What is the rate limit?**
Yahoo Finance does not publish a public rate limit. The actor uses standard browser-like headers and fetches all symbols concurrently. For very large batches (100+ symbols), consider splitting into multiple runs.

***

### Related actors

- [Crypto Correlation Matrix](https://apify.com/gochujang/crypto-correlation-matrix) — Cross-asset correlation analysis for crypto/equity pairs using the same OHLCV data format
- [SEC Company Financials](https://apify.com/gochujang/sec-company-financials) — Fundamental EDGAR data to pair with Yahoo Finance price history for valuation analysis
- [CBOE Volatility Tracker](https://apify.com/gochujang/cboe-volatility-tracker) — VIX and term structure to contextualize equity and crypto price history from Yahoo

### Feedback

If this actor powers your data pipeline, a review helps others find it: [Leave a review on Apify Store](https://apify.com/gochujang/yahoo-finance-history#reviews)

***

**Keywords:** Yahoo Finance historical data, stock price history scraper, OHLCV data extractor, ETF historical prices, forex historical data, crypto price history, adjusted close prices, daily stock candles, Yahoo Finance API no key, stock price time series, financial data automation, market data scraper, ticker price history, no API key required

# Actor input Schema

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

List of Yahoo Finance ticker symbols (e.g. \['AAPL','MSFT','BTC-USD','SPY','GC=F']). Stocks, ETFs, crypto, indices, forex, and commodities all supported.

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

Candlestick interval: 1m/2m/5m/15m/30m/60m/90m/1h for intraday, 1d/5d/1wk/1mo/3mo for daily+.

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

How far back to fetch: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max.

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "MSFT",
    "BTC-USD"
  ],
  "interval": "1d",
  "range": "1y"
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gochujang/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 = {}

# Run the Actor and wait for it to finish
run = client.actor("gochujang/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 '{}' |
apify call gochujang/yahoo-finance-history --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gochujang/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/ZyIJvCcEjCREGWJeA/builds/maAglgEVAhRgaMVBg/openapi.json
