# Yahoo Finance Scraper (Stock Quotes, History, Financials) (`locaihost/yahoo-finance`) Actor

Yahoo Finance data for stocks, ETFs, indices, crypto and FX: live quotes, daily/weekly/monthly price history with dividends and splits, income, balance sheet and cash flow, news, analyst ratings, holders and profiles. Price change since your last run. From $0.50 per 1,000 rows.

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

## Pricing

Pay per event

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?

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 Quotes, History, Financials)

Get Yahoo Finance data for any ticker: live quotes with market cap and ratios, daily, weekly or monthly price history with dividends and splits, income statement, balance sheet and cash flow, news headlines, analyst estimates and price targets, top holders and company profiles. Stocks, ETFs, indices, crypto, currencies and futures, from any exchange Yahoo Finance covers. Each quote also shows how far the price moved since your last run.

### How do I start?

Paste this into the input (JSON tab) and press Start:

```json
{
    "symbols": ["AAPL", "MSFT", "^GSPC", "BTC-USD"],
    "data": ["quote"]
}
```

Four quotes take about 10 to 20 seconds. Each symbol also gets one free summary row.

Want ten years of monthly prices and the full financials?

```json
{
    "symbols": ["KO"],
    "data": ["history", "financials"],
    "historyRange": "10y",
    "interval": "1mo"
}
```

### What data can I get?

| Data | Rows per symbol | What each row holds |
|---|---|---|
| `quote` | 1 | Price, change, previous close, open, day range, volume, market cap, 52-week range, 50- and 200-day averages, P/E, EPS, PEG, price to book and sales, enterprise value, beta, dividend rate and yield, shares outstanding, short interest, and the change since your last run |
| `history` | 1 per day, week or month | Open, high, low, close, adjusted close and volume; plus one row per dividend and per split in the range |
| `financials` | 1 per statement period | Income statement, balance sheet and cash flow, annual plus trailing 12 months, with headline columns (revenue, gross profit, net income, EBITDA, total assets, total debt, operating cash flow and more) and every line item Yahoo shows, in full units |
| `news` | about 10 to 20 | Headline, link, publisher, time, summary, the tickers it mentions, and whether it is an article or a video |
| `analysis` | 1 | Earnings and revenue estimates, earnings history, recommendation trend, recent rating changes by firm, and analyst price targets |
| `holders` | 1 | Share held by insiders and institutions, the number of institutions, and the top institutional and fund holders (organisations only) |
| `profile` | 1 | Business summary, sector, industry, website, investor relations link, phone and address of the head office, employees, officers (name and title only) and recent filings |

You can also add a Yahoo Finance market list: most active, top gainers, top losers, trending, 52-week gainers or top cryptocurrencies. Its symbols are read after your own, and each row keeps its `list` and `listPosition`.

Example quote row:

```json
{
    "type": "quote",
    "symbol": "AAPL",
    "name": "Apple Inc.",
    "quoteType": "EQUITY",
    "exchange": "NasdaqGS",
    "currency": "USD",
    "price": 356.27,
    "changePercent": 0.3917,
    "marketCap": 5177380175872,
    "trailingPE": 39.49778,
    "fiftyTwoWeekLow": 243.42,
    "fiftyTwoWeekHigh": 360.83,
    "previousRunPrice": 348.1,
    "changeSinceLastRun": 8.17,
    "changeSinceLastRunPercent": 2.3471,
    "url": "https://finance.yahoo.com/quote/AAPL/"
}
```

### Free rows, never charged

Every symbol gets one summary row (`type: "summary"`), free: the company name, whether the symbol was found, how many quotes, price bars, dividends, splits, statement periods, news stories and detail blocks came back, how many rows were skipped as already returned, what was not available and why, and a short note on how it ended. Use the **Symbol summaries** view to see them on their own. A symbol Yahoo Finance does not know costs nothing and still gets its summary row.

### What makes it different?

- **Change since your last run.** Every quote carries `previousRunPrice`, `previousRunAt` and the change in money and percent, so a daily schedule is a price tracker with no spreadsheet.
- **Only new rows.** Turn on **Only new rows** and each run skips price bars, statement periods, news stories and detail blocks returned before. Skipped rows are not charged. The newest price bar always comes back, because it changes until the period closes.
- **Seven kinds of data in one run.** Quotes, history, all three statements, news, analyst data, holders and profiles from one input, in one dataset, with one view for each.
- **Any market.** Tokyo (7203.T), London (VOD.L), indices (^GSPC), crypto (BTC-USD), currencies (EURUSD=X) and futures (GC=F) work the same way as US stocks.
- **Market lists.** Pull today's gainers, losers, most active or trending tickers and read them in the same run.
- **Pasted links work.** A Yahoo Finance quote link, `$AAPL` or `aapl` all become `AAPL`.

### What does it cost?

| Event | Price per 1,000 rows |
|---|---|
| Quote | $1.00 |
| Price bar (each daily, weekly or monthly bar, dividend or split) | $0.50 |
| Statement period | $1.00 |
| News story | $1.00 |
| Detail block (analysis, holders or profile) | $1.00 |

Summary rows are free, and unknown symbols cost nothing. Larger Apify plans pay less per row (shown on the Pricing tab). The run stops cleanly at your maximum charge and keeps everything read so far.

