# Yahoo Finance Quote Scraper (`usestring/yahoo-finance-quotes`) Actor

Scrape Yahoo Finance quotes by ticker: price, change and changePercent, previousClose, day range, 52-week range, marketCap as an exact 4449911701504 rather than 4.45T, peRatio, eps, volume, dividendYield, beta, currency and exchange. Equities, ETFs, indices and futures. No API key or session crumb.

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

## Pricing

from $1.25 / 1,000 results

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/platform/actors/running/actors-in-store#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 Scraper — price, market cap and PE ratio by ticker

This Actor collects Yahoo Finance quotes by ticker symbol. It returns the price, change, day range,
52-week range, market cap, PE ratio, EPS, volume, dividend yield and beta as **numbers** —
`4449911701504`, not the `"4.45T"` the quote page displays.

No Yahoo account, API key or session crumb is used — this reads the public quote page.

### What it returns

| Field | Type | Notes |
| --- | --- | --- |
| `ticker` | string | Normalised to upper case, e.g. `AAPL` |
| `name` | string | Company or fund name, e.g. `Apple Inc.` |
| `price` | number | Regular-market price, e.g. `304.91` |
| `currency` | string | e.g. `USD` |
| `change`, `changePercent` | number | Full precision, e.g. `-3.350006` and `-1.0867469` — the percent field is already in percent, not a fraction |
| `previousClose` | number | |
| `dayLow`, `dayHigh` | number | Today's range |
| `fiftyTwoWeekLow`, `fiftyTwoWeekHigh` | number | 52-week range |
| `marketCap` | number | Exact, e.g. `4449911701504` — the page shows "4.45T" |
| `peRatio` | number | Trailing PE; `null` for a company with no trailing earnings |
| `eps` | number | Trailing EPS, negative where the company is loss-making |
| `volume` | number | e.g. `34168163` — the page shows "34.17M" |
| `dividendYield` | number | In percent, e.g. `0.35` for "0.35%"; falls back to a fund's distribution yield |
| `beta` | number | Falls back to a fund's 3-year beta where no plain beta is published |
| `exchange` | string | e.g. `NasdaqGS` |
| `sourceUrl`, `collectedAt` | string | Provenance for every row |

### Input

```json
{ "tickers": ["AAPL", "MSFT", "BRK-B", "^GSPC", "SHEL.L"] }
```

| Field | Description |
| --- | --- |
| `tickers` | Yahoo Finance symbols. Required, 1–200. |
| `maxItems` | Cap on dataset items. Default 1000. Free plans stop at 250 requests and 250 results — see below. |
| `concurrency` | Tickers fetched in parallel. Default 5. |

Symbols are upper-cased and de-duplicated, so `aapl` and `AAPL` collapse to one fetch. Beyond plain
US equities the input accepts suffixed foreign listings (`SHEL.L`, `7203.T`), class shares (`BRK-B`),
indices (`^GSPC`) and futures (`CL=F`). Only symbols are accepted — not Yahoo Finance URLs.

### How it reads exact numbers

The Yahoo Finance quote page is a SvelteKit app that inlines the JSON responses of the API calls it
made, so the whole quote is already present in the HTML as exact numbers, with `4449911701504`
sitting alongside the `"4.45T"` that gets rendered. This Actor reads that embedded `quoteSummary`
payload directly — there is no model-backed extraction and no display string to unpick.

Requesting the same payload from `query1.finance.yahoo.com` directly is not possible without the
per-session crumb and cookie pair the page holds, which answers `Invalid Crumb`. Reading the
response Yahoo already embedded avoids acquiring one.

### Use cases

- Refreshing a portfolio or watchlist with current prices on a schedule
- Screening a ticker universe on PE ratio, EPS, market cap or dividend yield
- Backfilling a spreadsheet, dashboard or database with numeric fundamentals
- Comparing a holding against its 52-week range for entry and exit rules
- Building alerts on daily change percent across a list of symbols

### Reliability

Every field is read from the payload Yahoo Finance itself embedded in the page, so a value is either
present and exact or absent. Yahoo wraps each measure as `{ raw, fmt }` and degrades an absent one to
an empty object rather than to zero, which this Actor preserves as `null` — a missing PE ratio comes
back as `null`, never as a misleading `0`.

Percentage measures are converted from Yahoo's stored fraction to percent only where Yahoo's own
formatted value carries a `%` suffix, so `changePercent` and `dividendYield` are consistently in
percent.

A ticker whose page carries no regular-market price is recorded under `failures` in the run's
`SUMMARY` rather than emitted as an empty row, and a run in which every ticker failed exits with an
error.

### Frequently asked questions

**Do I need a Yahoo Finance account, API key or crumb?** No. This Actor reads the quote data Yahoo
Finance already embeds in its own public quote page, so there is no login, no API key and no
per-session crumb to obtain.

**Is the market cap a number or a display string?** A number. The Yahoo Finance Scraper returns
`marketCap` as an exact integer such as `4449911701504`, where the page renders "4.45T". Price,
volume, EPS and both ranges are numbers too.

**What ticker formats does the input accept?** Plain US symbols (`AAPL`), class shares (`BRK-B`),
suffixed foreign listings (`SHEL.L`, `7203.T`), indices (`^GSPC`) and futures (`CL=F`). The input
takes symbols only, not Yahoo Finance URLs.

**How many tickers can one run collect?** Up to 200 per run, and this Actor returns exactly one row
per ticker.

**Is `changePercent` a fraction or a percentage?** A percentage. A -1.09% move is returned as
`-1.0867469`, not as `-0.010867469`. `dividendYield` follows the same convention, so 0.35% is
returned as `0.35`.

**Does it return historical prices, options chains, news or financial statements?** No. This Actor
returns the current quote summary for each ticker — the fields listed above and nothing further.

### Limitations

Current quote data only: no historical price series, no options chains, no analyst estimates, no
financial statements, no news and no ticker search or screening. Values reflect what Yahoo Finance
shows publicly at collection time, stamped in `collectedAt`, and are delayed or stale exactly as
Yahoo's own page is for that exchange. Fields Yahoo does not publish for a given instrument — a PE
ratio for a loss-making company, a dividend yield for a non-payer — come back as `null`.

### Free plan limit

Runs started from an Apify **free plan** stop at **250 requests and 250 results**, and the run
reports that it reached the limit. Any paid plan runs the full input and `maxItems` you set. The
`tickers` input already caps at 200, so in practice a free-plan run is bounded by that ceiling
rather than by the 250 limit.

The limit exists because this Actor fetches through our own infrastructure, which Apify does not
cover for free-plan runs. It binds on requests as well as results so that a large input list cannot
spend those fetches for rows the run will not return.

# Actor input Schema

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

Stock symbols, e.g. AAPL.

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

Global cap on dataset items. Runs started from an Apify free plan stop at 250 requests and 250 results; any paid plan runs the full amount.

## `concurrency` (type: `integer`):

Targets fetched in parallel.

## Actor input object example

```json
{
  "tickers": [
    "AAPL",
    "MSFT"
  ],
  "maxItems": 1000,
  "concurrency": 5
}
```

# Actor output Schema

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

Collect Yahoo Finance quotes by ticker - price, change, day and 52-week range, market cap, PE ratio, EPS, volume and beta.

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

Item count, failure count and every target that failed, with its error.

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

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

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

```

## MCP server setup

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