# Yahoo Finance Scraper (`publicmoney/yahoo-finance-scraper`) Actor

Extract Yahoo Finance quotes for stocks, ETFs, indices, currencies and crypto with no API key: price, change, day and 52-week range, volume, market cap, PE, EPS, dividend and earnings date. Export data, run via API, schedule and monitor runs, or integrate with other tools.

- **URL**: https://apify.com/publicmoney/yahoo-finance-scraper.md
- **Developed by:** [Public Money](https://apify.com/publicmoney) (Apify)
- **Categories:** Business
- **Stats:** 4 total users, 3 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.00 / 1,000 records

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/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 has no official public API, and its internal `query1` endpoint answers HTTP 429 without a session crumb. This Actor reads the Yahoo Finance quote page instead and returns one structured record per symbol: price, day and 52-week range, volume, market cap, PE, EPS, dividend, earnings date and the latest analyst rating. Stocks, ETFs, indices, currency pairs and crypto all go in one list.

### What it does

- Returns **one record per requested symbol**, in order. A symbol Yahoo does not list comes back with `status: "failed"` and a reason, so a batch never fails silently.
- Reads up to **56 fields** per quote: the price block, both ranges, volume, the full statistics list (`marketCap`, `peRatio`, `eps`, `beta`, `earningsDate`, `forwardDividendYieldPercent`) and the latest analyst action.
- Adds **post-market pricing** after the close, and timestamps every record twice: `validFrom` is Yahoo's market time in ISO 8601, `scrapedAt` is our fetch time.
- Flags data you should not trust. When Yahoo's statistics fragment disagrees with its price block, the record carries `statisticsSuspect: true`.
- Accepts **symbols or quote URLs**, any tab, so `.../quote/BRK-B/history/` is read as `BRK-B`.
- Has a second mode for **news**, one record per story on a symbol's Yahoo Finance news page.

### Use cases

| You need to | How this Actor does it |
| --- | --- |
| Price a watchlist every morning | Pass up to 200 symbols in one run, scheduled before the open |
| Cross-check a vendor feed | Compare `value` and `validFrom` against your source, publish the spread |
| Catch a 52-week breakout | Compare `value` against `fiftyTwoWeekHigh` on each run |
| Watch an earnings calendar | Read `earningsDate` across a sector list |
| Feed a finance agent | Call the Actor over MCP and let the model ask for the symbol it needs |
| Build your own history | Schedule the run and let the dataset accumulate a row per symbol per run |

### Quick start

1. Click **Try for free**.
2. Add your symbols, one per line, in Yahoo's own formats: `AAPL` for equities and ETFs, `^GSPC` for indices, `BTC-USD` for crypto, `EURUSD=X` for FX, `CL=F` for futures.
3. Leave **Mode** on `quote`, or switch it to `news`.
4. Click **Start**. Rows appear within seconds.
5. Export as JSON, CSV, Excel or XML, or read the dataset over the API.

### Input

| Field | Type | Default | What it controls |
| --- | --- | --- | --- |
| `symbols` | array | `AAPL` | Symbols or quote URLs to read, up to 200 per run |
| `mode` | string | `quote` | `quote` returns a record per symbol, `news` a record per story |
| `newsPerSymbol` | integer | `10` | Stories per symbol in news mode, 1 to 50 |
| `maxItems` | integer | `0` | Caps how many symbols are read. `0` reads them all |

```json
{
    "symbols": [
        "AAPL",
        "^GSPC",
        "EURUSD=X",
        "BTC-USD"
    ],
    "mode": "quote",
    "maxItems": 0
}
```

### Output

One dataset item per symbol. Fields Yahoo does not publish are dropped rather than returned as `null`, so an index carries no `peRatio` and a crypto pair carries no `earningsDate`.

| Field group | Fields |
| --- | --- |
| Identity | `status`, `tickerSymbol`, `name`, `exchange`, `currency`, `url` |
| Price | `value`, `change`, `changePercent`, `open`, `bid`, `ask`, `previousClose`, `previousCloseSource` |
| Post-market | `postMarketPrice`, `postMarketChange`, `postMarketChangePercent` |
| Ranges and volume | `dayLow`, `dayHigh`, `fiftyTwoWeekLow`, `fiftyTwoWeekHigh`, `volume`, `avgVolume` |
| Fundamentals | `marketCap`, `beta`, `peRatio`, `eps`, `oneYearTargetEstimate` |
| Dividend and dates | `forwardDividend`, `forwardDividendYieldPercent`, `exDividendDate`, `earningsDate` |
| Analyst | `latestRatingFirm`, `latestRating`, `latestRatingAction`, `latestPriceTarget` |
| Timing and trust | `validFrom`, `scrapedAt`, `quoteTime`, `statisticsSuspect` |

```json
{
    "status": "ok",
    "tickerSymbol": "AAPL",
    "name": "Apple Inc.",
    "exchange": "NasdaqGS - Nasdaq Real Time Price",
    "currency": "USD",
    "value": 319.97,
    "change": -8.24,
    "changePercent": -2.51,
    "previousClose": 328.21,
    "previousCloseSource": "published",
    "dayLow": 317.86,
    "dayHigh": 328.93,
    "fiftyTwoWeekHigh": 344.57,
    "volume": 38272821,
    "marketCap": 4670000000000,
    "peRatio": 36.65,
    "earningsDate": "Oct 29, 2026",
    "validFrom": "2026-09-04T20:00:01.000Z",
    "scrapedAt": "2026-09-04T20:03:44.118Z",
    "url": "https://finance.yahoo.com/quote/AAPL"
}
```

#### What does news mode return?

`mode: "news"` returns the stories on a symbol's news page: `headline`, `url`, `publisher`, `relatedSymbols`, and the age Yahoo prints ("36m ago") both as `publishedAgeText` and as a derived `datePublished`. Yahoo publishes an age rather than a timestamp, so `datePublished` is that age measured back from the fetch.

### Integrations

Run it over the API and get the rows back in one call:

```bash
curl -X POST "https://api.apify.com/v2/acts/publicmoney~yahoo-finance-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"symbols": ["AAPL", "^GSPC", "EURUSD=X", "BTC-USD"], "mode": "quote", "maxItems": 0}'
```

From Python:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("publicmoney/yahoo-finance-scraper").call(run_input={"symbols": ["AAPL", "^GSPC", "EURUSD=X", "BTC-USD"], "mode": "quote", "maxItems": 0})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["tickerSymbol"], item["name"], item["value"])
```

Give an AI agent the Actor over MCP:

```json
{
    "mcpServers": {
        "apify": {
            "url": "https://mcp.apify.com/?actors=publicmoney/yahoo-finance-scraper"
        }
    }
}
```

Schedules run it on any cron, webhooks fire when a run finishes, and platform integrations push the
dataset to Google Sheets, Slack, Airtable, Zapier or your own endpoint.

### Cost

Pay per event, so you pay for records rather than compute time.

| Event | Free tier | Top volume tier |
| --- | --- | --- |
| Record with data | $0.002 | $0.0007 |
| News article | $0.001 | $0.00035 |
| Actor start | $0.00005 per GB | Same |

A record that returned no data is published as a failure row and is **never charged**. Six volume tiers apply, so the per-record price falls with monthly volume.

### Troubleshooting

| Issue | Solution |
| --- | --- |
| Every symbol returns `failed` | Yahoo is answering HTTP 429 to the egress this Actor uses. It is not settable from the input, so open an issue on the Issues tab and we will move it. |
| One symbol fails, the rest are fine | Yahoo does not list that symbol in that format. Mind the suffixes: `^` indices, `=X` FX, `-USD` crypto, `=F` futures. |
| `peRatio`, `eps` or `beta` are missing | Yahoo does not publish them for that instrument. Indices, FX pairs and crypto carry no earnings fields. |
| `statisticsSuspect` is `true` | Yahoo served a stale statistics fragment. The price block is still good, but treat the statistics fields as unverified and rerun. |
| `previousClose` differs from another source | Check `previousCloseSource`. `derived` means it was computed as `value - change`, which is exact, rather than read from the statistics list. |
| The run is slower than expected | Each symbol is a full residential page load, retried up to three times. Split large watchlists across parallel runs. |

### FAQ

#### Does Yahoo Finance have an official API?

No. Yahoo retired its public API in 2017 and never replaced it. The `query1` and `query2` endpoints that libraries still use are internal and unsupported, and they now answer HTTP 429 without a consent-issued crumb. This Actor reads the public quote page, which is why it keeps working.

#### Is the Yahoo Finance API free?

There is no official one to be free. This Actor is pay per record at $0.002 on the free tier, and rows that return no data are not charged.

#### Why do Yahoo Finance requests return HTTP 429?

Yahoo rate limits its internal JSON endpoints per IP rather than per key. We measured 429 from a plain IP, an Apify datacenter IP and an Apify residential IP alike, which is why the Actor parses the quote page and rotates a residential session per symbol.

#### Does it return historical prices?

No. Each record is the current snapshot as the source publishes it. To build a series, schedule the Actor and let the dataset accumulate a row per input per run. Each row carries `validFrom`, so the series is correctly timestamped.

#### Is there a Yahoo Finance news API?

`mode: "news"` is the closest thing, returning the stories on a symbol's news page with headline, publisher, URL and related symbols, charged as news items.

#### Do I need a Yahoo Finance API key?

No. You need an Apify token to call the Actor over the API. No Yahoo Finance credential is involved anywhere.

#### Can I get this data in Python?

Yes, with the `apify-client` package as shown above. It returns parsed JSON, so there is no HTML or response handling on your side.

#### Can I get the data into Excel or Google Sheets?

Yes. Export the dataset as XLSX or CSV, or connect the Google Sheets integration so each run appends to a sheet.

#### Can an AI agent call this Actor?

Yes. Add it to an MCP client with the config above and the model can request what it needs on its own. Every record is flat JSON with named fields, so no post-processing is needed.

#### Is it legal to scrape Yahoo Finance?

This Actor reads public Yahoo Finance data that needs no login and collects no personal data. Scraping public data is generally lawful, and how you store, redistribute or act on market data is governed by your own agreements and local rules. Take your own legal advice for your use case.

### Changelog

- **0.0.2** Added news mode, post-market pricing, `previousCloseSource` and the `statisticsSuspect` flag.
- **0.0.1** First release. Quote mode across equities, ETFs, indices, currency pairs and crypto.

### Feedback

Found a field Yahoo Finance publishes that this Actor misses, or an input it rejects? Open an issue on the Issues tab with the input and what you expected. A daily test runs every Actor in the fleet against live sources, so parser fixes ship fast.

# Actor input Schema

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

Yahoo Finance symbols or quote URLs, one per line. Symbols follow Yahoo's own format: plain ticker for equities and ETFs ('AAPL', 'SPY'), a caret for indices ('^GSPC'), COIN-CURRENCY for crypto ('BTC-USD'), '=X' for currency pairs ('EURUSD=X') and '=F' for futures ('CL=F'). Any Yahoo Finance quote URL works in place of a symbol, including its sub-tabs, so 'https://finance.yahoo.com/quote/BRK-B/history/' is read as 'BRK-B'. Up to 200 entries per run. Defaults to 'AAPL' when left empty.

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

What each record represents. Quote returns one record per symbol with the price block, both ranges, volume and the statistics list. News returns one record per story from that symbol's Yahoo Finance news page, charged as news items rather than as quotes. Examples: 'quote', 'news'. Default is 'quote'.

## `newsPerSymbol` (type: `integer`):

How many stories to return per symbol in News mode, counted from the top of the news page. Yahoo renders about a dozen stories on the first page, so values above that return everything available. Accepts 1 to 50. Examples: 5, 10, 25. Default is 10. Ignored when Mode is 'quote'.

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

Maximum number of symbols to read, counted from the top of the list. Use it to cap spend on a long list without editing the list itself. Examples: 10, 50, 200. Default is 0, which reads every symbol given.

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "NVDA",
    "BTC-USD",
    "https://finance.yahoo.com/quote/EURUSD=X/"
  ],
  "mode": "quote",
  "newsPerSymbol": 10,
  "maxItems": 0
}
```

# Actor output Schema

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

One item per symbol scraped by the run, in the default dataset.

# 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",
        "NVDA",
        "BTC-USD",
        "https://finance.yahoo.com/quote/EURUSD=X/"
    ],
    "mode": "quote",
    "newsPerSymbol": 10,
    "maxItems": 0
};

// Run the Actor and wait for it to finish
const run = await client.actor("publicmoney/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",
        "NVDA",
        "BTC-USD",
        "https://finance.yahoo.com/quote/EURUSD=X/",
    ],
    "mode": "quote",
    "newsPerSymbol": 10,
    "maxItems": 0,
}

# Run the Actor and wait for it to finish
run = client.actor("publicmoney/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",
    "NVDA",
    "BTC-USD",
    "https://finance.yahoo.com/quote/EURUSD=X/"
  ],
  "mode": "quote",
  "newsPerSymbol": 10,
  "maxItems": 0
}' |
apify call publicmoney/yahoo-finance-scraper --silent --output-dataset

```

## MCP server setup

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