# Yahoo Finance Scraper: Stock Prices, Options & Price Alerts (`roomy_tweet/yahoo-finance-scraper`) Actor

Yahoo Finance stock data API: live quotes, price history, dividends, financial statements, options chains, news and company details for stocks, ETFs, crypto, indexes and B3 tickers. Built-in price alerts and change tracking for scheduled runs.

- **URL**: https://apify.com/roomy_tweet/yahoo-finance-scraper.md
- **Developed by:** [roomy_tweet](https://apify.com/roomy_tweet) (community)
- **Categories:** Automation, Developer tools
- **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 quotes

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: Stock Prices, Options & Price Alerts

Get **Yahoo Finance data** for any list of stocks, ETFs, indexes, currencies, crypto and futures in one run: live quotes, price history, dividends and splits, financial statements, options chains, news and company details. You can also **monitor your watchlist on a schedule**, with built-in **price alerts** (`AAPL > 350`), change since the last run, new 52-week highs and lows, and upcoming earnings and ex-dividend dates.

No Yahoo account and no API key are needed.

### What you can do with it

- **Stock price API**: current price, change, volume, market cap, P/E, EPS, dividend yield, 52-week range and earnings date for hundreds of symbols in seconds.
- **Historical prices**: daily, weekly, monthly or intraday bars (open, high, low, close, adjusted close, volume) for any range or date window.
- **Dividends and splits**: the full payment history, one row per dividend.
- **Financial statements**: revenue, gross profit, operating income, net income, EBITDA, EPS, assets, liabilities, equity, debt, cash, operating cash flow, capex and free cash flow. Annual and quarterly.
- **Options chains**: every contract with strike, bid/ask, volume, open interest, implied volatility and days to expiration. Optionally only strikes near the price.
- **Company details and analysts**: sector, industry, employees, description, executives, margins, growth, analyst price targets, rating and next earnings date.
- **News**: recent Yahoo Finance articles per symbol.
- **Screeners**: add Yahoo's day gainers, day losers, most active, most shorted and other ready-made lists.
- **Bundle mode for backtests**: one row per symbol with years of bars, dividends, statements, options and news inside it, charged once per symbol.
- **Watchlist monitoring and alerts**: schedule the Actor hourly or daily, save only what changed, and get notified by email, Slack or webhook through Apify integrations.

### Symbols you can use

| What | Examples |
|---|---|
| US and global stocks | `AAPL`, `MSFT`, `BRK-B`, `7203.T`, `SAP.DE`, `SHOP.TO` |
| Brazilian B3 stocks, units and FIIs | `PETR4`, `VALE3`, `ITUB4`, `HGLG11` (`.SA` is added for you) |
| ETFs and funds | `SPY`, `QQQ`, `BOVA11` |
| Indexes | `^GSPC`, `^IXIC`, `^BVSP`, `^FTSE` |
| Currencies | `EURUSD=X`, `BRL=X` |
| Crypto | `BTC-USD`, `ETH-USD` |
| Futures | `GC=F` (gold), `CL=F` (oil) |
| Company names | `Nu Holdings`, `Petrobras` (the best match from Yahoo search; the run report shows which ticker was picked) |

### Price alerts

Write conditions on the same line as the symbol:

```
AAPL > 350
PETR4 < 30
BTC-USD > 100000 < 60000
```

You can also turn on these alerts for every symbol:

| Alert | Fires when |
|---|---|
| Move since last run | The price moved at least X% up or down since the previous run. |
| Above / below a price | The condition becomes true. On the first run it fires if the condition is already true; after that only when the price crosses the level. |
| New 52-week high or low | Once for each new high or low. |
| Earnings soon | The next earnings date is within N days. Once per date. |
| Ex-dividend soon | The ex-dividend date is within N days. Once per date. |

Each quote row gets `alert` (true/false), `alerts` (the texts) and, when tracking is on, `previousRunPrice`, `changeSinceLastRun` and `changeSinceLastRunPercent`. With **Save only quotes with an alert**, quiet runs save nothing and cost almost nothing.

The memory lives in a named key-value store in your account (`yahoo-finance-monitor` by default). Use one name per watchlist.

#### Example: daily watchlist with alerts

```json
{
  "symbols": ["AAPL > 350", "NVDA", "PETR4 < 30", "BTC-USD > 100000"],
  "alertMovePercent": 5,
  "alert52WeekHighLow": true,
  "alertEarningsWithinDays": 3,
  "onlyAlerts": true
}
```

Schedule it in Apify Console, then add an email or Slack integration on "Run succeeded" to get the alert rows.

### Input examples

**Quotes with company details:**

```json
{ "symbols": ["AAPL", "MSFT", "VALE3", "^BVSP"], "includeDetails": true }
```

**Five years of daily prices and dividends:**

```json
{ "symbols": ["KO", "ITUB4"], "includeHistory": true, "historyRange": "5y", "historyInterval": "1d", "includeDividends": true, "dividendsRange": "5y" }
```

**Options near the money for the next two expirations:**

```json
{ "symbols": ["TSLA"], "includeOptions": true, "optionsExpirations": 2, "optionsStrikeRangePercent": 10 }
```

**Today's top gainers with news:**

```json
{ "screeners": ["day_gainers"], "screenerCount": 20, "includeNews": true, "newsPerSymbol": 3 }
```

### Two output layouts

| Layout | What you get | Charged | Best for |
|---|---|---|---|
| **Rows** (default) | A flat table: one row per quote, bar, dividend, period, contract or article | Per row | Spreadsheets, BI tools, filtering |
| **Bundle** | One row per symbol, with `history`, `dividends`, `splits`, `financials`, `options` and `news` as arrays inside | Once per symbol | Backtests, long histories, apps that read JSON |

Ten years of daily prices for 50 symbols is about 126,000 rows in rows mode, but only 50 rows in bundle mode. Alerts and `onlyAlerts` work the same in both.

**Bundle example: five years of history, dividends and statements:**

```json
{ "symbols": ["AAPL", "MSFT", "PETR4"], "outputMode": "bundle", "includeDetails": true, "includeHistory": true, "historyRange": "5y", "includeDividends": true, "dividendsRange": "5y", "includeFinancials": true, "financialsFrequency": "both" }
```

A bundle row is the quote row plus the arrays:

```json
{
  "recordType": "quote", "bundle": true, "symbol": "AAPL", "price": 342.37, "currency": "USD",
  "historyInterval": "1d",
  "history": [{ "date": "2026-11-06", "open": 338.3, "high": 345.79, "low": 338.3, "close": 342.37, "adjClose": 342.37, "volume": 44703806 }],
  "dividends": [{ "date": "2026-08-10", "amount": 0.27 }],
  "splits": [],
  "financials": [{ "frequency": "annual", "periodEnd": "2026-09-30", "currency": "USD", "totalRevenue": 478834000000, "netIncome": 132175000000 }]
}
```

A bundle that would pass 8 MB (for example every expiration of a big options chain) is cut from the end. In that case the row gets `bundleTrimmed: true` and the run report gets a warning.

### Output

Everything goes to one dataset. The `recordType` column tells the rows apart, and the dataset has ready views: Quotes, Company details, Price history, Dividends and splits, Financial statements, Options and News.

**Quote:**

```json
{
  "recordType": "quote",
  "symbol": "PETR4.SA",
  "input": "PETR4 < 40",
  "resolvedFrom": "B3 ticker: added .SA",
  "name": "Petróleo Brasileiro S.A. - Petrobras",
  "quoteType": "EQUITY",
  "exchangeName": "São Paulo",
  "currency": "BRL",
  "price": 45.36,
  "changePercent": -1.284,
  "marketCap": 619775721472,
  "trailingPE": 4.3324,
  "dividendYieldPercent": 8.08,
  "fiftyTwoWeekHigh": 59.79,
  "sector": "Energy",
  "analystTargetMean": 60.96,
  "analystRecommendation": "strong_buy",
  "previousRunPrice": 46.1,
  "changeSinceLastRunPercent": -1.6052,
  "alert": false,
  "alerts": [],
  "marketTime": "2026-11-06T21:40:13.000Z",
  "url": "https://finance.yahoo.com/quote/PETR4.SA"
}
```

**Price bar:**

```json
{ "recordType": "price", "symbol": "AAPL", "interval": "1d", "currency": "USD", "date": "2026-11-06", "open": 338.3, "high": 345.79, "low": 338.3, "close": 342.37, "adjClose": 342.37, "volume": 44703806 }
```

**Option contract:**

```json
{ "recordType": "option", "symbol": "AAPL", "contractSymbol": "AAPL261116C00342500", "type": "call", "expiration": "2026-11-16", "daysToExpiration": 8, "strike": 342.5, "currency": "USD", "lastPrice": 6.65, "bid": 5.6, "ask": 6.4, "volume": 142, "openInterest": 157, "impliedVolatilityPercent": 30.1399, "inTheMoney": false, "underlyingPrice": 342.37 }
```

Financial statement, dividend, split and news rows follow the same flat style.

**Run report:** the `REPORT` record in the run's key-value store lists every input line with its status and the symbol it became. It also shows alerts, extras counts, request counts and a quality check.

Statuses:

| Status | Meaning |
|---|---|
| OK | Quote saved. |
| NOT_FOUND | Yahoo has no such symbol. Not charged. |
| NO_ALERT | onlyAlerts is on and nothing fired. Not charged. |
| DUPLICATE | Another line already gave this symbol. |
| FAILED | The lookup for this symbol failed. |
| RATE_LIMITED | Yahoo answered HTTP 429 and the run stopped. |
| SKIPPED | The spending limit came first. |

### Pricing

Pay per event. In rows mode you pay for the rows saved, by type (quote, company details, history row, financial period, option contract, news article). In bundle mode you pay one bundle event per symbol, whatever it holds. Symbols that are not found and quotes skipped by **Save only quotes with an alert** are not charged. See the Pricing tab for the current prices. The run stops cleanly at your maximum cost per run.

### FAQ

**Are prices real-time?** They are what Yahoo Finance shows. Most exchanges are delayed 15 to 20 minutes, crypto is near real-time. `marketTime` tells you when each price is from.

**Why did a company name pick the wrong ticker?** Names go through Yahoo search, which prefers the most-traded listing. "Petrobras" gives `PBR` (New York), not `PETR4.SA`. Type the ticker when you want a specific exchange. Some brand names, like "Nubank", are not in Yahoo search. Use the company name ("Nu Holdings") or the ticker (`NU`).

**Why are some fields empty?** Yahoo does not publish every field for every asset. Indexes have no P/E, crypto has no dividends, and B3 stocks show no day range on weekends.

**How far back does history go?** Daily bars go back decades for most stocks. Yahoo keeps 1-minute bars for about 8 days, other minute bars for 60 days and hourly bars for about 2 years.

**Does it need a proxy?** Usually not. If Yahoo rate-limits the direct connection, the Actor switches to Apify Proxy by itself. You can also set a proxy in the input.

**Is scraping Yahoo Finance allowed?** The Actor reads public data that Yahoo Finance shows to any visitor, without logging in. Check Yahoo's terms and your local laws for your use case, especially before redistributing the data.

### Changelog

- **0.1**: first version. Bundle mode (one row per symbol). B3 codes with a digit inside (B3SA3). Quotes, details, history, dividends and splits, financials, options, news, screeners, alerts and change tracking.

# Actor input Schema

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

One per line: a Yahoo ticker (AAPL, BRK-B, SPY, BTC-USD, ^GSPC, EURUSD=X, GC=F, 7203.T), a Brazilian B3 ticker (PETR4, VALE3, HGLG11: .SA is added for you) or a company name ("Nu Holdings"). Add price alerts on the same line: "AAPL > 350", "PETR4 < 30", "BTC-USD > 100000 < 60000".

## `screeners` (type: `array`):

Optional. Adds the symbols of Yahoo's ready-made lists (for example today's top gainers) to the run.

