# Yahoo Finance Scraper: Quotes, Analyst Targets & Alerts (`datasmithlab/yahoo-finance-scraper`) Actor

Export Yahoo Finance data for stocks, ETFs, indices, crypto, currencies and futures: price, valuation ratios, dividends, next earnings date, analyst rating and price targets, latest analyst actions, daily price history. Monitoring mode returns only what changed since the last run.

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

## Pricing

from $0.60 / 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.
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: Quotes, Analyst Targets & Change Alerts

Export [Yahoo Finance](https://finance.yahoo.com) data for **stocks, ETFs, indices, crypto, currencies and futures** with one symbol list. Every symbol returns one row: price and day change, market cap, P/E and other ratios, dividends and ex-dividend date, **next earnings date and estimates**, **analyst rating, average price target and upside**, the **latest analyst actions** (firm, old and new rating, old and new target), the last four earnings surprises and performance against the S\&P 500. Optional: about **one year of daily price history** per symbol.

- **Change alerts for traders.** Turn on **Only changes** and schedule the Actor: each run returns only symbols that are new or whose analyst rating, average price target, analyst count, next earnings date, dividend or latest analyst action changed. Symbols that did not change are **not returned and not charged**. Add a day-move threshold (for example 5 %) to also get symbols that jumped or dropped.
- **Daily price history.** One row per trading day: open, high, low, close, adjusted close, volume, dividend, split. In monitoring mode only the days since your last run are added.
- **Any Yahoo symbol.** `AAPL`, `BRK-B`, `0700.HK`, `7203.T`, `SAP.DE`, `SPY`, `^GSPC`, `BTC-USD`, `EURUSD=X`, `ES=F`. Unknown symbols are reported in the `SYMBOLS` report and are free.
- **Many symbols per run.** Up to 500 symbols; duplicates are ignored.

No login and no API key. The Actor reads the public Yahoo Finance quote and history pages at a slow pace with an honest user agent (about one request every 1.5 seconds). It does not call Yahoo's `query1`/`query2` API hosts. **No person names (company officers) or contact details are collected.**

### What you get

- **Quote row.** `symbol`, `name`, `quoteType`, `exchange`, `currency`, `marketState`, `price`, `change`, `changePercent`, `previousClose`, `open`, `dayLow`, `dayHigh`, `volume`, `avgVolume3m`, `marketCap`, `fiftyTwoWeekLow/High`, `fiftyDayAverage`, `twoHundredDayAverage`, pre- and post-market price, `bid`, `ask`.
- **Valuation and fundamentals (stocks).** `trailingPE`, `forwardPE`, `trailingEps`, `forwardEps`, `pegRatio`, `priceToBook`, `beta`, `dividendRate`, `dividendYieldPct`, `exDividendDate`, `payoutRatioPct`, shares, float, short interest, `enterpriseValue`, revenue, margins, return on equity, debt to equity, free cash flow, growth.
- **Earnings.** `nextEarningsDate`, EPS and revenue estimate, `earningsHistory` (last four quarters: actual, estimate, surprise %).
- **Analysts.** `recommendationKey`, `recommendationMean`, `analystCount`, `targetLow/Mean/Median/High`, `targetUpsidePct`, `ratingsTrend` (strong buy to strong sell counts), `recentRatingChanges` (firm, grades, targets).
- **Profile and performance.** `sector`, `industry`, `country`, `website`, `employees`, short `businessSummary`, 5-day to 5-year returns against a benchmark.
- **Monitoring mode.** `changeType` (`NEW` / `CHANGED` / `MOVE`) and `changedFields` with old and new values.
- **Price bar rows** (optional). `symbol`, `date`, `open`, `high`, `low`, `close`, `adjClose`, `volume`, `dividend`, `splitRatio`.
- **Reports** in the run's key-value store: `SYMBOLS` (status of every symbol) and `HEALTH`.

### How to use it

| You want | Set |
|---|---|
| A watchlist snapshot | **Ticker symbols**, nothing else |
| A daily analyst-change feed | **Only changes** on, schedule the Actor daily |
| Also big movers | **Only changes** on, **Also alert on a day move** `5` |
| A year of prices for backtests | **Add daily price history** on |
| New price bars only, every day | **Only changes** and **Add daily price history** on |

Fields that do not exist for a symbol type (for example analyst targets for an index or a currency) are returned empty.

### Pricing

Pay per event: a small start fee, **one charge per quote row**, and a lower charge per **price history bar**. Unchanged symbols in monitoring mode, unknown symbols and invalid symbols are free. Set **Max rows** or your run's maximum charge to cap spend.

### Good to know

- Prices are delayed about 15 minutes for many exchanges, as on the Yahoo Finance website. The Actor is for research, screening and alerts, not for trading execution.
- The daily history covers about the last year. Option chains and full financial statements are not included.
- Yahoo's terms restrict automated access; you are responsible for how you use the data. For commercial redistribution check Yahoo's terms and your market-data licenses.

# Actor input Schema

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

One per line, as on Yahoo Finance: stocks (AAPL, 0700.HK, BRK-B), ETFs (SPY), indices (^GSPC), crypto (BTC-USD), currencies (EURUSD=X), futures (ES=F). Up to 500 per run.

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

Adds one row per trading day for about the last year (open, high, low, close, adjusted close, volume, dividends, splits) for every symbol. Billed per price-bar row.

## `onlyChanges` (type: `boolean`):

Schedule the Actor and every later run returns only symbols that are new or whose analyst rating, average price target, analyst count, next earnings date, dividend or latest analyst action changed. Unchanged symbols are not returned and not charged. With price history on, only trading days after the last run are added.

## `alertDayMovePct` (type: `number`):

Monitoring mode only: also return a symbol (changeType MOVE) when its price moved at least this many percent on the day, e.g. 5. Leave empty to ignore price moves.

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

Stop after this many rows in total (quote rows and price bars; you pay per row).

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

Requests go out without a proxy first. Only if Yahoo Finance blocks them (or asks for cookie consent from a non-US address) is this proxy used (at most 3 new IPs, then the run stops and reports it).

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "MSFT",
    "BTC-USD"
  ],
  "includeHistory": false,
  "onlyChanges": false,
  "maxItems": 1000,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Quote rows (JSON/CSV/Excel export).

## `priceBars` (type: `string`):

Daily price bars (when enabled).

## `allFields` (type: `string`):

Every field, including ratings trend, rating changes and earnings history.

## `symbols` (type: `string`):

Status of every symbol.

## `health` (type: `string`):

Empty-field ratios, proxy use, unchanged symbols skipped.

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

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

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

```

## MCP server setup

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