# Yahoo Finance Quotes & History (`superslowsloth/yahoo-finance-quotes`) Actor

Live quotes and daily or intraday price history for any Yahoo Finance ticker - stocks, ETFs, indices, FX and crypto. One flat row per ticker per period.

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

## Pricing

from $0.63 / 1,000 quote rows

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

Live quotes and price history for anything Yahoo Finance lists — US and
non-US equities, ETFs, indices, FX pairs and crypto — as one flat table.

Two modes from one actor:

- **Quote snapshot** — one row per ticker: price, change and change percent,
  open, day high and low, previous close, volume, market capitalisation.
- **Historical chart** — one row per ticker **per period**, each carrying its
  own date, open, high, low, close, volume and the change against the period
  before it.

Both modes emit the same columns, so a snapshot and a price history can live in
one dataset and be told apart by the `mode` field.

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `tickers` | array | — | **Required.** Yahoo symbols: `AAPL`, `MSFT`, `7203.T`, `BMW.DE`, `PTT.BK`, `BRK-B`, `SPY`, `^GSPC`, `^N225`, `EURUSD=X`, `BTC-USD`. A full Yahoo quote URL is accepted and reduced to the ticker. Duplicates are removed before anything is charged. |
| `mode` | select | `quote` | `quote` for the live snapshot, `historical` for dated bars. |
| `range` | select | `1mo` | Historical mode only. `1d`, `5d`, `1mo`, `3mo`, `6mo`, `1y`, `2y`, `5y`, `10y`, `ytd`, `max`. |
| `interval` | select | `1d` | Historical mode only. `1m`…`90m`, `1h`, `1d`, `5d`, `1wk`, `1mo`, `3mo`. Intraday intervals are only served for recent ranges — one-minute bars go back about a week. |
| `requestIntervalSecs` | integer | `1` | Pause between requests. Yahoo rate-limits per exit address. |
| `proxyConfiguration` | proxy | residential | Required in practice — see below. |

### Output

One record per row:

```
symbol                the Yahoo ticker, upper-cased
mode                  "quote" or "historical"
name                  e.g. "Apple Inc."
exchange              short code, e.g. "NMS"
full_exchange_name    readable name, e.g. "NasdaqGS"
currency              the currency every monetary field below is in
quote_type            EQUITY, ETF, INDEX, CURRENCY, CRYPTOCURRENCY, FUTURE, ...
date                  YYYY-MM-DD, in the exchange's own timezone
timestamp             ISO-8601 UTC observation time
price                 last price (quote) or the period close (historical)
change                against previous_close
change_percent        the same, as a percentage
open
high
low
previous_close        prior close (quote) or the previous period's close
volume
market_cap            quote mode only — see below
```

#### Dates are the exchange's, not UTC

A Tokyo session opens at 00:00 UTC. Dating those bars by UTC would file every
Japanese trading day one day early — a whole-column error that only surfaces
when the data is joined against something else. `date` is therefore computed
with the exchange's own offset; `timestamp` remains plain UTC so rows from
different exchanges still sort correctly against each other.

#### Nulls are real, and they stay null

- `market_cap` is null on **every historical row**. Yahoo publishes only
  today's shares outstanding, so a historical market cap would be a number
  nobody measured.
- `market_cap` is also null for instruments that have none — indices, FX pairs,
  most ETFs.
- A period Yahoo pads with no trade at all (a closed hour in an FX series, a
  halt) is **skipped**, not emitted as a row of zeros.

A zero in a price or capitalisation column reads as a measurement. Anyone
screening on "market cap below X" would otherwise pick up every index in the
run.

### Throughput and proxies

Yahoo rate-limits per exit address and answers HTTP 429 to a burst from a
datacenter IP. This actor therefore:

- uses a **residential proxy** by default and takes a fresh address between
  tickers, not only after a failure;
- classifies 429, 403 and 5xx as retryable, and backs off with jitter onto a
  new address;
- classifies an unknown or delisted ticker (HTTP 404, *"No data found, symbol
  may be delisted"*) as **permanent** and reports it rather than retrying — a
  different address will never make it a company, and retrying would spend your
  money to learn nothing.

Turning the proxy off will produce 429s rather than data.

Quote mode batches up to 50 tickers into a single request, so a 200-ticker
snapshot is four requests. Historical mode is one request per ticker,
regardless of how many bars come back.

### Market cap and the crumb handshake

Yahoo's quote endpoint — the only public source of `marketCap` — refuses a cold
call with HTTP 401. This actor performs the cookie-plus-crumb handshake to get
it rather than dropping the field.

If that handshake ever fails, the run does **not** fail: it falls back to the
chart endpoint, which carries every column above except `market_cap`, and that
column comes back null. A row with one honest null beats no row.

### Billing

Pay per event:

- `actor-start`, once per run, charged only after the input parses — a run
  rejected for a malformed input costs nothing.
- `quote-scraped`, once per row written. Duplicated tickers are removed before
  charging, so a ticker listed twice is billed once.

Nothing is charged for a ticker that produced no row.

# Actor input Schema

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

The Yahoo Finance symbols to fetch. Anything Yahoo lists works: US equities (AAPL, MSFT), non-US listings with their suffix (7203.T, BMW.DE, PTT.BK), share classes (BRK-B), ETFs (SPY), indices (^GSPC, ^N225), FX pairs (EURUSD=X) and crypto (BTC-USD). A full Yahoo quote URL is accepted too and reduced to the ticker. Duplicates are removed before anything is charged.

## `mode` (type: `string`):

Quote snapshot returns one row per ticker with the live price, day range and market cap. Historical returns one row per ticker per period, each carrying its own date, open, high, low, close and volume - use the range and interval fields below to choose the window.

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

How far back to go in historical mode. Ignored in quote mode. These are the windows Yahoo itself publishes as valid; anything else is refused before a request is spent.

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

The size of each bar in historical mode. Ignored in quote mode. Intraday intervals are only served for recent ranges - one-minute bars go back about a week - and Yahoo refuses a combination outside that window, which the run reports rather than silently returning nothing.

## `requestIntervalSecs` (type: `integer`):

How long to wait between requests. Yahoo rate-limits per exit address and answers HTTP 429 to a burst, at which point the run backs off onto a fresh address. Raising this trades wall-clock time for fewer retries; zero is fine for a handful of tickers.

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

Required in practice. Yahoo Finance rate-limits datacenter addresses hard, so residential proxy is the default here; a fresh address is taken between tickers and again before every retry. Turning it off will produce HTTP 429 rather than data.

## Actor input object example

```json
{
  "tickers": [
    "AAPL",
    "MSFT",
    "BTC-USD"
  ],
  "mode": "quote",
  "range": "1mo",
  "interval": "1d",
  "requestIntervalSecs": 1,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `quotes` (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",
        "BTC-USD"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("superslowsloth/yahoo-finance-quotes").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",
        "BTC-USD",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("superslowsloth/yahoo-finance-quotes").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 '{
  "tickers": [
    "AAPL",
    "MSFT",
    "BTC-USD"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call superslowsloth/yahoo-finance-quotes --silent --output-dataset

```

## MCP server setup

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

```

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/3hxYPkrhUlMc6H6fl/builds/nNxAWEkBDROd3Mj1P/openapi.json