## `screenerCount` (type: `integer`):

How many symbols to take from each screener.

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

Rows: a flat table, charged per row; best for spreadsheets and BI tools. Bundle: one row per symbol with history, dividends, financials, options and news as arrays inside it, charged once per symbol; best for backtests and long histories.

## `includeDetails` (type: `boolean`):

Adds to the quote row: sector, industry, website, employees, description, executives, margins, growth, debt, cash, EBITDA, analyst price targets and rating, next earnings date and ex-dividend date.

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

One row per bar: open, high, low, close, adjusted close and volume.

## `historyRange` (type: `string`):

Ignored when a start date is set.

## `historyInterval` (type: `string`):

Yahoo keeps 1-minute bars for about 8 days, other minute bars for 60 days and hourly bars for 2 years.

## `historyStart` (type: `string`):

Optional start day (YYYY-MM-DD). Overrides the range.

## `historyEnd` (type: `string`):

Optional last day (YYYY-MM-DD). Defaults to today.

## `includePrePost` (type: `boolean`):

Intraday bar sizes only.

## `includeDividends` (type: `boolean`):

One row per dividend paid and per stock split.

## `dividendsRange` (type: `string`):

How far back to list dividends and splits.

## `includeFinancials` (type: `boolean`):

One row per fiscal period: revenue, gross profit, operating income, net income, EBITDA, EPS, assets, liabilities, equity, debt, cash, operating cash flow, capex, free cash flow, dividends paid. Yahoo shows the last 4 years and 5 quarters.

