# Stock, Crypto & Forex Prices (Yahoo Finance) (`ninja.dev/stock-crypto-price-data`) Actor

Get current quotes and historical OHLCV prices for stocks, ETFs, indices, crypto and forex from Yahoo Finance. Any ticker or exchange (AAPL, BTC-USD, EURUSD=X, ^GSPC, PETR4.SA): price, change, 52-week range, volume, adjusted close, dividends and splits. Also finds tickers by company name.

- **URL**: https://apify.com/ninja.dev/stock-crypto-price-data.md
- **Developed by:** [Matheus Coelho](https://apify.com/ninja.dev) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 symbol with histories

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

## Stock, Crypto & Forex Prices (Yahoo Finance)

Current quotes and historical prices for almost any market instrument, in one clean JSON row per symbol.

- **Stocks and ETFs** on every major exchange: `AAPL`, `BRK-B`, `SPY`, `PETR4.SA`, `VOD.L`, `7203.T`
- **Indices**: `^GSPC`, `^IXIC`, `^BVSP`, `^FTSE`
- **Crypto**: `BTC-USD`, `ETH-USD`, `SOL-USD`
- **Forex**: `EURUSD=X`, `USDBRL=X`
- **Find tickers by name**: `nvidia` → `NVDA`

### What you get per symbol

Current price, change %, day high/low, volume, 52-week high/low, currency, exchange and market time, plus, with history on:

- OHLCV bars at the interval you choose (1 minute to 3 months) with **adjusted close**,
- the **period return %** over the range,
- **dividends** and **splits** in the range.

### Input

| Field | What it does |
|---|---|
| `symbols` | Yahoo Finance tickers (see examples above). |
| `includeHistory` | Add bars, dividends and splits (default on). Off = quote only, cheaper. |
| `range` | `1d`, `5d`, `1mo` (default), `3mo`, `6mo`, `1y`, `2y`, `5y`, `10y`, `ytd`, `max`. |
| `interval` | `1m` ... `1d` (default) ... `1wk`, `1mo`, `3mo`. Intraday bars only cover recent days. |
| `searchQueries` | Names to look up, e.g. `petrobras`. |
| `maxSearchResults` | Matches per name (default 5). |

### Output

```json
{
  "recordType": "quote",
  "symbol": "PETR4.SA",
  "name": "Petróleo Brasileiro S.A. - Petrobras",
  "currency": "BRL",
  "exchange": "São Paulo",
  "price": 56,
  "changePercent": 0.937,
  "fiftyTwoWeekLow": 29.31,
  "fiftyTwoWeekHigh": 56.8,
  "range": "1y",
  "interval": "1mo",
  "periodReturnPercent": 93.264,
  "history": [
    { "date": "2025-11-01T03:00:00.000Z", "open": 31.2, "high": 33.1, "low": 30.8, "close": 32.5, "adjClose": 29.1, "volume": 812345600 }
  ],
  "dividends": [{ "date": "2026-08-22T13:00:00.000Z", "amount": 0.47 }],
  "splits": []
}
```

Ticker search rows (`recordType: "symbolSearch"`) give `symbol`, `name`, `type`, `exchange`, `sector` and `industry`. Unknown tickers come back as `error` rows with a `hint`.

### Notes

- Data comes from Yahoo Finance's public chart and search endpoints. Quotes can be delayed depending on the exchange.
- For company financial statements and SEC filings, see the companion Actor **SEC EDGAR Filings & Financials** (`ninja.dev/sec-edgar-filings-financials`).

### Related Actors

- [SEC EDGAR Filings & Financials](https://apify.com/ninja.dev/sec-edgar-filings-financials): SEC filings and normalized financials.
- [Telegram Channel Scraper](https://apify.com/ninja.dev/telegram-channel-scraper): public Telegram channel posts, with monitor mode.
- [US Government Contracts & Grants](https://apify.com/ninja.dev/us-gov-contracts-grants): federal contract winners and open grants.

# Actor input Schema

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

Yahoo Finance tickers: stocks (AAPL, BRK-B), ETFs (SPY), indices (^GSPC, ^BVSP), crypto (BTC-USD), forex (EURUSD=X), other exchanges (PETR4.SA, 7203.T, VOD.L).

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

Add OHLCV bars, adjusted close, dividends and splits. Off = current quote only.

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

How far back the history goes.

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

Bar size. Intraday intervals (1m to 90m) only cover recent days.

## `searchQueries` (type: `array`):

Company or asset names, e.g. nvidia, petrobras, solana. Returns matching symbols.

## `maxSearchResults` (type: `integer`):

Matches returned for each name.

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "BTC-USD"
  ],
  "includeHistory": true,
  "range": "1mo",
  "interval": "1d",
  "maxSearchResults": 5
}
```

# Actor output Schema

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

One row per symbol with the current quote and optional OHLCV history, dividends and splits; ticker search matches; error rows.

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

Number of symbols and the list of issues.

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

// Run the Actor and wait for it to finish
const run = await client.actor("ninja.dev/stock-crypto-price-data").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",
        "BTC-USD",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ninja.dev/stock-crypto-price-data").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",
    "BTC-USD"
  ]
}' |
apify call ninja.dev/stock-crypto-price-data --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ninja.dev/stock-crypto-price-data"
        }
    }
}
```

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/d5jY3CIiaLJEYzf82/builds/Vvfs3MbV0dhgjwubT/openapi.json
