# Yahoo Finance Historical Prices Scraper ($0.5/1K rows) (`tamnt67/yahoo-finance-history-scraper`) Actor

Yahoo Finance historical prices scraper for stock prices: date, open, high, low, close, adjusted close, volume, dividends and splits. Takes symbols of stocks, ETFs, indices, crypto or currency pairs, a date range and an interval. Use it to build OHLC price history for backtests or charts.

- **URL**: https://apify.com/tamnt67/yahoo-finance-history-scraper.md
- **Developed by:** [Tam Ng.](https://apify.com/tamnt67) (community)
- **Categories:** Automation, 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.35 / 1,000 price rows

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 Historical Prices Scraper

Download historical prices from Yahoo Finance for stocks, ETFs, indices, crypto and currency pairs, with no login and no API key, for $0.50 per 1,000 price rows on the Free plan, down to $0.35 on higher plans.

Give it a list of symbols, pick a range and an interval, and get one row per symbol and period with open, high, low, close, adjusted close and volume, plus dividends and stock splits on the days they happened.

### What you can do with it

- **Backtest trading strategies.** Get years of daily, weekly or monthly prices for many symbols in one run.
- **Track a portfolio.** Schedule a daily run with the 5-day range and append the new rows to your own table.
- **Feed dashboards and spreadsheets.** Send clean price rows to Google Sheets, Excel, a database or a BI tool.
- **Build machine-learning datasets.** Export long price histories with adjusted close and volume as CSV or JSON.
- **Study dividends and splits.** The `dividend` and `split` fields show the amount or ratio on the exact day it happened.
- **Compare asset classes.** Mix stocks, indices such as `^GSPC`, crypto such as `BTC-USD` and FX pairs such as `EURUSD=X` in one run.

### Output fields

One row per symbol and period. Example values come from a real run for AAPL with the daily interval.

| Field | Example |
|-------|---------|
| `symbol` / `name` | AAPL / Apple Inc. |
| `date` | 2025-11-10 (trading day in the exchange's time zone) |
| `open` / `high` / `low` / `close` | 268.959991 / 273.730011 / 267.459991 / 269.429993 |
| `adjClose` | 268.698608 (close adjusted for dividends and splits) |
| `volume` | 41312400 |
| `dividend` / `split` | 0.26 / null (amount paid or ratio such as 4:1 on that day, otherwise null) |
| `currency` / `exchange` / `instrumentType` | USD / NasdaqGS / EQUITY |
| `interval` | 1d |
| `timestamp` / `scrapedAt` | 2025-11-10T14:30:00.000Z / 2026-11-10T07:53:29.543Z |
| `exchangeTime` | 2025-11-10 09:30 (date and time in the exchange's time zone, useful for intraday rows) |
| `session` | null for daily and longer rows; regular, pre or post for intraday rows |

With **What to get** set to **Current quote**, each symbol gives one row with `recordType` (quote), `symbol`, `name`, `price`, `previousClose`, `change`, `changePercent`, `dayHigh`, `dayLow`, `volume`, `fiftyTwoWeekHigh`, `fiftyTwoWeekLow`, `currency`, `exchange`, `instrumentType`, `exchangeTimezone`, `marketTime`, `firstTradeDate` and `scrapedAt`.

Download results as JSON, CSV, Excel or XML, or read them through the Apify API.

### Example output

One real row from a run for AAPL with the daily interval:

```json
{
  "symbol": "AAPL",
  "name": "Apple Inc.",
  "date": "2025-11-10",
  "open": 268.959991,
  "high": 273.730011,
  "low": 267.459991,
  "close": 269.429993,
  "adjClose": 268.698608,
  "volume": 41312400,
  "dividend": 0.26,
  "split": null,
  "currency": "USD",
  "exchange": "NasdaqGS",
  "instrumentType": "EQUITY",
  "interval": "1d",
  "timestamp": "2025-11-10T14:30:00.000Z",
  "scrapedAt": "2026-11-10T07:53:29.543Z"
}
```

### How to use

1. Add **Symbols** exactly as Yahoo Finance writes them: `AAPL`, `BTC-USD`, `EURUSD=X`, `^GSPC`, `VNM.VN`, `7203.T`.
2. Choose the **Range** (1 day up to all available) and the **Interval** (1 minute up to monthly), or set an exact **Start date** and **End date**.
   Optional: **Include pre- and post-market** for intraday rows, **Only dividend and split days**, **Add symbols from Yahoo lists** (trending, day gainers, most active and other screeners), and **What to get**: **Current quote** for one snapshot row per symbol.
3. Click **Start** and download the dataset as JSON, CSV or Excel, or read it through the API.

#### Example input

```json
{
  "symbols": ["AAPL", "MSFT", "BTC-USD", "^GSPC"],
  "range": "5y",
  "interval": "1d",
  "proxyConfiguration": { "useApifyProxy": true }
}
```

Tips:

- One year of daily prices is about 250 rows per stock. Use the weekly or monthly interval for long ranges to pay less.
- Schedule a daily run with the `5d` range to keep a table up to date.
- Symbols are turned into upper case, and the same symbol listed twice is read only once.

### Pricing and cost examples

You pay per price row saved to the dataset ("Price row" event). Platform usage and proxy traffic are included in the per-row price.

| Apify plan | Price per 1,000 price rows |
|------------|----------------------------|
| Free (default price) | $0.50 |
| Bronze | $0.45 |
| Silver | $0.40 |
| Gold, Platinum, Diamond | $0.35 |

Cost examples on the Free plan:

- 100 rows ≈ $0.05
- 1 stock, 1 year of daily prices (about 250 rows) ≈ $0.13
- 10,000 rows ≈ $5.00 (≈ $3.50 on Gold and higher plans)

The Apify Free plan includes $5 of platform credit every month. Spent only on this Actor, that covers about 10,000 price rows per month, for example about 40 stocks with one year of daily prices.

You are charged only for rows saved to the dataset. A symbol that Yahoo Finance does not know, a symbol with no prices in the chosen range, or a symbol whose request still fails after 4 attempts saves nothing and is not charged. Periods where Yahoo returns neither an open nor a close price are skipped and not charged. To set a hard cap, enter a maximum total charge per run in the run options. The Actor stops as soon as that limit is reached.

### Use it via API, on a schedule, or from an AI agent

**JavaScript** (`npm install apify-client`):

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('tamnt67/yahoo-finance-history-scraper').call({
    symbols: ['AAPL', 'BTC-USD'],
    range: '1y',
    interval: '1d',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("tamnt67/yahoo-finance-history-scraper").call(run_input={
    "symbols": ["AAPL", "BTC-USD"],
    "range": "1y",
    "interval": "1d",
})

items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

**cURL** (runs the Actor and returns the rows in one call):

```bash
curl -X POST "https://api.apify.com/v2/acts/tamnt67~yahoo-finance-history-scraper/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"symbols": ["AAPL"], "range": "1mo", "interval": "1d"}'
```

The sync endpoint waits for the run to finish, so use it for small runs and the client libraries for large ones.

**Schedules:** create an Apify Schedule for this Actor or a saved task to fetch the last 5 days every evening and keep your price table current.

**AI agents:** the Apify MCP server at https://mcp.apify.com lets AI assistants such as Claude or Cursor run this Actor and read its results.

### FAQ

#### How much does Yahoo Finance Historical Prices Scraper cost?

Yahoo Finance Historical Prices Scraper costs $0.50 per 1,000 price rows on the Free plan and $0.45, $0.40 or $0.35 per 1,000 on higher Apify plans. One stock with one year of daily prices is about 250 rows, or about $0.13 on the Free plan. The Free plan's $5 monthly credit covers about 10,000 rows.

#### How many results do I get per symbol?

Yahoo Finance Historical Prices Scraper returns one row per trading period in the chosen range: about 250 rows per year of daily prices for a stock, about 52 per year with the weekly interval and 12 with the monthly interval. Crypto and FX pairs can have more daily rows because they trade on more days.

#### How can I get more results?

Choose a longer **Range**, up to "All available", use the daily interval, or add more symbols. Yahoo Finance Historical Prices Scraper reads every row Yahoo Finance publishes for that range; it cannot go back further than Yahoo's own history for a symbol.

#### Can I run it on a schedule or through the API?

Yes. Yahoo Finance Historical Prices Scraper works with Apify Schedules for daily or weekly runs, and with the Apify API through the JavaScript and Python clients or a single cURL call. See the API section above for working examples.

#### How fresh is the data?

Yahoo Finance Historical Prices Scraper reads Yahoo Finance live at the time of each run. Nothing is cached. Prices come as Yahoo Finance publishes them and may be delayed, and the row for the current day can change until the market closes.

#### Is it legal to scrape Yahoo Finance?

Yahoo Finance Historical Prices Scraper collects only publicly visible price data, without logging in. You are responsible for how you use the data, including complying with Yahoo's terms of service and any data licensing rules that apply to you. This is not legal advice. If you are unsure, ask a lawyer.

### Limitations

- Fundamentals, financial statements, options, analyst ratings, holders and news are not included: Yahoo serves them only to sessions with a login-style cookie and crumb, which this Actor does not use.
- Yahoo keeps 1-minute prices for about 7 days and other intraday intervals for about 60 days (1 hour: about 2 years); older intraday requests return no rows.
- **Current quote** comes from Yahoo's chart data and may be delayed like the website. `previousClose` is the previous session's close.
- **Only dividend and split days** works best with the daily interval: with weekly or monthly rows Yahoo may date the event inside the period, so it is not always matched.
- Prices come as Yahoo Finance publishes them and may be delayed. This is not investment advice.
- Not affiliated with Yahoo.
- Range, dates and interval apply to every symbol in the same run.
- When Yahoo gives no adjusted close for a period, `adjClose` equals `close`.
- `dividend` and `split` are null on days without such an event.
- If a symbol's request still fails after 4 attempts, that symbol is skipped and the run moves on.

### Changelog

- 1.0 update (2026-11-23): new intraday intervals (1 minute to 90 minutes, 1 hour) and a 1-day range, exact **Start date** / **End date**, **Include pre- and post-market**, **Only dividend and split days**, **Add symbols from Yahoo lists** (trending and screeners) and a **Current quote** mode; new output fields `exchangeTime` and `session`. Existing inputs and fields work as before.
- 1.0 update (2026-11-19): an API call that leaves out `symbols` no longer gets the example value added; the example is used only when the run has no input source at all.
- 1.0 (2026-11-19): First stable release.

### Integrations

Works with every Apify integration: API, webhooks, Zapier, Make, Google Sheets, Slack, n8n, LangChain and the Apify MCP server.

### Support

Found a problem or missing field? Report problems in the Issues tab of this Actor.

# Actor input Schema

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

Ticker symbols as written on Yahoo Finance, for example AAPL, MSFT, BTC-USD, EURUSD=X or ^GSPC.

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

Price history rows (default), or one current quote row per symbol: price, previous close, change, day and 52-week range, volume.

## `symbolsFrom` (type: `array`):

Optional. Also add the symbols of these public Yahoo lists: trending, day_gainers, day_losers, most_actives, undervalued_growth_stocks, growth_technology_stocks, aggressive_small_caps, small_cap_gainers, most_shorted_stocks, undervalued_large_caps.

## `maxSymbolsFromList` (type: `integer`):

How many symbols to take from each list in Add symbols from Yahoo lists.

## `trendingRegion` (type: `string`):

Country code for the trending list, for example US, GB, DE or IN.

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

How far back to go. Ignored when Start date or End date is set.

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

Length of each price row. Yahoo keeps 1-minute prices for the last 7 days and other intraday intervals for the last 60 days (1 hour: 730 days).

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

Optional, YYYY-MM-DD. With a start or end date the Actor uses that exact period instead of Range. Without End date, the period ends now.

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

Optional, YYYY-MM-DD, included. Without Start date, the period starts at the first available price.

## `includePrePost` (type: `boolean`):

For intraday intervals, also return pre-market and after-hours prices (US stocks). The session field says which is which.

## `onlyDividendsAndSplits` (type: `boolean`):

Keep only rows with a dividend or a split, for a dividend and split history. Works best with the daily interval and a long range.

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

Proxy used for the requests. The default datacenter proxy works.

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "MSFT",
    "BTC-USD"
  ],
  "mode": "history",
  "maxSymbolsFromList": 25,
  "trendingRegion": "US",
  "range": "1mo",
  "interval": "1d",
  "includePrePost": false,
  "onlyDividendsAndSplits": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `prices` (type: `string`):

Dataset with one record per result.

## `pricesCsv` (type: `string`):

The same dataset exported as CSV.

# 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"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tamnt67/yahoo-finance-history-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/5QWntfwnbjNaSzHtq/builds/dsxBYZDAwxOKPRNKV/openapi.json
