# Yahoo Finance Scraper — Quotes, History, Fundamentals & News (`leorochasantos/yahoo-finance-scraper`) Actor

Fast, reliable Yahoo Finance data: real-time quotes, OHLCV history, financial statements, dividends & splits, news, and symbol search. Clean flat JSON built for LLM/MCP consumption. Pick only the data blocks you need.

- **URL**: https://apify.com/leorochasantos/yahoo-finance-scraper.md
- **Developed by:** [Leonardo Santos](https://apify.com/leorochasantos) (community)
- **Categories:** Business, Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.26 / 1,000 ticker results

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/platform/actors/running/actors-in-store#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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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 Scraper — Quotes, History, Fundamentals & News

Get **structured Yahoo Finance data** for any list of tickers — real-time quotes,
historical OHLCV candles, financial statements, dividends & splits, latest news, and
symbol search — as clean, flat JSON built for spreadsheets, dashboards, and LLM/agent
pipelines. **Pick only the data blocks you need**: fewer blocks = faster and cheaper runs.

No API key, no login, no crumb tokens. Works for stocks, ETFs, indices, crypto, forex,
and futures across international exchanges.

### Why this scraper?

- ⚡ **Fast & lean** — HTTP-only (no headless browser), runs in seconds at 256 MB.
- 🎯 **Selective** — request `quote`, `history`, `dividends`, `splits`, `fundamentals`,
  or `news` per run instead of paying to fetch everything every time.
- 🧱 **Stable by design** — built exclusively on Yahoo's open JSON endpoints. It does not
  depend on the fragile cookie/crumb session flow that regularly breaks other tools.
- 🤖 **Agent-ready output** — flat, typed fields; raw numbers (no `"394.33B"` strings);
  ISO-8601 dates; absolute URLs; explicit granularity fields.
- 🌍 **Any asset class** — `AAPL`, `7203.T`, `PETR4.SA`, `SPY`, `^GSPC`, `BTC-USD`,
  `EURUSD=X`, `GC=F`.
- 🛡️ **Graceful errors** — an invalid or delisted symbol produces a per-ticker error item
  (never charged) while the rest of the batch completes normally.

### Input

```json
{
  "tickers": ["AAPL", "MSFT", "BTC-USD"],
  "dataBlocks": ["quote", "history", "news"],
  "range": "1y",
  "interval": "1d"
}
````

| Field | Description |
|---|---|
| `tickers` | Yahoo Finance symbols, one output item each |
| `dataBlocks` | Any of `quote`, `history`, `dividends`, `splits`, `fundamentals`, `news` (default `["quote"]`) |
| `range` / `interval` | History window (`1d`…`max`) and candle size (`1m`…`3mo`) |
| `startDate` / `endDate` | Custom history window (YYYY-MM-DD), overrides `range` |
| `fundamentalsGranularity` | `annual`, `quarterly`, or `both` |
| `searchQueries` | Free-text names to resolve into tickers (e.g. `"petrobras"`) |

### Output

One item per ticker (plus one per search query). Example (`quote` + `history`):

```json
{
  "type": "ticker",
  "ticker": "AAPL",
  "error": null,
  "quote": {
    "symbol": "AAPL",
    "long_name": "Apple Inc.",
    "currency": "USD",
    "exchange": "NMS",
    "full_exchange": "NasdaqGS",
    "instrument_type": "EQUITY",
    "market_price": 327.5,
    "previous_close": 325.9,
    "day_high": 328.1,
    "day_low": 324.7,
    "volume": 41855600,
    "fifty_two_week_high": 328.73,
    "fifty_two_week_low": 201.5,
    "market_time": "2026-07-15T20:00:00.000Z",
    "timezone": "America/New_York",
    "sector": "Technology",
    "industry": "Consumer Electronics"
  },
  "history": {
    "range": "1y",
    "interval": "1d",
    "start": "2025-07-16T13:30:00.000Z",
    "end": "2026-07-15T13:30:00.000Z",
    "timezone": "America/New_York",
    "candles": [
      { "date": "2025-07-16T13:30:00.000Z", "open": 234.2, "high": 236.1, "low": 233.8, "close": 235.5, "adjclose": 234.9, "volume": 39120400 }
    ]
  },
  "scraped_at": "2026-07-16T14:02:11.512Z"
}
```

The `fundamentals` block returns financial-statement line items (TotalRevenue, NetIncome,
BasicEPS, EBITDA, TotalAssets, StockholdersEquity, OperatingCashFlow, FreeCashFlow, and
more) as flat rows with `as_of_date`, `granularity`, `currency`, and raw numeric `value`.

### Pricing

Pay per result: **one `ticker-result` event per delivered item**. Error items (bad
symbols) are free. Batch hundreds of tickers in one run.

### Use cases

- 📈 **Portfolio & watchlist tracking** — schedule a daily run over your holdings.
- 🔬 **Quant research / backtesting** — bulk OHLCV history across asset classes.
- 🏦 **Fundamental screening** — statement line items as tidy rows, annual or quarterly.
- 🤖 **AI & LLM apps** — clean typed JSON for agents, RAG pipelines, and MCP tools.
- 📰 **Market monitoring** — per-ticker news headlines with publisher and timestamp.

### FAQ

**Do I need a Yahoo account or API key?** No. The actor reads publicly accessible data.

**Which symbols work?** Anything Yahoo Finance quotes: equities (including international
suffixes like `.T`, `.SA`, `.L`, `.NS`), ETFs, indices (`^GSPC`), crypto (`BTC-USD`),
FX pairs (`EURUSD=X`), and futures (`GC=F`). Use `searchQueries` to resolve names to
symbols first.

**How far back does history go?** As far as Yahoo has data (decades for major stocks
with `range: "max"`). Intraday intervals are limited by Yahoo to recent windows.

**What about options chains or analyst recommendations?** Not included — those live
behind Yahoo's session gate and are deliberately out of scope for reliability. If you
need them, tell us in the Issues tab.

**Is this legal?** The actor retrieves publicly accessible market data. Use it
responsibly and respect Yahoo's Terms of Service and applicable laws in your jurisdiction.

***

*This Actor is an independent tool and is **not affiliated with, endorsed by, or
sponsored by Yahoo**. "Yahoo" and "Yahoo Finance" are trademarks of Yahoo Inc. Data is
provided by Yahoo Finance and is intended for research and informational purposes; it is
not investment advice.*

# Actor input Schema

## `tickers` (type: `array`):

Yahoo Finance symbols to fetch — stocks (AAPL, 7203.T, PETR4.SA), ETFs (SPY), indices (^GSPC), crypto (BTC-USD), FX (EURUSD=X), futures (GC=F). One output item per ticker.

## `dataBlocks` (type: `array`):

Which data to fetch per ticker. Only requested blocks are fetched and returned — fewer blocks = faster, cheaper runs.

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

Window for the history block (ignored unless "history" is selected; overridden by start/end dates).

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

Candle size for the history block. Intraday intervals (1m–1h) are limited by Yahoo to recent windows (e.g. 1m ≈ last 7 days).

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

Custom history window start, YYYY-MM-DD. Overrides "History range".

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

Custom history window end, YYYY-MM-DD (defaults to today when only a start date is given).

## `fundamentalsGranularity` (type: `string`):

Reporting periods for the fundamentals block.

## `searchQueries` (type: `array`):

Free-text company/asset names to resolve into tickers (e.g. "petrobras"). One search item per query, with exchange/sector metadata per match. Can be used alone or together with tickers.

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

Proxy to use. Default Apify datacenter proxy works reliably.

## Actor input object example

```json
{
  "tickers": [
    "AAPL",
    "MSFT"
  ],
  "dataBlocks": [
    "quote"
  ],
  "range": "1mo",
  "interval": "1d",
  "fundamentalsGranularity": "annual",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "tickers": [
        "AAPL",
        "MSFT"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("leorochasantos/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 = { "tickers": [
        "AAPL",
        "MSFT",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("leorochasantos/yahoo-finance-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "tickers": [
    "AAPL",
    "MSFT"
  ]
}' |
apify call leorochasantos/yahoo-finance-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=leorochasantos/yahoo-finance-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Yahoo Finance Scraper — Quotes, History, Fundamentals & News",
        "description": "Fast, reliable Yahoo Finance data: real-time quotes, OHLCV history, financial statements, dividends & splits, news, and symbol search. Clean flat JSON built for LLM/MCP consumption. Pick only the data blocks you need.",
        "version": "0.1",
        "x-build-id": "mdyHnxzESUg4sWKFY"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/leorochasantos~yahoo-finance-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-leorochasantos-yahoo-finance-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/leorochasantos~yahoo-finance-scraper/runs": {
            "post": {
                "operationId": "runs-sync-leorochasantos-yahoo-finance-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/leorochasantos~yahoo-finance-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-leorochasantos-yahoo-finance-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "tickers": {
                        "title": "Tickers",
                        "type": "array",
                        "description": "Yahoo Finance symbols to fetch — stocks (AAPL, 7203.T, PETR4.SA), ETFs (SPY), indices (^GSPC), crypto (BTC-USD), FX (EURUSD=X), futures (GC=F). One output item per ticker.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "dataBlocks": {
                        "title": "Data blocks",
                        "type": "array",
                        "description": "Which data to fetch per ticker. Only requested blocks are fetched and returned — fewer blocks = faster, cheaper runs.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "quote",
                                "history",
                                "dividends",
                                "splits",
                                "fundamentals",
                                "news"
                            ],
                            "enumTitles": [
                                "Quote (price, ranges, volume, exchange, sector)",
                                "History (OHLCV candles)",
                                "Dividends",
                                "Splits",
                                "Fundamentals (income / balance / cash-flow line items)",
                                "News (latest headlines)"
                            ]
                        },
                        "default": [
                            "quote"
                        ]
                    },
                    "range": {
                        "title": "History range",
                        "enum": [
                            "1d",
                            "5d",
                            "1mo",
                            "3mo",
                            "6mo",
                            "1y",
                            "2y",
                            "5y",
                            "10y",
                            "ytd",
                            "max"
                        ],
                        "type": "string",
                        "description": "Window for the history block (ignored unless \"history\" is selected; overridden by start/end dates).",
                        "default": "1mo"
                    },
                    "interval": {
                        "title": "Candle interval",
                        "enum": [
                            "1m",
                            "2m",
                            "5m",
                            "15m",
                            "30m",
                            "60m",
                            "90m",
                            "1h",
                            "1d",
                            "5d",
                            "1wk",
                            "1mo",
                            "3mo"
                        ],
                        "type": "string",
                        "description": "Candle size for the history block. Intraday intervals (1m–1h) are limited by Yahoo to recent windows (e.g. 1m ≈ last 7 days).",
                        "default": "1d"
                    },
                    "startDate": {
                        "title": "Start date (optional)",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Custom history window start, YYYY-MM-DD. Overrides \"History range\"."
                    },
                    "endDate": {
                        "title": "End date (optional)",
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string",
                        "description": "Custom history window end, YYYY-MM-DD (defaults to today when only a start date is given)."
                    },
                    "fundamentalsGranularity": {
                        "title": "Fundamentals granularity",
                        "enum": [
                            "annual",
                            "quarterly",
                            "both"
                        ],
                        "type": "string",
                        "description": "Reporting periods for the fundamentals block.",
                        "default": "annual"
                    },
                    "searchQueries": {
                        "title": "Symbol search queries",
                        "type": "array",
                        "description": "Free-text company/asset names to resolve into tickers (e.g. \"petrobras\"). One search item per query, with exchange/sector metadata per match. Can be used alone or together with tickers.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Proxy to use. Default Apify datacenter proxy works reliably.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
