# Yahoo Finance Scraper | Real-Time Stock Market API (`andok/yahoo-finance-scraper`) Actor

Scrape real-time stock prices, pre-market data, and trading volumes directly from Yahoo Finance for your financial models and trading algorithms.

- **URL**: https://apify.com/andok/yahoo-finance-scraper.md
- **Developed by:** [Andok](https://apify.com/andok) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 11 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.47 / 1,000 quote fetcheds

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 Stock Quote Scraper

Scrape real-time stock quotes and financial data from Yahoo Finance to power dashboards, AI agents, and alerting systems. Feed it a list of ticker symbols and get back live market prices, volume, market cap, and 52-week range — all from the public Yahoo Finance API in a single fast request. Schedule it on Apify to build a continuously updated market data pipeline.

### Features

- **Bulk ticker lookup** — fetch quotes for hundreds of stock symbols in a single run
- **Real-time prices** — returns current market price, pre/post-market data, and daily change percentage
- **Market fundamentals** — includes market cap, trading volume, and 52-week high/low
- **Multi-asset support** — works with stocks, ETFs, indices, and forex pairs available on Yahoo Finance
- **No API key required** — queries the public Yahoo Finance API endpoint directly
- **Batch optimization** — processes up to 100 tickers per API call for maximum speed
- **Pay-per-result pricing** — only pay for quotes returned, with charge-limit safety built in

### Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `tickers` | `array` | Yes | — | List of stock ticker symbols to look up (e.g. `AAPL`, `TSLA`, `SPY`, `BTC-USD`) |
| `timeoutSeconds` | `integer` | No | `15` | API request timeout in seconds (1-120) |

#### Input Example

```json
{
  "tickers": ["AAPL", "TSLA", "MSFT", "SPY"],
  "timeoutSeconds": 15
}
```

### Output

Each dataset item represents one stock quote. Key fields:

- `symbol` (`string`) — ticker symbol
- `shortName` (`string`) — company or instrument name
- `regularMarketPrice` (`number`) — current market price
- `regularMarketChangePercent` (`number`) — daily price change in percent
- `regularMarketVolume` (`number`) — trading volume
- `marketCap` (`number`) — market capitalization
- `fiftyTwoWeekHigh` (`number`) — 52-week high price
- `fiftyTwoWeekLow` (`number`) — 52-week low price
- `currency` (`string`) — price currency (e.g. `USD`)

#### Output Example

```json
{
  "symbol": "AAPL",
  "shortName": "Apple Inc.",
  "regularMarketPrice": 237.45,
  "regularMarketChangePercent": 1.23,
  "regularMarketVolume": 54123000,
  "marketCap": 3620000000000,
  "fiftyTwoWeekHigh": 243.20,
  "fiftyTwoWeekLow": 164.08,
  "currency": "USD"
}
```

### Pricing

| Event | Cost |
|-------|------|
| Quote Fetched | Pay-per-event (see actor pricing page) |

### Use Cases

- **Portfolio dashboards** — build real-time stock monitoring dashboards with scheduled Apify runs
- **Trading alerts** — trigger notifications when prices cross thresholds by combining with webhooks
- **Financial research** — collect market data snapshots for backtesting or analysis
- **AI agent tools** — supply live market context to LLM agents and financial chatbots
- **Spreadsheet automation** — export daily quotes to Google Sheets or Excel via Apify integrations
- **Multi-asset tracking** — monitor stocks, ETFs, crypto pairs, and indices from a single actor

### Related Actors

| Actor | What it adds |
|-------|-------------|
| [CoinGecko Crypto Scraper](https://apify.com/andok/coingecko-scraper) | Get detailed crypto market data with market cap ranking and supply metrics |
| [Binance Ticker Scraper](https://apify.com/andok/binance-ticker-scraper) | Pull real-time crypto exchange data directly from Binance |
| [RSS & Atom Feed Parser](https://apify.com/andok/rss-parser) | Combine price data with financial news from RSS feeds |

### Notes

- Yahoo Finance may occasionally block requests or change their API structure. If you encounter errors, try reducing the batch size or spacing runs further apart.
- Pre-market and post-market prices are included when available but may show `null` outside trading hours.

# Actor input Schema

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

List of stock ticker symbols to look up on Yahoo Finance. Supports stocks (AAPL), ETFs (SPY), indices (^GSPC), forex (EURUSD=X), and crypto pairs (BTC-USD).

## `timeoutSeconds` (type: `integer`):

API request timeout in seconds. Increase for large ticker lists that may require multiple batch requests.

## Actor input object example

```json
{
  "tickers": [
    "AAPL",
    "TSLA"
  ],
  "timeoutSeconds": 15
}
```

# Actor output Schema

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

No description

## `resultsCsv` (type: `string`):

No description

## `run` (type: `string`):

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("andok/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 = { "tickers": [
        "AAPL",
        "TSLA",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("andok/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 '{
  "tickers": [
    "AAPL",
    "TSLA"
  ]
}' |
apify call andok/yahoo-finance-scraper --silent --output-dataset

```

## MCP server setup

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