# Stock Market Data API - Bars, Options, Crypto, Forex (Massive) (`nabeelbaghoor/stock-market-data-api`) Actor

Stock market data API for US stocks, options, indices, forex and crypto via Massive (formerly Polygon.io): OHLC bars, trades, quotes, snapshots, options chains with greeks, news, dividends, splits, financials, ratios and technical indicators. Bring your own key.

- **URL**: https://apify.com/nabeelbaghoor/stock-market-data-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Business, Developer tools, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 price or time series row returneds

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 Market Data API - Bars, Options, Crypto, Forex (Massive)

Pull US stock, options, index, forex and crypto market data from the Massive REST API (formerly Polygon.io) into a dataset, a spreadsheet or a warehouse: OHLC bars at any interval, tick-level trades and quotes, live snapshots, options chains with greeks, news with sentiment, dividends, splits, financial statements and technical indicators. Uses your own Massive API key, reads only, and charges only for rows that carry data.

### What it collects

- **Custom OHLC bars** for any ticker and interval, from 1-second to yearly bars, with open, high, low, close, volume, VWAP and trade count, split-adjusted or not. Stocks (AAPL), crypto (X:BTCUSD), forex (C:EURUSD), indices (I:SPX) and option contracts (O:AAPL251219C00150000).
- **Daily data**: previous day bar, the daily market summary for every stock, crypto or forex ticker on one day, and the daily open and close with pre-market and after-hours prices.
- **Tick data**: trades and NBBO quotes with nanosecond timestamps, exchange, conditions and sizes, plus the last trade and last quote.
- **Snapshots**: the unified snapshot across asset classes, the full market snapshot, the top 20 gainers or losers, the options chain with delta, gamma, theta, vega, implied volatility and open interest, and index values.
- **Reference data**: ticker search and lists across stocks, OTC, crypto, forex and indices, company overview (market cap, employees, SIC code, description, homepage), related tickers, options contracts, exchanges, market status and upcoming holidays.
- **News** with publisher, tickers, keywords and per-ticker sentiment with reasoning.
- **Corporate actions and fundamentals**: dividends, splits, IPOs, income statements, balance sheets, cash flow statements, financial ratios (P/E, P/B, EV/EBITDA, ROE, debt to equity, dividend yield), short interest and short volume.
- **Technical indicators and economy**: SMA, EMA, RSI and MACD on any ticker, US Treasury yields from 1 month to 30 years, and currency conversion.
- Lists are followed page by page (up to 50,000 bars, trades or quotes a page) until they end or your maximum is reached.

### How to use it

1. Get a Massive API key: sign up at massive.com (a free plan exists) and copy the key from the Keys page of the dashboard. A Polygon.io key works as is.
2. Paste it into the **API key** field (stored as a secret), or set the `DATA_API_KEY` environment secret.
3. Pick **What to read**, fill in the tickers and dates, and start. The default reads 30 days of daily bars for AAPL.

### Input

| Field | What it does |
| --- | --- |
| What to read | One of 33 modes, each one documented Massive REST route. Default: custom bars. |
| Tickers | Provider tickers: AAPL, BRK.B, X:BTCUSD, C:EURUSD, I:SPX, O:AAPL251219C00150000. Required by per-ticker modes, an optional filter elsewhere. |
| Date start, Date end | Inclusive range as `YYYY-MM-DD` or ISO 8601, used by bars, trades, quotes, news, corporate actions, statements, short data, indicators and yields. |
| Date | One day for the daily summary and daily open and close (default: the last weekday), or the as-of date for reference lookups. |
| Bar size, Timespan | Bars: 5 and minute gives 5-minute bars. |
| Adjust for splits | Bars, daily data and indicators. |
| Sort order | Ascending or descending on the mode's date. |
| Market, Include OTC, Movers direction | Daily summary, full snapshot, movers and ticker search. |
| Asset class | Unified snapshot of a whole asset class, or exchanges by asset class. |
| Search, Ticker type, Ticker status | Ticker search. |
| Contract type, Expiration from and to, Minimum and maximum strike, Expired contracts | Options chain and options contracts. |
| Dividend type, Split type, IPO status | Corporate action filters. |
| Reporting period, Fiscal year | Financial statements. |
| Indicator, Window, Price series, MACD windows | Technical indicators. |
| Convert from, Convert to, Amount, Decimal places | Currency conversion. |
| Maximum results | Row cap for the run, and the most you are charged for. |
| Requests per minute | Pacing. 5 suits the free plan; raise it on a paid key. |
| API key | Your Massive API key, as a secret input, or the `DATA_API_KEY` secret. |

