# Yahoo Finance Stock Data API & Stock Price Scraper (`pink_comic/yahoo-finance-stock-data`) Actor

Yahoo Finance scraper/API for current and historical stock prices, OHLCV candles, quotes, volume, 52-week ranges and multi-ticker exports. Covers stocks, ETFs, crypto, forex, indices and commodities for trading, backtesting, portfolio tracking and market research. No Yahoo API key required.

- **URL**: https://apify.com/pink\_comic/yahoo-finance-stock-data.md
- **Developed by:** [Ava Torres](https://apify.com/pink_comic) (community)
- **Categories:** AI, Developer tools, Agents
- **Stats:** 55 total users, 11 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 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?

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 Stock Data API & Stock Price Scraper

Fetch point-in-time quotes and historical price data from Yahoo Finance for ticker symbols available through its public chart endpoint. Each paid symbol row includes nested OHLCV (Open, High, Low, Close, Volume) history, quote metadata, exact source URL, and fetch time.

Use stocks (AAPL), ETFs (SPY), cryptocurrencies (BTC-USD), forex (EURUSD=X), commodities (GC=F), or market indices (^GSPC). No Yahoo API key or proxy is required.

### What data do you get?

| Field | Description |
|-------|-------------|
| Symbol and names | Ticker plus short/long instrument names when Yahoo reports them |
| Instrument metadata | Currency, exchange, exchange code, instrument type, and timezone |
| Quote metadata | Regular-market price, previous completed interval close, chart previous close, and 52-week range |
| OHLCV history | Nested date/time, open, high, low, close, and volume points for the requested range/interval |
| Provenance | Exact Yahoo chart URL, UTC fetch time, requested date range, granularity, and data-point count |

Yahoo can omit fields for some instruments or intervals. Missing/zero source values are not proof that a security, price, or volume does not exist.

### Use cases

- **Investment research** -- Analyze price trends, volatility, and trading patterns for any stock
- **Quantitative analysis** -- Feed OHLCV data into algorithmic trading models and backtesting systems
- **Portfolio tracking** -- Monitor multiple stocks, ETFs, and crypto positions
- **Financial research support** -- Export source-linked historical price observations for further review
- **Academic research** -- Bulk price data for finance and economics research
- **Market screening** -- Compare price performance across sectors and indices

### How to use

1. Enter one or more ticker symbols (e.g., AAPL, MSFT, BTC-USD)
2. Choose a date range (1 day to max history) and data interval (1 minute to 3 months)
3. Run the actor and get structured JSON with full OHLCV price history

The default AAPL / one-month / daily run returns one paid dataset item and costs at most **$0.0021**.

### Pricing

$0.002 per returned symbol plus the actor-start event (minimum $0.0001). Example maximum charges at the default memory:

| Returned symbol rows | Maximum charge |
|----------------------|----------------|
| 1 (default) | $0.0021 |
| 10 | $0.0201 |
| 50 | $0.1001 |
| 500 | $1.0001 |

`maxResults` is a total symbol-row cap. Each paid row includes all nested history returned for that symbol. There is no subscription; the actor-start event is the per-run minimum.

### Input examples

#### Get daily prices for major tech stocks

```json
{
    "symbols": ["AAPL", "MSFT", "GOOGL", "AMZN", "NVDA"],
    "dateRange": "3mo",
    "interval": "1d"
}
```

#### Get 5-year weekly data for an ETF

```json
{
    "symbols": ["SPY"],
    "dateRange": "5y",
    "interval": "1wk"
}
```

#### Cryptocurrency daily prices

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

#### Intraday data (5-minute bars)

```json
{
    "symbols": ["TSLA"],
    "dateRange": "5d",
    "interval": "5m"
}
```

#### Market indices

```json
{
    "symbols": ["^GSPC", "^DJI", "^IXIC", "^RUT"],
    "dateRange": "1mo",
    "interval": "1d"
}
```

### Output example

```json
{
    "symbol": "AAPL",
    "shortName": "Apple Inc.",
    "currency": "USD",
    "exchange": "NasdaqGS",
    "exchangeName": "NMS",
    "instrumentType": "EQUITY",
    "regularMarketPrice": 246.63,
    "previousClose": 247.10,
    "fiftyTwoWeekHigh": 260.10,
    "fiftyTwoWeekLow": 169.21,
    "dataGranularity": "1d",
    "dateRange": "1mo",
    "timezone": "America/New_York",
    "fetchedAt": "2026-07-23T14:00:00Z",
    "sourceUrl": "https://query1.finance.yahoo.com/v8/finance/chart/AAPL?range=1mo&interval=1d&includePrePost=false",
    "totalDataPoints": 21,
    "priceHistory": [
        {
            "date": "2026-03-02",
            "open": 243.07,
            "high": 248.21,
            "low": 241.88,
            "close": 247.10,
            "volume": 42150600
        }
    ]
}
```

### Input parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `symbols` | string\[] | `["AAPL"]` | Ticker symbols to fetch. Supports stocks, ETFs, crypto, forex, indices, and commodities available from Yahoo's chart endpoint. |
| `dateRange` | string | `"1mo"` | Date range for historical data. Options: 1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max. |
| `interval` | string | `"1d"` | Data point interval. Options: 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d, 5d, 1wk, 1mo, 3mo. Intraday intervals only work with short date ranges (1d-5d). |
| `maxResults` | integer | `1` | Total paid symbol-row cap, from 1 to 500. Apify's maximum-total-charge setting can lower it further. |

### Supported date range and interval combinations

| Date Range | Compatible Intervals |
|------------|---------------------|
| 1d, 5d | 1m, 2m, 5m, 15m, 30m, 60m, 90m, 1h, 1d |
| 1mo | 5m, 15m, 30m, 60m, 90m, 1h, 1d, 1wk |
| 3mo, 6mo | 1d, 5d, 1wk, 1mo |
| 1y, 2y, 5y, 10y, ytd, max | 1d, 5d, 1wk, 1mo, 3mo |

### Pricing

This actor uses pay-per-result pricing on Apify:

- **Per returned symbol:** $0.002, including its nested price history
- **Actor start:** $0.0001 per GB, with one minimum event
- **Default first run:** one symbol, up to $0.0021 total

If a buyer sets a maximum-total-charge budget, the actor trims the total symbol count before fetching. Bulk output is persisted in size-bounded batches rather than one oversized dataset request.

### Data source and interpretation limits

Data comes from Yahoo Finance's public chart endpoint. Availability and retention vary by symbol, instrument, exchange, range, and interval.

- Results are point-in-time publisher observations, not exchange-certified records, a live feed, or investment advice.
- `regularMarketPrice` may be delayed. `fetchedAt` records collection time, not the market timestamp or guaranteed freshness.
- Pre/post-market data is excluded. Historical rows contain the chart endpoint's OHLCV values; this actor does not return adjusted close, dividends, splits, fundamentals, earnings, or financial statements.
- Missing fields, zero values, or an empty interval do not prove that a security or market fact does not exist.
- Symbol formats and historical availability can change upstream. Verify material decisions against an exchange, issuer filing, or licensed market-data source.

### FAQ

**May I use this data?**
The actor accesses a public Yahoo Finance endpoint without bypassing authentication. Buyers remain responsible for Yahoo's terms, downstream licensing, and laws that apply to their use case.

**Do I need an API key?**
No. No authentication required.

**How fast is it?**
A single stock with 1 year of daily data completes in under 2 seconds. Multiple symbols are processed with rate limiting for reliability.

**Can I get real-time data?**
No guarantee is made that the result is real time. `regularMarketPrice` is the most recent value Yahoo publishes in the response and may be delayed. For intraday observations, use a short range with a compatible minute interval.

**What about after-hours data?**
Pre/post-market data is not included. Only regular market session data.

**Can I get fundamental data (P/E, revenue, etc.)?**
This actor focuses on price/volume data. For fundamental company data, use our [SEC EDGAR Company Filings](https://apify.com/pink_comic/sec-edgar-company-filings) actor.

### Integrations

Export results to any downstream system:

- **Trading platforms** -- Feed OHLCV data into backtesting and analysis tools
- **Google Sheets / Excel** -- Direct export for financial modeling
- **Zapier / Make** -- Trigger workflows on price data
- **Webhooks** -- Push to your own API or database
- **Manual export** -- Download as CSV, JSON, or Excel from the Apify Console

### Support

Found a bug or have a feature request? Open an issue on the actor page or contact us through the Apify platform.

### More Public Data Tools

This actor is part of a growing collection of public data scrapers on Apify:

- [SEC EDGAR Company Filings](https://apify.com/pink_comic/sec-edgar-company-filings) -- 10-K, 10-Q, 8-K, insider trading for all public companies
- [SEC Insider Trading Tracker](https://apify.com/pink_comic/sec-insider-trading-tracker) -- Form 4 filings, insider buys/sells
- [FEC Campaign Finance](https://apify.com/pink_comic/fec-campaign-finance-search) -- 50M+ individual donations, PACs, candidate fundraising
- [WHOIS Domain Lookup](https://apify.com/pink_comic/whois-domain-lookup) -- Domain registration, expiry, registrar info
- [US Business Entity Search](https://apify.com/pink_comic/us-business-entity-search) -- official-source business registry and KYB evidence

**[See all AutoScrape actors](https://apify.com/pink_comic)**

# Actor input Schema

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

Ticker symbols to fetch from Yahoo Finance. The one-symbol default costs at most $0.002 plus the minimum $0.0001 start event. Supports stocks (AAPL), ETFs (SPY), crypto (BTC-USD), forex (EURUSD=X), indices (^GSPC), and commodities (GC=F).

## `dateRange` (type: `string`):

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

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

Time between data points. Intraday intervals (1m-1h) only work with short date ranges (1d-5d).

## `maxResults` (type: `integer`):

Total maximum ticker-symbol rows to return at $0.002 per item. Each paid row includes its nested OHLCV history. Default: one row (up to $0.0021 including the minimum start event).

## Actor input object example

```json
{
  "symbols": [
    "AAPL"
  ],
  "dateRange": "1mo",
  "interval": "1d",
  "maxResults": 1
}
```

# 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"
    ],
    "dateRange": "1mo",
    "interval": "1d",
    "maxResults": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("pink_comic/yahoo-finance-stock-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 = {
    "symbols": ["AAPL"],
    "dateRange": "1mo",
    "interval": "1d",
    "maxResults": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("pink_comic/yahoo-finance-stock-data").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"
  ],
  "dateRange": "1mo",
  "interval": "1d",
  "maxResults": 1
}' |
apify call pink_comic/yahoo-finance-stock-data --silent --output-dataset

```

## MCP server setup

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

```

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/jaGfPZgV4xgr8X9Pf/builds/Zoaat0GrLaF067pX1/openapi.json