## `financialsFrequency` (type: `string`):

Annual statements, quarterly statements or both.

## `includeOptions` (type: `boolean`):

One row per contract: strike, bid, ask, last price, volume, open interest, implied volatility, days to expiration, in the money.

## `optionsExpirations` (type: `integer`):

How many of the nearest expiration dates to read.

## `optionsType` (type: `string`):

Which contracts to keep.

## `optionsStrikeRangePercent` (type: `integer`):

0 = every strike. 10 keeps strikes within 10% of the current price, which cuts the row count a lot.

## `includeNews` (type: `boolean`):

Recent Yahoo Finance news for each symbol: title, publisher, link, date and related tickers.

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

How many recent articles to keep for each symbol.

## `trackChanges` (type: `boolean`):

Adds previousRunPrice, previousRunAt, changeSinceLastRun and changeSinceLastRunPercent to each quote.

## `alertMovePercent` (type: `number`):

For example 5: alert when the price is up or down 5% or more since the previous run.

## `alert52WeekHighLow` (type: `boolean`):

Once per new high or low.

## `alertEarningsWithinDays` (type: `integer`):

Once per earnings date.

## `alertDividendWithinDays` (type: `integer`):

Once per date. Uses the ex-dividend date when company details are on, otherwise the payment date.

## `onlyAlerts` (type: `boolean`):

