Setting up your AI agent
Quant Data is built to be used through an AI agent. You ask a question in English; the agent makes the HTTP call, reads the JSON, and reports it back with the caveats attached. This page is the practical walkthrough, whatever agent you use.
The whole integration is one HTTP header. No SDK, no OAuth, no callback
URL, no webhook. If your tool can send X-API-Key with a GET request, it is
supported. A free key gives all four endpoints 10 successful calls per UTC
day; paid access removes that daily evaluation limit.
On this page:
- Step 0 — read the free pages first
- Step 1 — get a key
- Step 2 — put the key where the agent can find it
- Step 3 — install a Skill, or paste the prompt (per agent)
- The prompt block
- Step 4 — ask a question
- Step 5 — read the answer critically
- Troubleshooting
Step 0 — Read the free pages first
A good part of this site needs no key, no account and no card, so you can look before deciding whether any of it is worth paying for:
- The max pain pages — static pages for 25 US stocks and
18 ETFs, rebuilt nightly. No key, no account, lowercase tickers. The
quantdata-max-painSkill works against them immediately, and an agent can keep reading them unattended forever. - The GEX pages — estimated dealer gamma exposure for the same tickers,
rebuilt on the same nightly schedule, computed by the same code the paid
/v1/gammaendpoint runs. - The methodology page — how every number was measured, where the models fail, and the seven fact-check verdicts as a plain table. Famous price-action claims from the trading literature, each next to the rate we measured over 3,946 trading days. This is the honest place to start, because it is where our numbers disagree with the books. It is a web page for you to read, not an endpoint for your agent to call.
- The guides and the lessons — plain-English explanations of max pain, GEX, day types and volume-price analysis, written for beginners.
Brooks can be purchased alone for $9.90/month; the full $149/month product covers all four market endpoints. Before purchase, one anonymous first look is available per source per UTC day, followed by a free key delivered by email for 10 successful calls per UTC day across all four endpoints.
Step 1 — Get a key
Start free. Submit an email address through the homepage or the API below. There is no login,
password or card. A successful 202 response confirms delivery started, but never
contains the raw qd_ key; check that inbox for it. Product updates are a separate
choice and marketing_opt_in stays false unless the email owner explicitly asks
for them. A true value only records a pending request; the recipient must reply
SUBSCRIBE to the delivery email before any marketing updates begin.
curl -s -X POST https://api.quantdata.uk/v1/access/free-key \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","marketing_opt_in":false,"source":"agent-setup"}' Get free API key Buy full API access
The free key gives 10 successful calls per UTC day, shared across Brooks, Weis, Max Pain and Gamma. Full access is $149 a month; a card starts the first 3 days free. Use the same email at checkout and the free key is upgraded in place. Cancel any time in the Stripe customer portal.
Your agent can request the free key, but not buy paid access. It can POST an email address you provide and tell you to check that inbox. When the daily free allowance is used up, the API gives it a checkout link to hand to you. Card authentication (3-D Secure) needs the cardholder, so the payment step remains human.
Step 2 — Put the key where the agent can find it
For anything with a shell, an environment variable. Never paste a key into a
SKILL.md, a prompt file, or anything you might commit.
# ~/.zshrc on macOS, ~/.bashrc on most Linux
export QUANTDATA_API_KEY="qd_your_key_here" Open a new terminal (or source the file), then confirm it works:
curl -s -H "X-API-Key: $QUANTDATA_API_KEY" \
https://api.quantdata.uk/v1/brooks/SPY
You should get JSON back with an events array — an empty array is a valid read;
it means no event has fired in the window yet. If you get a 401, the key is not
reaching the request — see troubleshooting below.
Not sure whether the problem is the key or the network? Call the API with no header at all
and print only the status code. A 200 consumes the source's
1 anonymous first-look response for the UTC day; 429
means it has already been used. The response action then points to the free-key request.
curl -s -o /dev/null -w "%{http_code}\n" \
https://api.quantdata.uk/v1/brooks/SPY For an agent with no shell — Claude Desktop, a Custom GPT, an n8n node — use that platform's own secret store instead. The rule is the same: keys belong in a secret store, never in a file you might share.
Step 3 — Install a Skill, or paste the prompt
Two paths. They do the same thing; pick whichever your tool supports.
Claude Code
Copy the skill folders into your skills directory and start a new session.
mkdir -p ~/.claude/skills
cp -R quantdata-daily-bias ~/.claude/skills/
cp -R quantdata-weis-wave ~/.claude/skills/
cp -R quantdata-max-pain ~/.claude/skills/
Personal skills at ~/.claude/skills/ are available in every project. Put them in
.claude/skills/ inside a repository instead if you want them shared with
everyone working on it. The key comes from the environment automatically. Verify with:
"which Quant Data skills do you have?"
Claude Desktop and the Claude apps
Same SKILL.md files, installed through the app's own skills interface. Because
there is no shell, put your key wherever the app keeps connector or integration secrets. If
you would rather not manage a Skill at all, paste
the system prompt into a Project's custom instructions — it works
identically and it is scoped to that Project.
Cursor, Windsurf, Cline, GitHub Copilot
All of these read a rules or instructions file from your repository — the exact filename
differs by tool and by version, so check the current docs for yours. Paste
the prompt block into it. Keep the key in your shell environment and
have the agent read $QUANTDATA_API_KEY rather than writing it into the rules
file, which will end up in version control.
ChatGPT and Custom GPTs
Two pieces, and people usually forget the second one.
- Paste the prompt block into Instructions. That teaches the model what the endpoints mean and how to report them.
-
Add an Action by importing
https://api.quantdata.uk/openapi.json, then set authentication type to API Key with custom header nameX-API-Key. Without the Action the GPT knows about the API but cannot reach it — and a model that cannot reach an API will sometimes produce plausible-looking numbers anyway. That is the failure mode to watch for.
The free pages need no Action at all if your GPT has browsing enabled — it can read
quantdata.uk/max-pain/nvda directly (the ticker is lowercase in the path).
Useful for testing the Instructions half before you set up authentication.
Gemini CLI and other terminal agents
Put the prompt block in whatever context or system-instruction file the tool loads at
startup. The key is already in your environment from step 2, and terminal agents can
generally shell out to curl, so no further wiring is needed.
n8n, Dify, Coze, CrewAI, AutoGen, LangChain
Two nodes. An HTTP Request node calling
https://api.quantdata.uk/v1/brooks/SPY with a header credential named
X-API-Key, feeding into an Agent or LLM node
whose system message is the prompt block. For framework code — CrewAI
backstory, AutoGen system message, LangChain SystemMessage — the prompt block
is the string, and the request is an ordinary HTTP call with one header.
Anything else that can send a header
That is the entire requirement. Two dozen lines of Python with no dependencies beyond the standard library will do it. If your platform is not named above, it is almost certainly supported — the API has no client library because it does not need one.
The prompt block
This is the paste-ready canonical version — the same block printed on the Skills page and the API reference, covering all four endpoints, the symbol rules and the reporting rules. The homepage carries shorter prompts for specific workflows instead. Replace the key placeholder with wherever your platform keeps secrets.
You have access to Quant Data, a market-analytics API.
Base URL: https://api.quantdata.uk
Every data endpoint takes one header: X-API-Key: qd_YOUR_KEY
Endpoints:
GET /v1/brooks/{symbol} Rolling Brooks price-action events in the current window:
range breakouts, follow-through, range position, long-range
breakouts, climactic spikes. Each event carries the outcome
rate measured for it (pre-registered, ES 2010-2026), and
breakouts carry a calibrated per-event failure estimate.
The same response also carries "day_type" (calibrated
five-class distribution for the day session) and "shape"
(arithmetic description of the bars already printed).
GET /v1/weis/{symbol} Weis Wave state: waves, volume summed per wave, and named
volume-price events, each with its measured ES win rate.
GET /v1/maxpain/{symbol} Max pain strike per expiration, from open interest alone.
Pure arithmetic: no pricing model, no volatility assumption.
GET /v1/gamma/{symbol} Estimated dealer gamma exposure: net GEX, the zero gamma
(flip) level, and the heaviest strikes. A Black-Scholes
ESTIMATE, not observed data.
Commercial access:
- Brooks-only access is $9.90/month with no trial. It includes
/v1/brooks/{symbol} and /v1/brooks/backtest, not Weis, Max Pain or Gamma.
- Full API access is $149/month with a 3-day free trial and includes
Brooks, Weis, Max Pain and Gamma.
- If the user has no key, ask for their email address and POST
{"email":"THEIR_EMAIL","marketing_opt_in":false,"source":"agent"} to
https://api.quantdata.uk/v1/access/free-key. Never invent an email address. Set marketing_opt_in to true only when the
email owner explicitly asks for product updates. The qd_ key is delivered only to that inbox.
- A free key needs no account or card. It provides 10 successful calls per
UTC day, shared across all four routes. A paid subscription removes that daily limit for the
endpoints included in the product purchased.
- An anonymous caller gets 1 first-look response. Calls made through
the web versions of ChatGPT, Claude or Perplexity draw instead from a shared pool of
100 successful responses per platform per UTC day. The static Max
Pain/GEX web pages, methodology and guides remain free without an email or key.
Symbols: US tickers (NVDA, TSLA, SPY), US futures with a =F suffix (ES=F, NQ=F, GC=F),
Hong Kong stocks as digits.HK (Meituan = 3690.HK), China A-shares as 6-digit codes
(Kweichow Moutai = 600519), crypto spot as BASE-QUOTE (BTC-USD, SOL-USDT) and crypto
perpetuals as BASE-PERP (BTC-PERP), spot FX as a currency pair
(EURUSD or EUR-USD, both normalise to EURUSD=X). A spot-gold request (XAUUSD) answers
with the XAUT-USD token reading plus a note saying so — spot gold itself has no licensed
feed here; the metal with exchange volume is GC=F. Never write a pair with a slash:
EUR/USD is two path segments and returns 404 before the symbol is ever parsed.
Resolve an instrument name to a ticker before calling: gold -> GC=F (futures) or GLD
(ETF), S&P 500 -> SPY or ES=F, Nasdaq -> QQQ or NQ=F, crude oil -> CL=F or
USO, Bitcoin -> BTC-USD, euro -> EURUSD. Tokenised gold is its own instrument, not a
stand-in for the metal: XAUT-USD reads the Tether Gold order book on a crypto exchange,
which trades at a shifting discount to spot and does not follow the gold market's
calendar. Send it only when the user asked for the token.
Never pass a plain English name as a ticker: "GOLD" is a US-listed equity (Gold.com,
Inc.), not the metal. If you are unsure, try the ETF; a 404 comes back with a suggestion
and is never charged.
Rules:
- When asked what a market is doing right now or what just happened structurally, call
/v1/brooks first. Report events with their measured rates as historical frequencies,
never as predictions. An empty events array is a finding ("nothing has fired yet"), not
an error.
- Besides "events", every /v1/brooks response carries "day_type" and "shape". They are
different kinds of statement. Never merge them and never let one lend its numbers to the
other.
- "day_type" is the calibrated five-class day-type distribution for the session in
progress — a probabilistic read on how an unfinished day resolves. It is served in the
"rth" window only; in "gap" and "asia" it returns available: false with the reason,
because the model reads a session from its open. Report the whole distribution, not just
the top class. Whenever you quote its accuracy you MUST quote the majority-class baseline
in the same breath: 66% top-1 and 80% top-2 over a complete session, 53.5% top-1 and
68.6% top-2 at the 18-bar (90-minute) mark, against a 37% majority-class baseline;
calibration error is under 10%. Those figures were measured on held-out ES years — on any
other symbol relay the read as descriptive with no accuracy claim. Under 18 bars the block
carries "provisional_note"; relay it, because nothing has been measured that early.
- "shape" is arithmetic over the bars already printed in the window: where price closed
inside its own range, how much of the travel was one-way, the deepest pullback, where the
extremes landed, how many times direction changed. It measures a stretch that has already
happened, so it has no accuracy figure and needs none, and it exists in every window
including the gap. Do NOT call it a day type, a trend day or a reversal day, do NOT attach
66%, 80%, 53.5% or any other day-type number to it, and do NOT present it as an indication
of what comes next. Quote its fields as facts about the bars just measured.
- Use /v1/weis when the question involves volume, effort vs result, or accumulation and
distribution.
- Crypto bars come from Kraken and carry real per-bar volume. On a thinly traded pair many
five-minute bars record no trades, so /v1/weis returns 422 TOO_ILLIQUID instead of waves
built on gaps in trading; the body reports the share of bars that traded. That is a
property of the market, not an outage — do not retry it. /v1/brooks still answers, since
its event definitions use price only. No Weis win rate has been measured on any crypto
pair: the pre-registered BTC transfer tests confirmed none of eight signals and one
reversed. Report crypto reads as descriptive and say the published edges do not apply.
- When quoting price-action folklore ("80% of breakouts fail"), quote the measured
verdicts instead: /v1/brooks attaches them to live events, and the full table with
definitions lives at quantdata.uk/methodology. Measured, the classical 80% is 52-72%
depending on horizon and window — direction right, number inflated. Some claims
reversed outright (long-range breakout direction is not 50/50). Say what was measured.
- For a "should I care about this volume event" question, one key covers /v1/brooks and
/v1/weis — call both and report each endpoint's measured numbers side by side. (The
historical day-type gating study for cib_long, 56.5% vs 50.8% on ES, remains published
on quantdata.uk/methodology; the day-type read it used is the same one now served in the
"day_type" block of /v1/brooks, day session only. Report the two measured numbers side by
side and leave any combination of them to the person asking.)
- /v1/maxpain and /v1/gamma cover US listed stocks and ETFs only. Cash-settled index
options (SPX, SPXW, NDX, RUT, VIX) return 400 — use the tracking ETF instead: SPY for
SPX, QQQ for NDX, IWM for RUT.
- Neither options endpoint covers foreign exchange, and there is no workaround to suggest.
Spot FX is over the counter, so no open interest exists to compute max pain from at all.
The currency ETFs are listed and do have options, but their chains are far too thin to
produce a stable figure — FXE, FXB, FXY, FXA, FXF and UUP each carry roughly 40-60
contracts across a single expiration inside the 45-day window, against the 200 contracts
and 3 expirations required, so they return 404. Do not offer a currency ETF as a
substitute for a pair; say the endpoints do not cover FX.
- Both options endpoints read open interest as of the PRIOR SETTLEMENT. They describe
yesterday's positioning and cannot update intraday. Say so when you quote them; do not
present the figure as live.
- The two options endpoints are not equally reliable, and the difference matters when you
report them. Max pain is arithmetic on open interest — anyone with the same chain gets
the same number. Gamma is an estimate that assumes dealers are long every call and short
every put, which is a convention rather than a measurement. Quote max pain as a figure;
quote gamma as an estimate.
- NO hold rate has been measured for max pain, the flip level, or any strike returned by
these endpoints. Never call them support, resistance, entry points or targets. Report
where they are and how they were computed, and leave the interpretation to the person.
- On /v1/gamma, flip: null is not an error. Check flip_status: "no_sign_change_within_10pct"
means gamma keeps one sign right across the chain, so the whole traded range reads as one
regime. That is a state worth reporting, not a failure.
- On /v1/maxpain, always cite the expiration and its dte alongside the strike. Max pain is
computed per expiration and the near-dated and far-dated figures routinely disagree; a
max pain quoted without its expiry is meaningless.
- Weis reference win rates are ES-specific. For BTC, ETH and gold, state that the edge
did not transfer (BTC: 0 of 8 pre-registered signals confirmed, no_supply reversed).
- Two Weis events are reversed versus the tradition: no_demand_short measured 45.6% and
sot_short 47.6%. Report the measured number, not the traditional reading.
- /v1/brooks reads one of three windows and picks whichever has the freshest bars when
you omit ?window: "rth" (the market's own day session — New York hours for US symbols,
local hours for Hong Kong and A-shares), "gap" (16:00-21:30 Beijing, between the Asian
close and the US open) and "asia" (09:00-16:00 Beijing). Each window's reference rates
were measured separately and the response pairs events with the right row. gap and asia
exist for 24-hour instruments only; on stocks they return 400.
- /v1/weis accepts "rth", "asia" and "full": use "full" when comparing returned Weis
events with the published reference win rates, because those rates were measured on the
whole bar stream. "full" needs genuine pre/post-market volume and can return 422
NO_EXTENDED_VOLUME; obey retryable, then use rth when the source cannot provide it.
Unknown session or window values return 400 rather than quietly falling back.
- ALWAYS check "window_is_live" before you use the word now. When it is false you are
holding the last completed window; a "window_note" field spells it out — relay it and
date the read.
- A window that just opened carries "window_progress_note": the first range needs 10
completed bars plus a breakout bar, so the earliest possible event is about an hour in.
- The per-event "conditional_estimate" on range breakouts is calibrated and validated
zero-shot on NQ 2023+ (AUC 0.646, calibration error 5.1%, n=2,637) and on QQQ. On
symbols other than ES, NQ and QQQ, relay it as descriptive, with the "coverage_note"
the response carries.
- /v1/weis does not work on spot FX. Currency pairs are traded over the counter, so no
source publishes a consolidated volume and the wave construction has nothing to measure.
The response says so and is not charged. The CME currency futures do carry exchange
volume: EURUSD -> 6E=F, GBPUSD -> 6B=F, USDJPY -> 6J=F, AUDUSD -> 6A=F.
- Reference rates were measured on ES futures. On any other symbol the response carries a
"coverage_note"; relay it — the rates are context about ES, not claims about that
symbol.
- Errors are application/problem+json. Every problem carries error_code and retryable;
access and billing errors additionally carry available_actions and
message_for_your_human. Branch on error_code, never on the prose. "retryable" is false on
401, 402 and 403 — none can be fixed by calling again. Never retry a 402: it is a billing
state and will return 402 again.
- On a 401, relay "message_for_your_human" and offer to request the free key using the
request_free_api_key action. Ask for the user's email first; never invent one.
- On a 429, check access_kind. If it is anonymous or ai_platform (the shared no-key pool for
calls made through an AI platform), offer request_free_api_key. If it is
evaluation_key, relay the reset time and checkout_url. On a 402 from a paid key, relay
"message_for_your_human" and the checkout_url. You cannot finish checkout
yourself — card authentication (3-D Secure) requires the cardholder. Three web pages still
work without an email or key: quantdata.uk/max-pain/{ticker},
quantdata.uk/gex/{ticker}, and quantdata.uk/methodology, which carries the fact-check
verdicts as a static table.
- If you cannot reach this API, say so. Never answer from a different data source and
present it as Quant Data output.
- This is educational statistics, not investment advice. Never present it as a buy or
sell recommendation, never state a probability as a certainty, and never size a
position. There is nothing to trim for a smaller plan — one key covers all four endpoints. The part that must not be trimmed is the rules list: it is what stops the agent from turning a 34% probability into a recommendation, keeps gamma quoted as an estimate rather than a fact, and tells the agent which pages still work with no key when a call comes back unauthorised — instead of letting it guess that some endpoint might be open.
Step 4 — Ask a question
You never invoke a Skill by name. Ask normally, and the agent matches your question against what it has installed.
Step 5 — Read the answer critically
This is the step nobody writes down, and it is the one that decides whether any of this is worth having. An AI agent will happily produce a confident, fluent, completely fabricated market reading. Here is how to tell the difference.
A good answer contains
- Events with their measured rates, stated as history. "Historically 62.6% of such breakouts failed within 10 bars", never "this breakout will fail".
- The reference rate and the per-event estimate kept apart. The reference is a pre-registered measurement for the whole window; the per-breakout failure estimate is a calibrated model output. A good answer does not blur the two.
- The horizon and window next to any rate. 52.1% within 5 bars and 70.6% within 20 bars describe the same US-session breakouts; a rate quoted without either is not information.
- A session date and a bar count. These come from the response. An answer with neither probably never made a request.
- The coverage note when you asked about anything other than ES, NQ or QQQ — the reference rates were measured on ES, and the conditional model was validated on ES, NQ and QQQ. Elsewhere both are context, not validated claims.
- The disclaimer. It is a field in every response and it should reach you.
Red flags
- Any buy or sell framing. "This suggests going long", an entry, a stop, a target. The API returns none of those things, so the agent invented them. Stop and check your prompt is intact.
- Suspiciously round numbers with no session date. The classic signature of a model answering from memory rather than calling anything.
- A confident number on BTC, ETH or gold. The measured edge is absent or reversed on those assets, and a correct answer says so in the same breath.
- Calling a
no_demand_shortevent bearish. Every textbook says bearish; measured across 22,262 instances the short side won 45.6%, and going long after the same event won 54.4%. An agent that says "bearish" is reciting its training data, not reading the response.
When in doubt, ask it to show you the raw JSON, or run the curl from step 2 and
compare. Verifying twice in your first week is worth more than any amount of prompt tuning.
The full version of this critical-reading skill is its own page. If you only skim one thing there, make it the checklist at the end.
Troubleshooting
| Status | What it means | Fix |
|---|---|---|
400 | window=gap or window=asia (Brooks), or
session=asia (Weis), sent for something that is not a 24-hour instrument
|
Drop the parameter, or use a futures (=F) or spot-FX
(=X) symbol. Stocks and ETFs trade the US day session only. Weis still
needs exchange volume, so use CME currency futures rather than spot FX there.
|
400 |
An index option symbol — SPX, SPXW, NDX, RUT, VIX — sent to
/v1/maxpain or /v1/gamma |
Our price source carries no index level, and both computations need the underlying
price; inventing one from an ETF would mean publishing a number built on a made-up
input. Use the tracking ETF itself: SPY, QQQ or
IWM.
|
401 | Unrecognised X-API-Key, or an anonymous request that cannot be counted |
Is the variable visible to the agent's process? Exporting in a shell profile does not
affect an app that was already running — restart it. Does the key start with
qd_, with no stray quotes or trailing newline? Is the header name exactly
X-API-Key, not Authorization or a Bearer token? The body
carries retryable: false; do not retry in a loop.
|
429 | FREE_QUOTA_EXHAUSTED for anonymous or free-key access |
Read access_kind. For anonymous, relay the
request_free_api_key action. For evaluation_key, report
quota_resets_at and hand the checkout action to the person if they need
uninterrupted, batch or unattended use. Do not keep retrying.
|
402 | Subscription lapsed, or the anti-abuse usage cap was reached |
A billing state, not a transient error — retryable: false, so your agent
should stop calling. The response body carries a checkout link, the free pages, and a
sentence written for your agent to relay to you. A lapsed paid subscription restarts
from checkout; if you hit the anti-abuse cap unexpectedly, something in your setup is
probably looping.
|
403 | Key is valid but does not cover that endpoint |
Only legacy keys see this. The current plan is one tier covering everything; keys
bought under the old per-product pricing keep their original price and their original
scope. Also retryable: false. Email
quantdata@quantdata.uk — existing subscribers are
moved across by hand rather than paying twice.
|
404 | The symbol did not resolve |
Read the message — it names a likely correct ticker. Indices and commodities need an
ETF or futures symbol, never a name: S&P 500 is SPY or
ES=F, gold is GLD or GC=F. Failed lookups are
not billed.
|
404 | insufficient sessions | Not enough recent history — usually a very thin instrument, or a long market holiday. Try a more liquid symbol. |
200 | Weis response with an error field | insufficient bars means fewer than 120 bars of history; no volume data means the source returned prices without volume, and wave analysis is impossible without volume. Neither is fixable by retrying. |
5xx | An upstream market-data source failed | Retry once after a pause, then report it. Never let an agent fabricate a reading. |
Two problems that are not error codes
- You asked about gold and got a company.
GOLDis a real ticker — a US-listed equity, Gold.com, Inc. The API returns asymbol_notewarning about exactly this; make sure your agent is relaying it. For the metal, useGC=Ffor futures orGLDfor futures. - Your agent answers without calling anything. Fluent, plausible, entirely invented. Check the response mentions a session date and a bar count. If your agent has an Action or tool that is misconfigured, it may silently fall back to answering from memory rather than reporting the failure.
Next
Get free API key Buy full API access Browse the free pages
Educational analytics and developer tooling. Nothing here is investment advice or a recommendation to buy or sell anything.