### Access and limits on the Massive side

- Massive plans differ by asset class (stocks, options, indices, currencies), history depth (2 years on free plans, all history on higher plans) and recency (end of day, 15-minute delayed or real time). A mode outside your plan ends the run cleanly with the provider's "not entitled" message; the key is fine, the plan does not cover that data.
- The free plan allows 5 API calls a minute. The actor paces itself to the requests per minute you set and waits out any rate limit.
- The key is sent only in the `Authorization: Bearer` header, never in a URL, and is stripped from any log or error text.
- Massive's terms govern what you do with the data: market data is licensed for your own use under your plan, and exchange rules restrict redistributing real-time data. This actor only moves data you are already entitled to into your own Apify storage.

### FAQ

#### What is the Massive API?

Massive is the new name of Polygon.io, a US market data provider. Its REST API at api.massive.com serves stocks, options, indices, forex and crypto: aggregates (bars), trades, quotes, snapshots, reference data, news, corporate actions and fundamentals. Polygon.io keys, routes and the api.polygon.io host still work.

#### Which data source does this actor read?

The Massive REST API at api.massive.com, documented at massive.com/docs with a public OpenAPI document. Every mode is one documented GET route: for example `/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to}` for bars, `/v3/snapshot/options/{underlying}` for the options chain and `/stocks/financials/v1/income-statements` for income statements. The docs and the live host were checked on 2026-10-05.

#### Do I need a Massive account?

Yes. This actor is bring-your-own-key and never ships one. The free Massive plan covers end-of-day stock bars, reference data, news and fundamentals at 5 calls a minute; options, indices, tick data and real-time snapshots need the matching paid plan. A missing, refused or under-entitled key ends the run cleanly with a message saying which it was.

#### How do I download historical minute bars for a stock?

Choose Custom bars, set Tickers to the symbol, Bar size 1 and Timespan minute, and set the date start and end. Up to 50,000 bars come back per request and the actor follows the provider's next page link until the range is covered or your maximum results is reached.

#### Can I get an options chain with greeks and implied volatility?

Yes. Choose the options chain snapshot, set Tickers to the underlying stock (for example AAPL) and narrow it with contract type, expiration range and strike range. Each row is one contract with delta, gamma, theta, vega, implied volatility, open interest, the day bar, the last quote and trade, and the underlying price. This needs an options plan.

#### How do I get crypto or forex prices?

Use the provider's prefixes: X:BTCUSD for Bitcoin in US dollars, C:EURUSD for the euro. They work in custom bars, previous day bar, indicators and the unified snapshot; the daily summary, full snapshot and movers take the market field (crypto or forex). Currency conversion converts any amount between two currencies at the latest rate.

#### How is it priced?

Pay per result: the lowest price per bar, trade, quote, indicator value or yield row, a middle price per reference row, a higher price per snapshot or news article, and the highest per financial statement or ratios record. Lookups that find nothing are free. Your Massive subscription applies separately.

### Pricing

| Event | Price |
| --- | --- |
| Bar, daily summary, trade, quote, indicator or yield row | $0.005 |
| Ticker, company, contract, dividend, split, IPO, short data, exchange, status or holiday row | $0.006 |
| Snapshot, mover, option contract snapshot, last trade or quote, currency conversion | $0.01 |
| News article with sentiment | $0.01 |
| Income statement, balance sheet, cash flow statement or ratios row | $0.015 |