Quotes without an alert are not saved and not charged, and their extra rows are skipped. Connect an email, Slack or webhook integration to be notified.

## `stateStoreName` (type: `string`):

Named key-value store that keeps the last prices. Use different names for different watchlists.

## `resetState` (type: `boolean`):

Starts monitoring from scratch for this memory name.

## `maxConcurrency` (type: `integer`):

Lower it if Yahoo starts answering "too many requests".

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

Optional. By default the Actor connects directly and switches to Apify Proxy by itself if Yahoo rate-limits the connection.

## `failOnQualityDrop` (type: `boolean`):

Mark the run as failed when many quotes miss a field Yahoo always sends, so a schedule alerts you.

## `debugSamples` (type: `boolean`):

For troubleshooting: keeps the first raw answer of each Yahoo endpoint in the run's key-value store.

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "MSFT > 600",
    "PETR4",
    "BTC-USD"
  ],
  "screenerCount": 25,
  "outputMode": "rows",
  "includeDetails": false,
  "includeHistory": false,
  "historyRange": "1y",
  "historyInterval": "1d",
  "includePrePost": false,
  "includeDividends": false,
  "dividendsRange": "5y",
  "includeFinancials": false,
  "financialsFrequency": "annual",
  "includeOptions": false,
  "optionsExpirations": 1,
  "optionsType": "both",
  "optionsStrikeRangePercent": 0,
  "includeNews": false,
  "newsPerSymbol": 10,
  "trackChanges": false,
  "alert52WeekHighLow": false,
  "onlyAlerts": false,
  "stateStoreName": "yahoo-finance-monitor",
  "resetState": false,
  "maxConcurrency": 4,
  "failOnQualityDrop": false,
  "debugSamples": false
}
```

# Actor output Schema

## `quotes` (type: `string`):

One row per symbol, with alerts when monitoring is on.

## `allRows` (type: `string`):

Quotes plus history, dividends, financials, options and news rows (see recordType).

## `report` (type: `string`):

Per-symbol status, alerts, extras and quality checks.

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

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

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

```

## MCP server setup

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