API
Getting started
Get a key, set the base URL and the auth header, and make your first call in cURL, Python or TypeScript.
The ITMatrixHQ API is one REST surface under /v2. Every response is JSON by default, wrapped in the same {data, meta} envelope, and every error uses one closed set of codes.
1. Get a key
API keys come with API access on your account: the web Pro plan includes the API Explorer tier, and the API plan includes API Pro. Create a key in account settings on the terminal, under API Suite. The secret starts with itm_ and is shown once — copy it then. It can be revoked at any time; it can never be shown again.
Before a key can read market data, the account has to declare its market-data classification (non-professional or professional) once. Until then every call returns 403 attestation_required.
2. Base URL and auth
| Base URL | https://api.itmatrixhq.com |
| Auth header | Authorization: Bearer itm_… |
| Format | JSON (application/json); protobuf on request, see Protobuf |
Keep keys on a server or in your own environment. Put the key in an environment variable rather than in code:
export ITM_API_KEY=itm_your_key_here3. Make a call
The dealer gamma-exposure grid for SPY, top 20 strikes by size. Every example on the API pages is plain HTTP; where an SDK method maps, the Python and TypeScript tabs also offer the SDK version.
curl -sS -G "https://api.itmatrixhq.com/v2/gex/SPY/grid" \
-H "Authorization: Bearer $ITM_API_KEY" \
-d "top=20"import os
import httpx
response = httpx.get(
"https://api.itmatrixhq.com/v2/gex/SPY/grid",
params={"top": 20},
headers={"Authorization": f"Bearer {os.environ['ITM_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
grid = response.json()["data"]
print(grid["spot"], grid["net_gex"])
for row in grid["strikes"]:
print(row["strike"], row["gex"])import os
import itmatrix as itm
with itm.ITMClient(api_key=os.environ["ITM_API_KEY"]) as client:
grid = client.get_gex("SPY", top=20)
print(grid.data.spot, grid.data.net_gex)
for row in grid.data.strikes:
print(row.strike, row.gex)const url = new URL("https://api.itmatrixhq.com/v2/gex/SPY/grid");
url.search = new URLSearchParams({ top: "20" }).toString();
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.ITM_API_KEY}` },
});
const { data, meta } = await response.json();
console.log(data.net_gex, data.strikes[0]?.gex, meta.caps);import { ITMClient } from "@itmatrixhq/core";
const client = new ITMClient({ apiKey: process.env.ITM_API_KEY });
const { data, meta } = await client.getGex("SPY", { top: 20 });
console.log(data.net_gex, data.strikes[0]?.gex, meta.caps);A successful answer looks like this (trimmed):
{
"data": {
"spot": 764.18,
"captured_at": 1790256713559,
"net_gex": -878059914.5,
"flip_point": null,
"strikes": [{ "strike": 785000, "gex": 176396331.9, "call_oi": 253572, "put_oi": 15019 }]
},
"meta": { "date": "2026-09-24", "caps": { "tier": "pro", "applied": [] } }
}Note the units: strike is integer thousandths of a dollar (785000 is $785), gex is dollars of dealer hedging per $1 move, and captured_at is epoch milliseconds. Units has the full list, including how to turn dollar GEX into shares.
4. Try it in the browser
The API console runs any public operation with a key saved in this browser, and every reference page has the same console next to its examples. Pick the key from the Key chip in the header.
Where to go next
- GEX — Dealer gamma exposure by strike, session history and reference books.
- Options chain — Chains, quotes and spot prices.
- Reference — The symbol registry, lookups and listed expiries.
- Bars — OHLCV history for stocks and option contracts.
- Implied volatility — Term structure, surface and per-contract greeks.
- Options flow — Grouped large trades, end-of-day prints and strike cross-sections.
- Off-exchange — Synthetic off-exchange activity, concentration, profile and composition.
- Screeners — Movers and sector moves across the registry universe.
- Fundamentals — Company ratios, statements, float, short interest and dividends.
- Economy — Treasury yields and overnight reference rates.
- Streaming — WebSocket tickets, the socket itself and the protobuf schemas.
- Watchlists — Your saved symbol lists.
- Journal — Trade-journal accounts, trades and bulk import.
- Account — Market-data classification and your API usage.
- Envelope and metadata — what is in
meta, and the headers that carry it. - Errors — the closed error-code set and what to do about each.
- Entitlements — what a key can read, and why a call can return 403.
- SDKs — the Python and TypeScript clients, if you would rather not write HTTP calls yourself.
Features inside the ITMatrixHQ apps use first-party sessions, not API keys; they are not part of this API.