### Example output

```json
{
  "mode": "aggregates",
  "modeLabel": "Custom bars (OHLC)",
  "recordType": "bar",
  "ticker": "AAPL",
  "found": true,
  "date": "2020-01-02T05:00:00.000Z",
  "name": null,
  "open": 74.06,
  "high": 75.15,
  "low": 73.7975,
  "close": 75.0875,
  "volume": 135647456,
  "vwap": 74.6099,
  "price": 75.0875,
  "change": null,
  "changePercent": null,
  "value": null,
  "url": null,
  "retrievedAt": "2026-10-05T09:14:52.118Z",
  "note": null,
  "c": 75.0875,
  "h": 75.15,
  "l": 73.7975,
  "n": 1,
  "o": 74.06,
  "t": 1577941200000,
  "v": 135647456,
  "vw": 74.6099,
  "transactions": 1
}
```

The sample bar is the provider's own documented example. Every mode keeps all of the provider's fields under their own names next to the common columns: option rows add `delta`, `gamma`, `theta`, `vega`, `impliedVolatility` and `openInterest`; quote rows add `bidPrice` and `askPrice`; news rows add `title` and `sentiment`.

### Keyword map

stock market data API, stock price API, historical stock prices, OHLC bars, intraday minute bars, tick data, trades and quotes, NBBO, options chain API, options greeks, implied volatility, crypto price API, forex rates API, index values, market movers, stock fundamentals, income statement API, dividends API, stock splits, IPO calendar, short interest, technical indicators RSI MACD, Treasury yields, Massive API, Polygon.io API, Polygon alternative.

# Actor input Schema

## `mode` (type: `string`):

Each choice is one documented Massive REST route. Custom bars (the default) returns OHLC, volume and VWAP bars for the tickers and dates below. The modes marked per ticker make one request per ticker; the others read the whole market or a filtered list.

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

Tickers as the provider writes them: AAPL or BRK.B for stocks, X:BTCUSD for crypto, C:EURUSD for forex, I:SPX for indices, O:AAPL251219C00150000 for an option contract. Required by the per-ticker modes (bars, trades, quotes, snapshots of one ticker, details, indicators; the options chain takes the underlying stock). Optional filter elsewhere.

## `dateFrom` (type: `string`):

Start of the range, inclusive, as YYYY-MM-DD or an ISO 8601 date-time. Bars (defaults to 30 days before the end), trades, quotes, news, dividends (ex-date), splits, IPOs (listing date), financial statements (period end), short interest and volume, indicators and Treasury yields.

## `dateTo` (type: `string`):

End of the range, inclusive, as YYYY-MM-DD or an ISO 8601 date-time. Bars default to today.

## `date` (type: `string`):

One day as YYYY-MM-DD. Daily market summary and daily open and close (default: the most recent weekday before today); the as-of date for ticker search, ticker overview and options contracts.

## `multiplier` (type: `integer`):

Custom bars. How many timespans make one bar: 5 with minute gives 5-minute bars.

## `timespan` (type: `string`):

Custom bars and indicators. The unit of one bar (second is for bars only).

## `adjusted` (type: `boolean`):

Bars, daily summaries and indicators. Leave on for split-adjusted prices.

## `sortOrder` (type: `string`):

Oldest first or newest first, on the date the mode lists by. Left empty, bars, ticker lists, snapshots, options and ratios list in ascending order and every dated list (trades, quotes, news, dividends, splits, IPOs, statements, short data, indicators, yields) lists newest first.

## `market` (type: `string`):

Daily market summary, full market snapshot and top movers: stocks, crypto or forex. Ticker search also takes OTC and indices.

## `includeOtc` (type: `boolean`):

Stocks only: include OTC securities in the daily summary, full market snapshot and movers.