**Free Apify plan:** up to 500 rows and 60 Yahoo Finance pages per run. Any paid Apify plan removes both limits.

### Which inputs can I use?

| Input | What it does |
|---|---|
| `symbols` | Tickers, one per line, up to 500. Pasted quote links work too. |
| `data` | Any of `quote`, `history`, `financials`, `news`, `analysis`, `holders`, `profile`. Default: `quote`. |
| `list` | A market list to add: `most-active`, `gainers`, `losers`, `trending`, `52-week-gainers`, `crypto`, or `none`. |
| `historyRange` | How far back history goes: `1mo`, `3mo`, `6mo`, `ytd`, `1y`, `2y`, `5y`, `10y` or `max`. Default `1y`. |
| `interval` | `1d`, `1wk` or `1mo`. |
| `onlyNew` | Skip rows an earlier run already returned. |
| `maxSymbolsFromList` | How many symbols to take from the list, from the top (up to 100, default 25). |
| `startDate`, `endDate` | Exact history window (YYYY-MM-DD, end day included). Overrides `historyRange`. |

### How do I track prices over time?

1. Save your input as a task with your symbols.
2. Add a schedule to the task (daily after the close, or hourly while markets are open).
3. Each quote row shows the change since the run before. Add `history` with **Only new rows** on to collect each new bar once.

### What happens when something goes wrong?

- Bad input (no symbols, an unknown list, a wrong date) ends the run with a message and charges nothing.
- Unknown symbols are listed in the run's status message and cost nothing; the rest of the run carries on.
- If one kind of data cannot be read for a symbol, the rest still comes back and the summary row says what is missing.
- If the run's time limit is near, it stops early, saves everything and says which symbols were not finished.

### Can I call it from an agent or my own code?

Yes. It works through the Apify API, the Apify MCP server and the Apify client libraries, with the same input as above. A one-symbol quote run returns in well under a minute.

### Is it legal to collect Yahoo Finance data?

The Actor reads public Yahoo Finance pages, the same ones anyone sees without signing in. Holders are organisations, and officers are listed by name and title only, as the company publishes them. You are responsible for how you use the data, including Yahoo's own terms and the laws that apply to you. Market data is for information, not trading advice.

### Questions or problems?

Open an issue on the Issues tab and we will answer within a day. If the Actor helped, a rating on the Store helps other people find it.

# Changelog

This Actor's version history is a separate document: https://apify.com/locaihost/yahoo-finance/changelog.md

# Actor input Schema

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

Yahoo Finance tickers, one per line, up to 500: stocks (AAPL, 7203.T, VOD.L), ETFs (SPY), indices (^GSPC), crypto (BTC-USD), currencies (EURUSD=X) or futures (GC=F). A pasted Yahoo Finance quote link works too.

## `data` (type: `array`):

What to read for each symbol. quote = price, change, market cap, ratios and 52-week range; history = price bars plus dividends and splits; financials = income statement, balance sheet and cash flow (annual and trailing 12 months); news = recent headlines; analysis = estimates, rating changes and price targets; holders = top institutions and funds; profile = business summary, sector, employees and officers.

## `list` (type: `string`):

Also read the symbols on one of Yahoo Finance's market lists (added after your own symbols, keeping their list position).

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

How far back price history goes, ending today. Used when 'history' is in Data.

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

One row per trading day, week or month.

## `onlyNew` (type: `boolean`):

Skip rows an earlier run already returned: old price bars, statement periods, news stories and unchanged detail blocks. Quotes always come back (with the price change since the last run). Skipped rows are not charged.

## `maxSymbolsFromList` (type: `integer`):

How many symbols to take from the market list, from the top.

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

Exact start date for price history (YYYY-MM-DD). Overrides History range.

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

Exact end date for price history (YYYY-MM-DD), included. Empty means today.

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "MSFT",
    "^GSPC",
    "BTC-USD"
  ],
  "data": [
    "quote"
  ],
  "list": "none",
  "historyRange": "1y",
  "interval": "1d",
  "onlyNew": false,
  "maxSymbolsFromList": 25
}
```

# Actor output Schema

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

One row per symbol: price, change, change since the last run, market cap, ratios and 52-week range.

## `history` (type: `string`):

Price bars (open, high, low, close, adjusted close, volume), dividends and splits.

## `statements` (type: `string`):

One row per statement period with headline figures and every line item.

## `news` (type: `string`):

Recent headlines per symbol with publisher, link and time.

## `summaries` (type: `string`):

One free row per symbol: what was returned, skipped or not available, and a note on how it ended.

## `summary` (type: `string`):

Counts per event, anything that failed, and cost.

# 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"
    ],
    "data": [
        "quote"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("locaihost/yahoo-finance").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"],
    "data": ["quote"],
}

# Run the Actor and wait for it to finish
run = client.actor("locaihost/yahoo-finance").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"
  ],
  "data": [
    "quote"
  ]
}' |
apify call locaihost/yahoo-finance --silent --output-dataset

```

## MCP server setup

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

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/4WbcZMvQYGsoQ0BHT/builds/pIQtK0zWKwfrRk5vu/openapi.json
