# Yahoo Finance Stock Quotes, Historical OHLCV & Dividends API (`parsegrid/yahoo-finance-scraper`) Actor

Keyless Yahoo Finance API returning live market quotes, 52-week ranges, historical OHLCV price candles, dividends, and splits across stocks, ETFs, crypto, and forex.

- **URL**: https://apify.com/parsegrid/yahoo-finance-scraper.md
- **Developed by:** [Parse Grid](https://apify.com/parsegrid) (community)
- **Categories:** Developer tools, AI, Agents
- **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 market data records

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 Stock Quotes, Historical OHLCV & Dividends API

Built by **ParseGrid**.

Keyless, zero-proxy Yahoo Finance market data API returning live market quotes, 52-week high/low ranges, historical OHLCV price candles, cash dividends, and stock splits across global equities, ETFs, market indices, cryptocurrencies, and forex pairs.

### Why Use This Yahoo Finance API

- **Zero Proxies & Zero API Keys Required**: Queries Yahoo Finance chart endpoints directly (`query1` with automatic `query2` failover, 10-second request timeouts, and exponential backoff). Runs in seconds on `256 MB` memory without paid market-data subscriptions or residential proxy fees.
- **Stocks, ETFs, Indices, Crypto & Forex**: Pulls unified market data across US and international stocks (`AAPL`, `MSFT`, `NVDA`, `TSM`), ETFs (`SPY`, `QQQ`, `TLT`), benchmark indices (`^GSPC`, `^IXIC`, `^VIX`), cryptocurrencies (`BTC-USD`, `ETH-USD`, `SOL-USD`), and currency pairs (`EURUSD=X`, `USDJPY=X`).
- **Two Flexible Output Modes (`candles` vs `summary`)**:
  - `candles` (default): Emits one flat row per `symbol + timestamp` OHLCV bar with live quote metadata, 52-week bounds, period return percentage, and ex-dividend/split annotations attached. Ready for immediate CSV export, Google Sheets, pandas DataFrames, and SQL ingestion.
  - `summary`: Emits one compact JSON document per ticker symbol containing live quote metadata plus nested `candles`, `dividends`, and `splits` arrays. Ideal for AI agent tool calls, portfolio snapshots, and webhook payloads.
- **Clean, Verified Financial Math**: Filters incomplete/null market bars automatically, rounds prices to 4 decimals, normalizes timestamps to strict UTC ISO 8601 strings, and calculates `periodReturnPct` (`((lastClose - firstOpen) / firstOpen) * 100`) across the returned bar series.

### Supported Ticker Formats

| Asset Class | Example Symbols | Notes |
| :--- | :--- | :--- |
| **US Equities** | `AAPL`, `MSFT`, `NVDA`, `BRK-B` | NYSE and Nasdaq listed stocks |
| **ETFs & Funds** | `SPY`, `QQQ`, `IWM`, `GLD` | Equity, bond, and commodity ETFs |
| **Market Indices** | `^GSPC`, `^DJI`, `^IXIC`, `^VIX` | Prefix index tickers with `^` |
| **Cryptocurrencies** | `BTC-USD`, `ETH-USD`, `SOL-USD` | 24/7 daily and intraday bars |
| **Forex Pairs** | `EURUSD=X`, `GBPUSD=X`, `USDJPY=X` | Append `=X` for spot currency pairs |
| **Global Equities** | `7203.T`, `ASML.AS`, `SHEL.L`, `SHOP.TO` | Standard Yahoo Finance exchange suffixes |

### Input Parameters

| Field | Type | Default | Description |
| :--- | :--- | :--- | :--- |
| `symbols` | `string[]` | `["AAPL", "MSFT", "NVDA", "SPY", "BTC-USD"]` | List of Yahoo Finance ticker symbols to query. |
| `range` | `string` | `"1mo"` | Historical lookback window: `"1d"`, `"5d"`, `"1mo"`, `"3mo"`, `"6mo"`, `"1y"`, `"2y"`, `"5y"`, or `"max"`. |
| `interval` | `string` | `"1d"` | Bar interval: `"5m"`, `"15m"`, `"1h"`, `"1d"`, `"1wk"`, or `"1mo"`. |
| `outputMode` | `string` | `"candles"` | `"candles"` for one flat row per OHLCV bar, or `"summary"` for one nested object per ticker. |
| `maxCandlesPerSymbol` | `integer` | `60` | Maximum number of most-recent non-null OHLCV bars returned per symbol (`1` to `2000`). |

### Input Example

```json
{
  "symbols": [
    "AAPL",
    "NVDA",
    "SPY",
    "BTC-USD"
  ],
  "range": "1mo",
  "interval": "1d",
  "outputMode": "candles",
  "maxCandlesPerSymbol": 60
}
```

### Output Example (`candles` Mode)

```json
{
  "symbol": "AAPL",
  "shortName": "Apple Inc.",
  "longName": "Apple Inc.",
  "currency": "USD",
  "exchangeName": "NMS",
  "instrumentType": "EQUITY",
  "timezone": "EST",
  "regularMarketPrice": 228.45,
  "chartPreviousClose": 221.1,
  "fiftyTwoWeekHigh": 237.23,
  "fiftyTwoWeekLow": 164.08,
  "regularMarketVolume": 41829100,
  "periodReturnPct": 3.42,
  "date": "2026-11-12T14:30:00.000Z",
  "timestamp": 1794493800,
  "open": 226.8,
  "high": 229.15,
  "low": 226.05,
  "close": 228.45,
  "adjClose": 228.45,
  "volume": 41829100,
  "dividendAmount": null,
  "splitRatio": null,
  "candleCount": 22,
  "dividendCount": 1,
  "splitCount": 0,
  "range": "1mo",
  "interval": "1d",
  "outputMode": "candles",
  "yahooFinanceUrl": "https://finance.yahoo.com/quote/AAPL",
  "scrapedAt": "2026-11-13T20:00:00.000Z"
}
```

### Automation & AI Agent Workflows

- **Quantitative & Python Pipelines**: Pull clean daily or intraday OHLCV series across watchlists directly into pandas, Polars, DuckDB, or backtesting notebooks without maintaining brittle HTML scrapers.
- **Google Sheets, Airtable & n8n Trackers**: Schedule daily post-close runs (`range: "5d"`, `interval: "1d"`) to update portfolio sheets, treasury FX dashboards, and Slack price-movement alerts.
- **AI Research Agents & MCP Servers**: Use `outputMode: "summary"` so financial research agents receive complete ticker context (current quote, 52-week range, period return, recent candles, dividends, and splits) in a single structured tool response.

### MCP Server Integration

Connect this Actor to Claude Desktop, Cursor, or any MCP-compatible AI agent client via the Apify MCP server:

```json
{
  "tool": "call-actor",
  "arguments": {
    "actor": "parsegrid/yahoo-finance-scraper",
    "input": {
      "symbols": ["AAPL", "MSFT", "NVDA", "BTC-USD"],
      "range": "1mo",
      "interval": "1d",
      "outputMode": "summary",
      "maxCandlesPerSymbol": 30
    }
  }
}
```

# Actor input Schema

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

Yahoo Finance ticker symbols across stocks (AAPL, MSFT, NVDA), ETFs (SPY, QQQ), indices (^GSPC, ^VIX), crypto (BTC-USD, ETH-USD), and forex (EURUSD=X).

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

Lookback period for historical OHLCV bars, dividends, and stock splits.

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

Bar aggregation interval. Intraday intervals (5m, 15m, 1h) work best with shorter ranges such as 1d, 5d, or 1mo.

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

Choose 'candles' for one flat row per symbol and timestamp OHLCV bar with quote metadata attached (ideal for CSV, Sheets, Python, and AI agents), or 'summary' for one object per symbol with nested candles, dividends, and splits arrays.

## `maxCandlesPerSymbol` (type: `integer`):

Maximum number of most-recent non-null OHLCV candles to emit per symbol (1 to 2000).

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "MSFT",
    "NVDA",
    "SPY",
    "BTC-USD"
  ],
  "range": "1mo",
  "interval": "1d",
  "outputMode": "candles",
  "maxCandlesPerSymbol": 60
}
```

# Actor output Schema

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

JSON dataset items containing OHLCV price bars or per-symbol summaries with 52-week ranges, dividends, and splits.

# 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",
        "NVDA",
        "SPY",
        "BTC-USD"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsegrid/yahoo-finance-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",
        "NVDA",
        "SPY",
        "BTC-USD",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("parsegrid/yahoo-finance-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",
    "NVDA",
    "SPY",
    "BTC-USD"
  ]
}' |
apify call parsegrid/yahoo-finance-scraper --silent --output-dataset

```

## MCP server setup

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