# Yahoo Finance Scraper — Stocks, Prices & OHLCV JSON (`sebbasberrsa/yahoo-finance-pro`) Actor

Extract real-time stock quotes, historical OHLCV candles, volume, 52-week ranges, and market metadata from Yahoo Finance in clean JSON/CSV. Ultra-fast API-first Actor, MCP-ready for AI agents.

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

## Pricing

from $2.00 / 1,000 ticker quote & ohlcv extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 — Stocks, Prices & OHLCV JSON

Extract real-time stock quotes, historical **OHLCV candles** (`open`, `high`, `low`, `close`, `volume`), 52-week highs/lows, and market metadata from **Yahoo Finance** in clean JSON, CSV, or Excel format.

Built with an **ultra-fast API-first architecture** (no heavy browser overhead) for **trading bots, financial dashboards, n8n/Make workflows, and AI Agents (MCP)**.

***

### What data does this Actor extract?

| Field | Type | Description |
| :--- | :--- | :--- |
| `symbol` | `string` | Ticker symbol (`AAPL`, `MSFT`, `BTC-USD`, `^GSPC`) |
| `shortName` | `string \| null` | Asset short name |
| `currency` | `string \| null` | Trading currency (`USD`, `EUR`, etc.) |
| `exchangeName` | `string \| null` | Exchange name (`NasdaqGS`, `NYSE`, etc.) |
| `instrumentType` | `string \| null` | `EQUITY`, `ETF`, `CRYPTOCURRENCY`, `INDEX` |
| `regularMarketPrice` | `number` | Current / latest market price |
| `previousClose` | `number \| null` | Previous close price |
| `change` | `number \| null` | Absolute price change |
| `changePercent` | `number \| null` | Percentage change |
| `fiftyTwoWeekHigh` | `number \| null` | 52-week high price |
| `fiftyTwoWeekLow` | `number \| null` | 52-week low price |
| `regularMarketVolume` | `integer \| null` | Latest market volume |
| `history` | `array` | Historical OHLCV candles (`date`, `open`, `high`, `low`, `close`, `volume`) |
| `scrapedAt` | `string` | ISO 8601 extraction timestamp |

***

### Input Configuration

```json
{
  "symbols": ["AAPL", "MSFT"],
  "range": "5d",
  "interval": "1d",
  "includeHistory": true
}
```

***

### Integrations & MCP / AI Agents

Connect this Actor to **n8n, Make, Zapier**, or directly to **Claude, Cursor, and Windsurf** via the **Apify MCP Server** for real-time financial market queries.

***

### FAQ

**Does it support crypto and indices?**
Yes. Use standard Yahoo Finance tickers like `BTC-USD`, `ETH-USD`, `^GSPC`, or `^IXIC`.

**How fast is it?**
Because it uses direct JSON endpoints without launching a browser, it typically finishes in **2–4 seconds** with minimal compute cost.

# Actor input Schema

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

List of stock, ETF, crypto, or index ticker symbols (e.g. 'AAPL', 'MSFT', 'BTC-USD', '^GSPC').

## `range` (type: `string`):

Time range for historical OHLCV candles.

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

Time interval between historical candles.

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

Include historical open/high/low/close/volume candles array in each ticker output.

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "MSFT"
  ],
  "range": "5d",
  "interval": "1d",
  "includeHistory": true
}
```

# Actor output Schema

## `dataset` (type: `string`):

Structured stock quotes, market metadata, and historical OHLCV candles in JSON/CSV

# 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"
    ],
    "range": "5d",
    "interval": "1d"
};

// Run the Actor and wait for it to finish
const run = await client.actor("sebbasberrsa/yahoo-finance-pro").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",
    ],
    "range": "5d",
    "interval": "1d",
}

# Run the Actor and wait for it to finish
run = client.actor("sebbasberrsa/yahoo-finance-pro").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"
  ],
  "range": "5d",
  "interval": "1d"
}' |
apify call sebbasberrsa/yahoo-finance-pro --silent --output-dataset

```

## MCP server setup

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

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/PX8aBayr1XvUM1Kzs/builds/TeMb6kvw4qcjda6PL/openapi.json
