# Yahoo Finance Scraper - Quotes & Price History (`protective_flatland/yahoo-finance-scraper`) Actor

Get live quotes, key stats and historical prices for stocks, ETFs, indices and crypto. No API key.

- **URL**: https://apify.com/protective_flatland/yahoo-finance-scraper.md
- **Developed by:** [zsdy](https://apify.com/protective_flatland) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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?

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 Scraper - Quotes & Price History

### Try it first

In **Input → JSON**, run this small example, then open **Dataset → Export** for CSV or JSON. With 1 returned row at 256 MB, the listed event charges are about $0.00105 (including the $0.00005 startup event). The Store Pricing tab is authoritative.

```json
{
  "symbols": [
    "AAPL"
  ],
  "includeHistory": true,
  "maxItems": 1
}
```

### Try it first

The prefilled `AAPL` symbol runs as a one-symbol quote/history sample. Open **Dataset** for the quote and OHLCV candles; set `includeHistory=false` for a smaller quote-only row. Check the Store Pricing tab before running; the row event and any start/platform usage charges are shown there and on the run page.

Get a quote and optional OHLCV price history for supported stocks, ETFs, indices and crypto symbols. No API key or login.

### What you can do

- Fetch live price, previous close, change and 52-week range for a symbol
- Pull available historical OHLCV candles; supported ranges depend on Yahoo's interval limits
- Cover stocks (`AAPL`), ETFs (`SPY`), indices (`^GSPC`) and crypto (`BTC-USD`)

### Typical uses

- Market monitoring and dashboards
- Backtesting and quantitative research
- Portfolio tracking
- Price alerts and reporting

### Input

| Field | Type | Description |
|---|---|---|
| `symbols` | array | Tickers, e.g. `AAPL`, `BTC-USD`, `^GSPC`. |
| `range` | string | Quote window: `1d`, `5d`, `1mo`, `3mo`, `6mo`, `1y`, `2y`, `5y`, `10y`, `max`. |
| `interval` | string | Historical candle interval: `1m`, `5m`, `15m`, `30m`, `1h`, `1d`, `1wk`, `1mo`. Yahoo restricts intraday history to recent windows. |
| `includeHistory` | boolean | Include available OHLCV candles. Set `false` for quote-only output. |
| `maxItems` | integer | Maximum symbols per run (1-100); default is 10. |

#### Example input

```json
{
  "symbols": ["AAPL", "MSFT", "BTC-USD"],
  "range": "1mo",
  "interval": "1d",
  "includeHistory": true,
  "maxItems": 3
}
```

### Output

One record per symbol.

```json
{
  "symbol": "AAPL",
  "name": "Apple Inc.",
  "instrumentType": "EQUITY",
  "exchange": "NasdaqGS",
  "currency": "USD",
  "price": 356.27,
  "changePercent": 1.24,
  "previousClose": 351.91,
  "fiftyTwoWeekHigh": 390.5,
  "fiftyTwoWeekLow": 220.1,
  "volume": 51234567,
  "marketTime": "2026-11-16T20:00:00+00:00",
  "history": [
    { "date": "2026-11-16T14:30:00+00:00", "open": 351.0, "high": 358.0, "low": 350.2, "close": 356.27, "volume": 51234567 }
  ]
}
```

`instrumentType`, `exchange`, quote values and `previousClose` can be null when Yahoo omits them. `history` is omitted when `includeHistory` is false; when present, it contains only candles with a non-null `close`.

`marketTime` is the source quote timestamp in UTC; quote values can be absent outside market hours or when the upstream does not return them. Dataset records contain only fields actually returned by Yahoo.

### Pricing

Pay per result: check the current Store Pricing tab. Historical candles are nested in each symbol record and do not create separate result rows. Platform resource usage, if charged separately, appears on the run page.

# Actor input Schema

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

Stock, ETF, index or crypto tickers. Examples: AAPL, MSFT, TSLA, BTC-USD, ^GSPC

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

History window. Yahoo may reject long intraday combinations; use a short range for minute/hour candles.

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

Candle size. Intraday history is available only for recent ranges according to Yahoo's limits.

## `includeHistory` (type: `boolean`):

Include the OHLCV series in each record.

## `maxItems` (type: `integer`):

Maximum number of symbols to fetch.

## Actor input object example

```json
{
  "symbols": [
    "AAPL"
  ],
  "range": "1mo",
  "interval": "1d",
  "includeHistory": true,
  "maxItems": 10
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("protective_flatland/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 = {}

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

```

## MCP server setup

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