# Yahoo Finance Scraper (`code-node-tools/yahoo-finance-scraper`) Actor

Scrape Yahoo Finance stock data for any tickers - full company info, real-time prices, news & historical OHLCV data. A no-API-key Yahoo Finance API alternative that exports clean JSON, CSV & Excel.

- **URL**: https://apify.com/code-node-tools/yahoo-finance-scraper.md
- **Developed by:** [CodeNodeTools](https://apify.com/code-node-tools) (community)
- **Categories:** Developer tools, Automation, News
- **Stats:** 0 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 ticker info & real-time prices

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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

Extract **full stock info, real-time prices, financial news, and historical market data** from [Yahoo Finance](https://finance.yahoo.com) for any list of ticker symbols. A fast, reliable **Yahoo Finance API alternative** built on the open-source [yfinance](https://github.com/ranaroussi/yfinance) library — no API key, no rate-limit headaches, just clean structured JSON.

### What does Yahoo Finance Scraper do?

Yahoo Finance Scraper collects company fundamentals, the latest market price, news, and day-by-day price history for the stocks, ETFs, and indices you choose. You give it a list of ticker symbols (for example `["AAPL", "GOOG"]`) and an optional date range, and it returns one rich, structured record per ticker. It does **not** require a Yahoo Finance API key and does **not** extract private user data.

Whether you need a one-off snapshot of **Apple stock data** or a scheduled feed of **real-time stock prices** across a whole watchlist, this Yahoo Finance data scraper turns the website into a clean dataset you can download or pipe into your own systems.

### Why scrape Yahoo Finance?

Yahoo Finance is one of the richest free sources of stock market data on the web, but it has no official public API and the page markup changes often. This Actor handles that for you and adds the power of the Apify platform on top.

- 📈 **Full coverage** — fundamentals, real-time price, news, and historical OHLCV data in a single run.
- ⚡ **Real-time prices** — pull the latest available market price for each ticker.
- 🗞️ **Financial news** — grab the most recent Yahoo Finance news articles per symbol.
- 📅 **Historical stock data** — request any custom date range in `YYYY-MM-DD` format.
- 🧩 **Multiple tickers at once** — scan an entire portfolio or watchlist in one go.
- 🛡️ **Resilient** — a bad symbol produces an error record instead of crashing the whole run.

#### Built on the Apify platform

This is more than a script — it's a Yahoo Finance scraper supercharged by the Apify platform:

- **Scheduling** — run it every morning before the market opens to refresh your data automatically.
- **API access** — trigger runs and pull results programmatically via the [Apify API](https://docs.apify.com/api/v2).
- **Integrations** — push data straight to Google Sheets, Slack, Zapier, Make, webhooks, and more.
- **Storage & export** — keep every run's dataset, downloadable in multiple formats.
- **Monitoring** — get alerts and logs for every scheduled run.

#### Who uses Yahoo Finance Scraper?

- 💼 **Investors & analysts** building watchlists and tracking real-time stock prices.
- 🤖 **Quant & algo traders** collecting historical stock data to backtest strategies.
- 📊 **Data scientists** training models on financial fundamentals and price history.
- 📰 **Fintech & media teams** pulling the latest stock news into dashboards or newsletters.
- 🏦 **Finance apps** that need a dependable stock data API alternative without per-call fees.

### What data can Yahoo Finance Scraper extract?

Each ticker becomes one dataset record. The most useful fields include:

| Field          | Type   | Description                                           |
| -------------- | ------ | ----------------------------------------------------- |
| `ticker`       | string | The ticker symbol (e.g. `AAPL`).                      |
| `shortName`    | string | Company or fund name.                                 |
| `currentPrice` | number | Latest available real-time price.                     |
| `currency`     | string | Price currency (e.g. `USD`).                          |
| `exchange`     | string | Listing exchange code.                                |
| `marketCap`    | number | Market capitalization.                                |
| `sector`       | string | Business sector.                                      |
| `industry`     | string | Industry classification.                              |
| `website`      | string | Company website URL.                                  |
| `info`         | object | The full raw Yahoo Finance info object (180+ fields). |
| `news`         | array  | Latest news articles for the ticker.                  |
| `history`      | array  | Daily OHLCV rows (open, high, low, close, volume).    |
| `scrapedAt`    | date   | UTC timestamp of the scrape.                          |

### How to scrape Yahoo Finance stock data

1. Click **Try for free** to open the Yahoo Finance Scraper.
2. Enter one or more ticker symbols in the **Tickers** field (e.g. `AAPL`, `GOOG`, `MSFT`).
3. (Optional) Set a **Start Date** and **End Date** in `YYYY-MM-DD` format to control the historical range.
4. Click **Start** and wait for the run to finish.
5. Download your data as **JSON, CSV, Excel, or HTML**, or grab it through the API.

### How much does it cost to scrape Yahoo Finance?

Yahoo Finance Scraper uses the **pay-per-event** pricing model — you pay only for data that is successfully delivered, and failed tickers are never billed. This keeps costs predictable and scales naturally with how much data you actually pull.

| Event               | When it's charged                                                     | Price    |
| ------------------- | --------------------------------------------------------------------- | -------- |
| `apify-actor-start` | Once per run (Apify's built-in start event; first 5s of compute free) | $0.00005 |
| `ticker-info`       | Once per ticker (full info + real-time price)                         | $0.0009  |
| `news-item`         | Per news article returned                                             | $0.0003  |
| `history-point`     | Per historical day returned                                           | $0.0001  |

### Input

Yahoo Finance Scraper has a simple input — see the **Input** tab for the full configuration. The key fields are:

- **Tickers** (`tickers`, required) — an array of ticker symbols, e.g. `["AAPL", "GOOG"]`.
- **Start Date** (`start_date`, optional) — start of the historical range in `YYYY-MM-DD`. If omitted, the last month is returned.
- **End Date** (`end_date`, optional) — end of the historical range in `YYYY-MM-DD`. Defaults to today when a start date is given.

#### Example input

```json
{
  "tickers": ["AAPL", "GOOG"],
  "start_date": "2024-01-01",
  "end_date": "2024-01-31"
}
````

### Output

You can download the dataset extracted by Yahoo Finance Scraper in various formats such as **JSON, CSV, Excel, or HTML**, or fetch it via the API. Here's a simplified output example:

```json
{
  "ticker": "AAPL",
  "shortName": "Apple Inc.",
  "currentPrice": 293.08,
  "currency": "USD",
  "exchange": "NMS",
  "marketCap": 4304570155008,
  "sector": "Technology",
  "industry": "Consumer Electronics",
  "website": "https://www.apple.com",
  "news": [
    {
      "title": "Apple unveils new product line",
      "link": "https://finance.yahoo.com/news/..."
    }
  ],
  "history": [
    {
      "date": "2024-01-02T00:00:00-05:00",
      "open": 185.06,
      "high": 186.33,
      "low": 181.83,
      "close": 183.56,
      "volume": 82488700
    }
  ],
  "scrapedAt": "2026-06-25T12:00:00+00:00"
}
```

### Tips for better results

- **Validate your tickers** — use the exact Yahoo Finance symbol (e.g. `BRK-B`, not `BRK.B`). Unknown symbols return an error record so the rest of the run still succeeds.
- **Keep date ranges focused** — narrower ranges return faster and cost less, since you're charged per historical day.
- **Schedule it** — set up a daily schedule to build your own historical price database over time.
- **Use the API** — automate end-to-end pipelines by triggering runs and reading results programmatically.

### FAQ

#### Is it legal to scrape Yahoo Finance?

> Our Actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our Actors, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

Yahoo Finance data is intended for personal, non-commercial use. Review [Yahoo's terms of service](https://legal.yahoo.com/us/en/yahoo/terms/otos/index.html) before redistributing data.

#### Do I need a Yahoo Finance API key?

No. Yahoo Finance Scraper works without any API key or login. It's a drop-in **Yahoo Finance API alternative** for getting stock data as structured JSON.

#### Why is a field missing or empty?

`yfinance` relies on an unofficial Yahoo Finance endpoint, so available fields can vary by ticker and change over time. Missing values are returned as `null` rather than causing the run to fail.

#### Can I get data for non-US stocks, ETFs, or indices?

Yes. Any symbol that exists on Yahoo Finance works, including international exchanges (e.g. `SAP.DE`), ETFs (e.g. `SPY`), and indices (e.g. `^GSPC`).

### Support

Found a bug or have a feature request? Open an issue on the **Issues** tab of this Actor — feedback is always welcome, and the scraper is actively maintained.

# Actor input Schema

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

Array of ticker symbols to fetch data for (e.g. \["AAPL", "GOOG"]).

## `start_date` (type: `string`):

(Optional) Start date for historical data in YYYY-MM-DD format. If omitted, the last month of data is returned.

## `end_date` (type: `string`):

(Optional) End date for historical data in YYYY-MM-DD format. Defaults to today when a start date is given.

## Actor input object example

```json
{
  "tickers": [
    "AAPL",
    "GOOG"
  ]
}
```

# Actor output Schema

## `dataset` (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",
        "GOOG"
    ]
};

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

# Run the Actor and wait for it to finish
run = client.actor("code-node-tools/yahoo-finance-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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",
    "GOOG"
  ]
}' |
apify call code-node-tools/yahoo-finance-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=code-node-tools/yahoo-finance-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Yahoo Finance Scraper",
        "description": "Scrape Yahoo Finance stock data for any tickers - full company info, real-time prices, news & historical OHLCV data. A no-API-key Yahoo Finance API alternative that exports clean JSON, CSV & Excel.",
        "version": "0.0",
        "x-build-id": "nuPGEBWPKK46DI01b"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/code-node-tools~yahoo-finance-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-code-node-tools-yahoo-finance-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/code-node-tools~yahoo-finance-scraper/runs": {
            "post": {
                "operationId": "runs-sync-code-node-tools-yahoo-finance-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/code-node-tools~yahoo-finance-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-code-node-tools-yahoo-finance-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "tickers"
                ],
                "properties": {
                    "tickers": {
                        "title": "Tickers",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Array of ticker symbols to fetch data for (e.g. [\"AAPL\", \"GOOG\"]).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "start_date": {
                        "title": "Start Date",
                        "type": "string",
                        "description": "(Optional) Start date for historical data in YYYY-MM-DD format. If omitted, the last month of data is returned."
                    },
                    "end_date": {
                        "title": "End Date",
                        "type": "string",
                        "description": "(Optional) End date for historical data in YYYY-MM-DD format. Defaults to today when a start date is given."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