## `direction` (type: `string`):

Top movers: the top 20 gainers or losers of the day.

## `assetClass` (type: `string`):

Unified snapshot: snapshot a whole asset class when no tickers are set. Exchanges: list the exchanges of one asset class (indices is not offered there).

## `search` (type: `string`):

Ticker search: terms matched against ticker and company name, such as apple.

## `tickerType` (type: `string`):

Ticker search: keep one security type.

## `tickerStatus` (type: `string`):

Ticker search: actively traded tickers, or delisted ones.

## `contractType` (type: `string`):

Options chain and options contracts: calls or puts. Leave empty for both.

## `expirationFrom` (type: `string`):

Options: earliest expiration date, YYYY-MM-DD.

## `expirationTo` (type: `string`):

Options: latest expiration date, YYYY-MM-DD.

## `strikeMin` (type: `number`):

Options: lowest strike price.

## `strikeMax` (type: `number`):

Options: highest strike price.

## `expired` (type: `boolean`):

Options contracts: list expired contracts instead of live ones.

## `distributionType` (type: `string`):

Dividends: keep one distribution type.

## `adjustmentType` (type: `string`):

Splits: keep one adjustment type.

## `ipoStatus` (type: `string`):

IPOs: keep one status.

## `timeframe` (type: `string`):

Financial statements: quarterly, annual or trailing twelve months (balance sheets have no trailing twelve months).

## `fiscalYear` (type: `integer`):

Financial statements: one fiscal year, such as 2025.

## `indicator` (type: `string`):

Technical indicator mode.

## `window` (type: `integer`):

SMA, EMA and RSI: the window size in timespans (provider default 50 for SMA and EMA, 14 for RSI).

## `seriesType` (type: `string`):

Indicators: which price the indicator is computed on.

## `shortWindow` (type: `integer`):

MACD only (provider default 12).

## `longWindow` (type: `integer`):

MACD only (provider default 26).

## `signalWindow` (type: `integer`):

MACD only (provider default 9).

## `currencyFrom` (type: `string`):

Currency conversion: the currency to convert from, such as USD or BTC.

## `currencyTo` (type: `string`):

Currency conversion: the currency to convert to, such as EUR.

## `amount` (type: `number`):

Currency conversion: the amount to convert.

## `precision` (type: `integer`):

Currency conversion: decimal places in the result, 0 to 4.

## `maxResults` (type: `integer`):

The most rows this run returns and charges for. Lists are followed page by page (up to 50,000 rows a page for bars, trades and quotes) until they end or this cap is hit.

## `requestsPerMinute` (type: `integer`):

Pacing. The free Massive plan allows 5 calls a minute; paid plans have no fixed cap, so raise this to 100 or more on a paid key.

## `apiKey` (type: `string`):

Your own Massive API key, from the Keys page of the Massive dashboard (a free plan exists; Polygon.io keys carry over). Stored as a secret and sent only in the Authorization header. You can instead set the DATA_API_KEY environment secret.

## Actor input object example

```json
{
  "mode": "aggregates",
  "tickers": [
    "AAPL"
  ],
  "multiplier": 1,
  "timespan": "day",
  "adjusted": true,
  "market": "stocks",
  "includeOtc": false,
  "direction": "gainers",
  "tickerStatus": "active",
  "expired": false,
  "indicator": "sma",
  "seriesType": "close",
  "amount": 1,
  "precision": 2,
  "maxResults": 500,
  "requestsPerMinute": 5
}
```

# Actor output Schema

## `records` (type: `string`):

One row per bar, trade, quote, snapshot, reference, news or fundamentals record.

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

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/stock-market-data-api").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"] }

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/stock-market-data-api").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"
  ]
}' |
apify call nabeelbaghoor/stock-market-data-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/stock-market-data-api"
        }
    }
}
```

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/6nsiiTxObK3vd3Jbg/builds/7GvikXQD0ze3pHEVK/openapi.json
