Yahoo Finance Historical Stock Price avatar

Yahoo Finance Historical Stock Price

Pricing

from $0.0001 / actor start

Go to Apify Store
Yahoo Finance Historical Stock Price

Yahoo Finance Historical Stock Price

Fetch clean historical OHLCV candles from Yahoo Finance for one or many tickers. Supports daily and intraday intervals and returns stable JSON rows in the default dataset.

Pricing

from $0.0001 / actor start

Rating

0.0

(0)

Developer

David Brown

David Brown

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

Yahoo Finance Historical OHLCV Data

Fetch clean historical OHLCV candles from Yahoo Finance for one or many ticker symbols. Results are written as stable JSON rows to the Apify default dataset, ready for backtests, dashboards, spreadsheets, and data pipelines.

Input

Input:

{
"tickers": ["AAPL", "MSFT"],
"start_date": "2024-01-02",
"end_date": "2024-01-05",
"interval": "1d",
"priceAdjustment": "adjusted"
}

start_date is inclusive. end_date is exclusive, matching yfinance behavior, so end_date: "2024-01-05" returns trading days before January 5. interval defaults to 1d. Provide one or more ticker symbols in tickers.

priceAdjustment defaults to adjusted, which applies the Yahoo Adj Close / Close ratio to Open, High, Low, and Close. Use raw if you want unadjusted Yahoo chart OHLC prices.

Supported intervals include 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, and 3mo.

Proxy retry modes:

{
"tickers": ["AAPL", "MSFT"],
"start_date": "2024-01-02",
"end_date": "2024-01-05",
"interval": "1d",
"priceAdjustment": "adjusted",
"proxyMode": "auto",
"proxyCountryCode": "US",
"proxyMaxAttempts": 5
}

proxyMode controls Apify Proxy usage:

  • auto tries Yahoo Finance directly first. If Yahoo returns 403, 429, or a 5xx response, the Actor falls back to Apify Proxy and retries with fresh proxy sessions.
  • on always sends Yahoo Finance requests through Apify Proxy.
  • off never uses Apify Proxy. A direct 403 fails immediately because retrying would reuse the same blocked IP.

proxyGroups is optional. Leave it empty to let Apify use an available proxy group, or set it to a group you know your account can access, such as ["RESIDENTIAL"].

Output

Each dataset item represents one requested ticker. The shape is intentionally close to common Yahoo Finance Actors that group quote metadata and history together:

{
"ticker": "AAPL",
"resolved_symbol": "AAPL",
"stock_info": {
"symbol": "AAPL",
"name": "N/A",
"quote_type": "EQUITY",
"sector": "N/A",
"industry": "N/A",
"market_cap": "N/A",
"current_price": 183.56,
"previous_close": "N/A",
"day_high": "N/A",
"day_low": "N/A",
"volume": 82488700,
"pe_ratio": "N/A",
"dividend_yield": "N/A",
"beta": "N/A"
},
"price_info": {
"symbol": "AAPL",
"current_price": 183.56,
"previous_close": "N/A",
"change": "N/A",
"change_percent": "N/A",
"timestamp": "2026-07-05T03:30:00.000Z"
},
"history": {
"symbol": "AAPL",
"period": "custom",
"interval": "1d",
"start": "2024-01-02",
"end": "2024-01-05",
"data": [
{
"date": "2024-01-02",
"open": 185.06,
"high": 186.33,
"low": 181.83,
"close": 183.56,
"volume": 82488700
}
]
}
}

The key-value store OUTPUT record contains a compact run summary with requested symbols, dataset item count, OHLCV row count, interval, and timestamp range.

Local Run

npm ci
npm start

Local input lives at storage/key_value_stores/default/INPUT.json. Output rows are written to storage/datasets/default.

Smoke Test

$npm run smoke:local

The smoke test clears local storage, runs the Actor with an AAPL date range, then asserts that the dataset contains real Yahoo Finance OHLCV rows with the requested symbol and interval.

If Yahoo Finance returns HTTP 403 or 429 locally, the test fails intentionally. That means the current network/IP is blocked or rate limited, not that demo data was accepted. Use the Apify smoke test below to verify the real run plus default dataset flow from Apify cloud.

Deploy To Apify

export APIFY_TOKEN="your token"
npx apify login --token "$APIFY_TOKEN"
npm run apify:push

After the push, set APIFY_ACTOR_ID to the Actor id shown by Apify, usually username/yahoo-finance-ohlcv.

Apify Smoke Test

export APIFY_TOKEN="your token"
export APIFY_ACTOR_ID="username/yahoo-finance-ohlcv"
npm run smoke:apify

This uses the stable Actor run plus default dataset flow: it waits for a successful run, fetches items from that run's dataset, and fails if the dataset is empty or does not match the requested Yahoo Finance symbol/interval.

To smoke test the Apify Proxy path:

export SMOKE_PROXY_MODE=on
export SMOKE_PROXY_GROUPS="RESIDENTIAL"
export SMOKE_PROXY_COUNTRY_CODE="US"
npm run smoke:apify

To smoke test the automatic fallback path, use SMOKE_PROXY_MODE=auto.