massive.q

Market data from the Massive REST API (massive.com) as q tables: bars, daily aggregates, snapshots, trades, quotes, tickers, splits, dividends, IPOs and news. Export MASSIVE_API_KEY before starting q, or call .massive.setKey. Every call that takes options takes them last, as a dict (()!() or :: for none): `max and `maxpages bound the paging (10000 rows, 10 pages), any other key goes to the API as a query parameter, so `limit is the API's page size and `max the rows you want; a walk that stopped with pages outstanding says so on stderr and sets .massive.envelope`truncated. Timestamps: `t is the start of the bar in UTC (a daily bar stamps midnight Eastern, 04:00 or 05:00 UTC); the snapshot's updated and the ticks' sip/participant/trf stamps are UTC too; *_utc text becomes a timestamp and, in a table, an ISO date a date. Numbers come as the API writes them (a long for 12, a float for 5.3e+07); tickers are strings (`$ for symbols). Top-level columns only: a snapshot's nested day/prevDay dicts arrive as written. No rows (a weekend, an unknown ticker) is (); a refusal signals "STATUS: message" (bad key, bad date, rate limit) and the whole response, status included, is in .massive.envelope.

Examples

\l pq
.massive.setKey "your-api-key"
r:.massive.bars[`AAPL;2026.08.01;2026.09.04;()!()]
1-min r[`c]%maxs r`c                                          / the max drawdown over the range
.massive.bars[`AAPL;2026.09.04;2026.09.04;`mult`span!(5;`minute)]
n:.massive.news[`ticker`max!(`AAPL;20)]; .massive.envelope`truncated
`$(.massive.tickers[(enlist `search)!enlist "apple"])`ticker

Entity Summary

EntitiesShort Description
.massive.apikeyThe API key, read from MASSIVE_API_KEY at load.
.massive.bardefaultsThe bar options: `mult and `span set the bar size; `adjusted and `limit (the base aggregates one page is built from, max 50000) pass to the API.
.massive.bars[ticker;start;end;opts]Bars for a ticker between two dates, both inclusive.
.massive.daily[date;adjusted;opts]Every US stock's bar for one trading date (a weekend or holiday answers ()); `T is the ticker.
.massive.defaultsThe options every call starts from: the walk stops after `max rows or `maxpages pages, checked between pages, so the first page always arrives and a page that arrived is kept whole (the result may exceed `max).
.massive.divs[opts]Dividends.
.massive.envelopeThe last response's envelope: status, count, next_url and, after a paged call, truncated.
.massive.fetch[request]GET any API path and answer its payload: a table for a list of records, a dict for a single record (one page, no paging).
.massive.ipos[opts]IPOs, newest first.
.massive.news[opts]News articles.
.massive.ohlc[ticker;date;opts]One ticker's open, high, low, close, pre-market and after-hours prices for one trading date, as a dict (a non-trading date signals NOT_FOUND).
.massive.okThe response statuses accepted as success; any other is signalled as "STATUS: message" (the API's error or message).
.massive.payThe response keys whose value is the payload, in the order tried.
.massive.prevclose[ticker;opts]The previous day's open, high, low, close and volume for a ticker.
.massive.quotes[ticker;opts]Tick-level quotes for a ticker; the same stamps and plan requirement as .massive.trades.
.massive.setKey[apikey]Set the API key for this session.
.massive.snap[tickers;opts]The current snapshot (today's bar, the last minute, the previous day) for a list of tickers.
.massive.splits[opts]Stock splits.
.massive.status[]Whether the market is open now: the exchanges, their state and the server time, as a dict.
.massive.tcolsThe response columns holding epoch timestamps (ms or ns, told apart by magnitude): bars, snapshots and ticks.
.massive.tickers[opts]The reference list of tickers.
.massive.timesConvert the epoch (.massive.tcols) and ISO (*_utc) columns to q timestamps on the way in; 0b keeps them raw.
.massive.trades[ticker;opts]Tick-level trades for a ticker; the stamps are sip_timestamp, participant_timestamp and trf_timestamp.
.massive.urlThe API base URL.

Entity Details

.massive.bars[ticker;start;end;opts]

Bars for a ticker between two dates, both inclusive.

Parameters:
  • opts - `span (`minute`hour`day`week`month`quarter`year) and `mult set the bar size: `mult`span!(5;`minute) is 5-minute bars

Examples

.massive.bars[`AAPL;2026.08.01;2026.09.04;()!()]
.massive.bars[`AAPL;2026.09.04;2026.09.04;`mult`span!(5;`minute)]

.massive.daily[date;adjusted;opts]

Every US stock's bar for one trading date (a weekend or holiday answers ()); `T is the ticker.

Parameters:
  • adjusted - 1b for split-adjusted prices

Examples

.massive.daily[2026.09.04;1b;()!()]

.massive.divs[opts]

Dividends.

Parameters:
  • opts - API filters such as `ticker`ex_dividend_date

Examples

.massive.divs[(enlist `ticker)!enlist `AAPL]

.massive.fetch[request]

GET any API path and answer its payload: a table for a list of records, a dict for a single record (one page, no paging). The key is appended, so hand it a path under .massive.url or a next_url read from .massive.envelope.

Parameters:
  • request - a path string, or (path;params dict)

Examples

.massive.fetch "/v3/reference/tickers/AAPL"                                    / ticker details
.massive.fetch ("/v3/reference/tickers";(enlist `limit)!enlist 5)
.massive.fetch .massive.envelope`next_url                                    / the page after a truncated walk

.massive.ipos[opts]

IPOs, newest first.

Parameters:
  • opts - API filters such as `ticker`listing_date`ipo_status

Examples

.massive.ipos[`limit`max!(50;50)]

.massive.news[opts]

News articles.

Parameters:
  • opts - API filters such as `ticker`published_utc

Examples

.massive.news[`ticker`max!(`AAPL;20)]

.massive.ohlc[ticker;date;opts]

One ticker's open, high, low, close, pre-market and after-hours prices for one trading date, as a dict (a non-trading date signals NOT_FOUND).

Examples

.massive.ohlc[`AAPL;2026.09.04;()!()]

.massive.prevclose[ticker;opts]

The previous day's open, high, low, close and volume for a ticker.

Examples

.massive.prevclose[`AAPL;()!()]

.massive.quotes[ticker;opts]

Tick-level quotes for a ticker; the same stamps and plan requirement as .massive.trades.

Parameters:
  • opts - `timestamp (a date) selects the day, `limit the page size (max 50000)

Examples

.massive.quotes[`AAPL;`timestamp`limit!(2026.09.04;100)]

.massive.snap[tickers;opts]

The current snapshot (today's bar, the last minute, the previous day) for a list of tickers.

Examples

.massive.snap[`AAPL`MSFT;()!()]

.massive.splits[opts]

Stock splits.

Parameters:
  • opts - API filters such as `ticker`execution_date

Examples

.massive.splits[(enlist `ticker)!enlist `AAPL]

.massive.status[]

Whether the market is open now: the exchanges, their state and the server time, as a dict.

Examples

.massive.status[]

.massive.tickers[opts]

The reference list of tickers.

Parameters:
  • opts - API filters such as `market`exchange`search`active

Examples

.massive.tickers[`search`active!("apple";1b)]

.massive.trades[ticker;opts]

Tick-level trades for a ticker; the stamps are sip_timestamp, participant_timestamp and trf_timestamp. Needs a plan that includes tick data (NOT_AUTHORIZED otherwise).

Parameters:
  • opts - `timestamp (a date) selects the day, `limit the page size (max 50000)

Examples

.massive.trades[`AAPL;`timestamp`limit!(2026.09.04;100)]