# Yahoo Finance Scraper — Stock Quotes, Fundamentals & History (`jeffev/yahoo-finance-scraper`) Actor

Yahoo Finance data for stocks, ETFs, crypto, currencies and indices from any exchange: price, change, volume, market cap, P/E, dividend yield. Fundamentals mode adds sector, revenue, margins, debt and analyst targets. Price history and screeners (top gainers, most active).

- **URL**: https://apify.com/jeffev/yahoo-finance-scraper.md
- **Developed by:** [Jefferson Valandro](https://apify.com/jeffev) (community)
- **Categories:** News, 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.35 / 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.
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, Fundamentals & History

Get **Yahoo Finance data** for **stocks, ETFs, crypto, currencies and indices from any exchange** (AAPL, PETR4.SA, SAP.DE, 7203.T, BTC-USD, EURUSD=X, ^GSPC): price, change, volume, market cap, P/E, EPS, dividend yield, 52-week range, moving averages and analyst rating.

Turn on **fundamentals** for sector, industry, website, employees, business summary, officers, revenue, margins, EBITDA, cash, debt, ROE, free cash flow, analyst price targets, recommendation, beta and ownership. Add **price history** (OHLCV candles from 1 minute to 1 month). Or start from **Yahoo's screeners**: day gainers, losers, most active, undervalued growth stocks and more.

Built for **investors, analysts, dashboards and spreadsheets, trading bots and financial newsletters**.

### Why this one

- **Any market**: US, Brazil (.SA), Europe, Asia, crypto, forex, indices, in one run.
- **Up to 50 symbols per request**: hundreds of quotes in seconds.
- **Search by company name** when you don't know the ticker.
- **Screeners** for daily movers and stock ideas.
- **History embedded** in each quote item, ready for charts.

### Input

```json
{
  "symbols": ["AAPL", "NVDA", "PETR4.SA", "BTC-USD"],
  "searchCompanies": ["Embraer"],
  "screeners": ["day_gainers"],
  "includeFundamentals": true,
  "historyRange": "6mo",
  "historyInterval": "1d"
}
```

### Output

| Field | Description |
|---|---|
| `symbol`, `shortName`, `longName`, `quoteType`, `exchange`, `currency`, `marketState`, `url` | instrument |
| `regularMarketPrice`, `regularMarketChange`, `regularMarketChangePercent`, open/high/low/previous close, volume | price |
| `marketCap`, `trailingPE`, `forwardPE`, `priceToBook`, `epsTrailingTwelveMonths`, `dividendYield`, `fiftyTwoWeekHigh`, `fiftyTwoWeekLow` | valuation |
| `sector`, `industry`, `website`, `employees`, `businessSummary`, `officers` | fundamentals mode: profile |
| `totalRevenue`, margins, `ebitda`, `totalCash`, `totalDebt`, `returnOnEquity`, `freeCashflow`, `targetMeanPrice`, `recommendation`, `beta` | fundamentals mode: financials |
| `history[]` | `date`, `open`, `high`, `low`, `close`, `volume` |
| `source` | input, company search or screener |

### Example output

One real item from a test run (long texts and lists shortened):

```json
{
  "type": "quote",
  "symbol": "AAPL",
  "shortName": "Apple Inc.",
  "longName": "Apple Inc.",
  "quoteType": "EQUITY",
  "exchange": "NMS",
  "fullExchangeName": "NasdaqGS",
  "currency": "USD",
  "marketState": "REGULAR",
  "regularMarketPrice": 337.59,
  "regularMarketChange": -7.0400085,
  "regularMarketChangePercent": -2.0427432,
  "regularMarketOpen": 342.67,
  "regularMarketDayHigh": 343.78,
  "regularMarketDayLow": 336.5206,
  "regularMarketPreviousClose": 344.63,
  "regularMarketVolume": 24000193,
  "averageDailyVolume3Month": 41866653,
  "marketCap": 4926849155072,
  "trailingPE": 38.714447,
  "forwardPE": 35.341373,
  "priceToBook": 45.868206,
  "epsTrailingTwelveMonths": 8.72,
  "epsForward": 9.55226,
  "bookValue": 7.36
}
```

### Notes

- Data comes from Yahoo Finance and may be delayed depending on the exchange. Not investment advice.

### Feedback

Found a problem or need a field? Open an issue in the **Issues** tab: every issue is read and answered. If the actor helped you, a review on the Store helps a lot.

### How much does it cost?

You pay only for results delivered, at a fixed price per item. **Apify platform usage is included** in that price, so there are no compute costs on top. Errors and items that couldn't be found are free.

| What you get | Price | Example |
|---|---|---|
| Quote with fundamentals | $0.002 each | 1,000 quotes with fundamentals = $2.00 |
| Quote | $0.0005 each | 1,000 quotes = $0.50 |

The Apify **Free plan includes $5 of monthly credit**, enough for about **2,500 quotes with fundamentals** per month at no cost. You can also set a maximum spend per run.

On paid Apify plans it gets cheaper automatically: **10% off on Starter, 20% on Scale and 30% on Business**.

# Actor input Schema

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

Yahoo Finance symbols: stocks (AAPL, PETR4.SA, SAP.DE, 7203.T), ETFs (SPY), crypto (BTC-USD), currencies (EURUSD=X), indices (^GSPC).

## `searchCompanies` (type: `array`):

Company names (e.g. 'Petrobras', 'Nvidia'); the best matching symbol is used.

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

Yahoo Finance predefined lists (US market).

## `maxPerScreener` (type: `integer`):

Limit per screener.

## `includeFundamentals` (type: `boolean`):

Add sector, industry, website, employees, business summary, officers, revenue, margins, EBITDA, cash, debt, ROE, free cash flow, analyst targets and recommendation, beta, ownership.

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

Add historical prices to each item.

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

Candle size (intraday intervals only work for recent ranges).

## `symbolsPerSearch` (type: `integer`):

How many matching symbols to take for each company name (e.g. 2 for PETR3 and PETR4).

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "MSFT",
    "PETR4.SA",
    "BTC-USD"
  ],
  "maxPerScreener": 100,
  "includeFundamentals": false,
  "historyRange": "none",
  "historyInterval": "1d",
  "symbolsPerSearch": 1
}
```

# Actor output Schema

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

Yahoo Finance quotes.

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

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

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

```

## MCP server setup

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