quant.trading API
Everything you need to call quant.trading from your own code: a script, a server, a no-code tool or an AI app. This guide starts with the canvas and grows a section at a time.
What's in the API
The API is plain HTTPS and JSON. You send a request with a key in its Authorization header, and you get JSON back. AI apps that speak the Model Context Protocol (Claude, ChatGPT, Cursor and others) can use the same features as tools, through the MCP server at https://quant.trading/mcp.
Keys and signing in
Every call is made as a member of quant.trading: a key acts as the person who made it, sees only what they can see, and makes things in their Library. There are two kinds of key, and both start with ihmcp_.
| Key | Where you make it | What it can do |
|---|---|---|
| API key | Admin page, Create canvas API (admins only for now) | The canvas API below (make and expand canvases), and the same as a connection token over MCP, plus the create_canvas and expand_canvas tools. |
| Connection token | Settings, AI & connections (any member) | Connects an AI app over MCP: read your canvases, scripts, market data and research. It can't make canvases. |
Send the key as a bearer token with every request:
Authorization: Bearer ihmcp_your_key_here
A key is shown once, when you make it; the server keeps only a fingerprint of it, so it can't show it again. Anyone with it can act as you, so keep it in your app's secrets on a server, never in a web page or a public repository. If one gets out, revoke it on the page where you made it (Settings, AI & connections lists and revokes API keys too) and make a new one. A revoked key stops working at once.
A signed-in admin can also call the canvas API from the browser with their login session, without a key. Everyone else needs a key.
Requests and answers
- Address. Every path in this guide is on
https://quant.trading. - Bodies. Send JSON with
Content-Type: application/json. A body can be up to 1 MB. - Answers. Always JSON. A call that worked answers
200,201(something was made) or202(something started that runs on in the background). - From a server, not a page. Call the API from your own server or script. A request sent from a web page on another site is refused (the server only takes cross-site requests from its own pages), and it would show your key to anyone who opened the page.
- Times are ISO 8601 in UTC, like
2026-10-29T18:00:00.000Z.
Errors
A call that didn't work answers with a 4xx or 5xx status and a JSON body whose error says what went wrong in plain words, so you can show it or log it as it is:
{ "error": "nodes must be a list." }| Status | Means |
|---|---|
400 | Something in the request isn't right. error says what. |
401 | No key, or a key that's wrong or revoked. |
403 | The key works, but its member may not do this. |
404 | There's no such thing of yours (another member's canvas is a 404 too, never a 403). |
409 | It clashes with what you have, like a full Library. |
429 | Too many requests. Wait and try again (see Rate limits). |
500 | Something failed on our side. It's safe to try again a little later. |
Rate limits
Calls are counted by the address they come from (or the login session, from a browser), and each area has its own allowance on top of the site-wide one. Answers carry the standard RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset headers (seconds until the window starts again), so your code can slow down before it's refused. Over the limit, you get a 429: wait until the reset and send it again.
| What | Allowance |
|---|---|
| Canvas calls that make or expand | 300 in 15 minutes |
MCP server (/mcp) | 60 a minute, per member |
| All API calls together | 500 in 15 minutes |
Section 1
Canvas
A canvas is a research map: people, companies and notes (its nodes), and the lines between them that say how they're connected (its connections, or edges). It's what opens on Home, and every canvas you have is in your Library.
With the canvas API, another app of yours makes a whole canvas in one call, from data you already have: a cap table, a list of board members, a CRM export, what a script scraped. Then you can have the AI expand it, researching the real people connected to each node and adding them, and find a picture for everyone on it. The canvas appears in your Library, ready to open, share and keep working on.
| Call | Does |
|---|---|
POST /api/canvases/create | Makes a new canvas, and can start an expand and pictures on it. |
POST /api/canvases/:id/expand | Expands a canvas you have with AI, or finds its pictures. |
GET /api/canvases/:id/expand | Says how far an expand is. |
Who can use it
Making and expanding canvases through the API is open to quant.trading's admins for now, with an API key made on the Admin page (Create canvas API), or a signed-in admin's own session. Any other key or account gets a 403. Any member can already read their canvases from an AI app over MCP.
- Open the Admin page and find Create canvas API.
- Under API keys, name the key after what will use it (e.g. "CRM sync") and choose Make a key.
- Copy the key straight away: it isn't shown again. Put it in your app's secrets, for example as
QT_API_KEY.
The examples below read the key from QT_API_KEY.
Quick start
This makes a canvas of three nodes, a company and two of its people, with a connection from each person to the company:
curl -X POST https://quant.trading/api/canvases/create \
-H "Authorization: Bearer $QT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme leadership",
"nodes": [
{ "id": "acme", "name": "Acme Corp", "notes": "Industrial robots", "isCompany": true, "website": "acme.com" },
{ "id": "jane", "name": "Jane Doe", "notes": "CEO" },
{ "id": "sam", "name": "Sam Lee", "notes": "CFO" }
],
"edges": [
{ "from": "jane", "to": "acme", "label": "CEO" },
{ "from": "sam", "to": "acme", "label": "CFO" }
]
}'
// Node 18+ (fetch is built in). Run with QT_API_KEY set.
const res = await fetch("https://quant.trading/api/canvases/create", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.QT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Acme leadership",
nodes: [
{ id: "acme", name: "Acme Corp", notes: "Industrial robots", isCompany: true, website: "acme.com" },
{ id: "jane", name: "Jane Doe", notes: "CEO" },
{ id: "sam", name: "Sam Lee", notes: "CFO" },
],
edges: [
{ from: "jane", to: "acme", label: "CEO" },
{ from: "sam", to: "acme", label: "CFO" },
],
}),
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status}: ${data.error}`);
console.log("Made canvas", data.canvas.id, "https://quant.trading" + data.url);
# pip install requests. Run with QT_API_KEY set.
import os, requests
res = requests.post(
"https://quant.trading/api/canvases/create",
headers={"Authorization": f"Bearer {os.environ['QT_API_KEY']}"},
json={
"name": "Acme leadership",
"nodes": [
{"id": "acme", "name": "Acme Corp", "notes": "Industrial robots", "isCompany": True, "website": "acme.com"},
{"id": "jane", "name": "Jane Doe", "notes": "CEO"},
{"id": "sam", "name": "Sam Lee", "notes": "CFO"},
],
"edges": [
{"from": "jane", "to": "acme", "label": "CEO"},
{"from": "sam", "to": "acme", "label": "CFO"},
],
},
timeout=60,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{res.status_code}: {data['error']}")
print("Made canvas", data["canvas"]["id"], "https://quant.trading" + data["url"])
It answers 201 Created with the new canvas's id and the link that opens it. Open the link while signed in as the key's member and the canvas is there, with Jane and Sam around Acme.
Make a canvas
Makes a new canvas in your Library. It always makes a new one and never changes or saves over a canvas you have, so calling it twice makes two canvases. Every field of the body is optional: an empty body {} makes an empty canvas called "Untitled canvas".
The body
| Field | What it is |
|---|---|
namestring | The canvas's name, up to 200 characters. Default "Untitled canvas". If you already have a canvas with this name (any case), the new one gets the next free number: "Acme leadership (2)", "(3)" and so on. The answer has the name it got. |
nodesarray | The people, companies and notes. See Nodes. Up to 5,000. |
edgesarray | The connections between them. See Connections. Up to 20,000. |
expandstring, array or object | Have the AI expand some of the nodes once the canvas is made: "all", a list of node ids, or an object with more options. See Expand with AI. |
picturesboolean | true finds a picture for every person and company on the canvas, after any expand. See Pictures. |
viewportobject | The view the canvas opens at, in the shape the app saves it: { "position": { "x": 0, "y": 0 }, "scale": 0.5 } (the point in the middle of the screen, and the zoom). Most callers leave it out and let the app choose. |
thumbnailstring | A picture for the canvas's card in the Library: a data:image/png, jpeg or webp ;base64, URL, up to about 800 KB. Anything else is ignored, and the card gets its picture when the canvas is next saved in the app. |
Nodes
Each node is an object. The short shape is all most callers need:
{ "id": "jane", "name": "Jane Doe", "notes": "CEO of Acme since 2019" }| Field | What it is |
|---|---|
idstring | Your own id for the node, up to 80 characters, so connections and expands can name it. Use something stable from your data (a CRM id, a slug). Leave it out and one is made from the name, like JANE_DOE_1. If two nodes give the same id, the second gets a suffix and connections go to the first. |
namestring | The person's or company's name, up to 160 characters. title or label work too. Use full names: the AI expand and the picture search look people up by it. |
notesstring | A line or two under the name (a role, what a company does), up to 2,000 characters. description works too. |
textstring | What the node shows, if you want to set it yourself. Without it, the node shows its name and then its notes, each on its own line. |
isCompanyboolean | true for a company or other organization. The expand then looks for its founders, executives, board and other people tied to it, and the picture search looks for its logo. |
websitestring | A company's own domain, like acme.com, so the picture search finds its logo and not another company's of the same name. |
imagestring | A picture for the node, as an https:// URL. A node that has one keeps it: Pictures only fills in nodes without. |
sourceUrlstring | Where the information came from (a Wikipedia page, a filing). It shows as the node's source. |
x, ynumber | Where the node goes. See Where nodes go. |
width, heightnumber | The node's size. Default 560 by 230, the size the app gives every node. |
isKingboolean | true draws the node three times as big, as the canvas's King node: use it for the one the canvas is about. |
A node can also carry any other field the app saves on a node (what you get if you save a canvas in the app and look at it), and it's kept as it is, so a canvas exported from the app can be sent back in whole. A link that isn't a safe http(s) address is taken off.
Connections
Each connection joins two nodes by their ids, with an optional label that says how they're connected:
{ "from": "jane", "to": "acme", "label": "CEO" }| Field | What it is |
|---|---|
fromstring | One node's id. fromNode or source work too. |
tostring | The other node's id. toNode or target work too. |
labelstring | What's written on the line, up to 300 characters, like "CEO", "invested in" or "married to". relationship works too. |
idstring | Your own id for the connection. Default e0, e1… in the order you send them. |
A connection that names a node that isn't in nodes, or joins a node to itself, is left out without an error. The answer's canvas.edges is how many were kept, so compare it with how many you sent if you want to be sure.
Where nodes go
- No positions. If no node has
xandy, the first node goes in the middle and the rest go in a ring around it. Put the person or company the canvas is about first. - Your own positions. If any node has
xandy, nodes are put where you say (and one without them at0, 0). The canvas's units are about the size of a node: a node is 560 wide, so leave 600 or more between them. A node at exactly0, 0is drawn as the canvas's main person, twice as big. - Dynamic positioning. A canvas made by the API opens with Dynamic Positioning on, so the nodes spread out by their connections and anything the expand adds settles in next to the node it belongs to. You can turn it off in the canvas's settings to keep everything where it is.
The answer
{
"success": true,
"canvas": {
"id": 123,
"name": "Acme leadership",
"created_at": "2026-10-29T18:00:00.000Z",
"updated_at": "2026-10-29T18:00:00.000Z",
"nodes": 3,
"edges": 2
},
"url": "/home?canvas=123"
}| Field | What it is |
|---|---|
canvas.id | The canvas's id. Keep it to expand the canvas later. |
canvas.name | The name it got, which has a number after it if you already had one with that name. |
canvas.nodes, canvas.edges | How many nodes and connections it has (connections to missing nodes left out). |
url | The link that opens it, on this site: https://quant.trading/home?canvas=123. Only the key's member can open it, until they share it. |
expand | Only if you asked for an expand or pictures: how it's going, the same as Expand status, plus statusUrl to ask again. If the canvas was made but the expand couldn't start, this is { "status": "not started", "error": "…" } and the canvas is still there. |
Expand with AI
Expand does what Expand does on a canvas in the app: for each node you name, the AI researches the real people connected to them on the web and adds them around it, each linked to it with a label that says how. Nothing already on the canvas is changed; it only adds.
It takes about 20 to 60 seconds a node, so the call answers straight away and the expand runs on the server, one node after another. Each node's people are saved to the canvas as soon as they're found: reopen the canvas to see them come in, or ask how far it is.
There are two ways to start one:
- When you make the canvas: add
"expand"to the body ofPOST /api/canvases/create. - On a canvas you have (made by the API or in the app):
It answers 202 Accepted with the status, statusUrl and url.
What to expand
The expand field (or, for /expand, the body itself) takes any of these:
| Form | Expands |
|---|---|
"all" | Every person and company on the canvas (not notes, pictures or the small attached nodes), up to 25. |
["jane", "sam"] | These nodes, by id. |
{ "nodes": …, … } | These nodes ("all" or a list), with the options below. |
| Option | What it does |
|---|---|
nodes"all" or array | Which nodes. Required in the object form. Up to 25 at a time; an id that isn't on the canvas is a 400 that names it. |
people1 to 10 | How many people to find for each node. Default 5. |
companiesboolean | true also adds the companies the people it found are tied to. Default false. |
depth1 to 3 | How many rounds. 1 (the default) expands the nodes you named. 2 then expands every person the first round added, and 3 theirs too, up to 150 expands in a job in all. |
picturesboolean | true finds pictures once the expand is done. See Pictures. |
For POST /api/canvases/:id/expand: an empty body expands every node; { "pictures": true } on its own only finds pictures; and { "expand": … } works there too, as in the create call.
curl -X POST https://quant.trading/api/canvases/123/expand \
-H "Authorization: Bearer $QT_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "nodes": ["jane", "sam"], "people": 5, "companies": true, "pictures": true }'
const res = await fetch("https://quant.trading/api/canvases/123/expand", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.QT_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ nodes: ["jane", "sam"], people: 5, companies: true, pictures: true }),
});
const job = await res.json();
if (!res.ok) throw new Error(`${res.status}: ${job.error}`);
console.log(job.status, `${job.done} of ${job.total} nodes`);
res = requests.post(
"https://quant.trading/api/canvases/123/expand",
headers={"Authorization": f"Bearer {os.environ['QT_API_KEY']}"},
json={"nodes": ["jane", "sam"], "people": 5, "companies": True, "pictures": True},
timeout=60,
)
job = res.json()
if not res.ok:
raise RuntimeError(f"{res.status_code}: {job['error']}")
print(job["status"], f"{job['done']} of {job['total']} nodes")
Use full names ("Jane Doe", not "Jane"): a common name can match the wrong person. Expand finds real people only, so it finds no one for made-up characters or a name it can't place, and says so in errors. Each node's expand uses AI the way an expand in the app does.
Depth grows fast: 5 people with 5 each is 25 at the second round, and about 125 more at the third. A depth of 2 on five nodes takes about 15 to 20 minutes.
One at a time
- A canvas runs one expand at a time: asking again while one is running is a
400. Wait for"done". - You can run 2 expands at once, on different canvases.
- A job runs in the server's memory. If the server restarts, the job stops: what it had added stays on the canvas, and its status goes back to
"none". Start it again for the rest.
Expand status
How far the canvas's latest expand is. Ask every 10 to 30 seconds until status is "done" or "failed". A finished job's status stays here for at least an hour after it ends.
{
"status": "running",
"total": 2,
"done": 1,
"current": "Sam Lee",
"added": { "nodes": 5, "edges": 5 },
"pictures": { "total": 0, "done": 0, "found": 0, "toReview": 0 },
"errors": [],
"startedAt": "2026-10-29T18:00:01.000Z",
"finishedAt": null
}| Field | What it is |
|---|---|
status | "running", "done" or "failed"; "none" if the canvas has no expand to report (none started, or the server restarted since). |
total, done | How many nodes it will expand in all, and how many it has. With depth, total grows as each round adds people. |
current | The name of the node it's on now, or null. |
added | How many nodes and connections it has added to the canvas so far. |
depth, level, levels | Only with a depth of 2 or 3: the depth asked for, the round it's on, and each round's { level, total, done }. |
pictures | Only if you asked for pictures: how many nodes need one (total), how many it has looked for (done), found (found), and left for you to choose from (toReview). |
errors | Nodes that didn't work, each { "node": "…", "error": "…" }, e.g. no one found. The rest of the job carries on; a node in here isn't a failed job. |
startedAt, finishedAt | When it started and ended (null while running). |
Pictures
With "pictures": true, every person and company on the canvas without a picture gets one, from the same search as Find image on a canvas: photos of people, logos of companies (give companies their website for the right logo). It runs after any expand, so the people it added get pictures too, up to 200 nodes a job.
- A picture it finds is saved on quant.trading, as an uploaded one is, and the node keeps where it came from.
- Where the search can't tell which photo is the right person, it doesn't guess: it keeps the photos it found on the node for you to pick from on the canvas. Those are counted in
pictures.toReview. - A node that has a picture, or gets one from you while the job runs, keeps it.
To find pictures for a canvas you already have, without expanding it, send { "pictures": true } to POST /api/canvases/:id/expand.
Reading your canvases
Any member can read their canvases from an AI app (Claude, ChatGPT, Cursor, or anything that speaks MCP). Make a connection token in Settings, AI & connections, and add quant.trading to the app as a remote MCP server:
URL: https://quant.trading/mcp Header: Authorization: Bearer ihmcp_your_token
| Tool | Who | Does |
|---|---|---|
list_canvases | Any member | Your canvases (up to 200, newest first) with their ids, names, node counts and when they last changed. |
get_canvas | Any member | One canvas by id: its nodes (id, name, type, notes; up to 500) and connections (from, to, label; up to 1,500). |
create_canvas | API key | The same as POST /api/canvases/create, with name, nodes, connections and expand. |
expand_canvas | API key | Starts an expand like POST /api/canvases/:id/expand; call it again with just the id for its status. |
Then ask in plain words: "Make me a canvas of Acme's board and expand everyone on it", or "What's on my Acme canvas?". The app picks the tools.
Under the hood, the server speaks MCP's Streamable HTTP transport, without sessions: each request is one JSON-RPC message in a POST to /mcp, and the answer is JSON. To call a tool yourself:
curl -X POST https://quant.trading/mcp \
-H "Authorization: Bearer $QT_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": { "name": "get_canvas", "arguments": { "id": 123 } } }'A full example
A script that makes a canvas from a list, expands its people with pictures, waits for the expand, and prints the link:
// make-board-canvas.mjs (Node 18+): QT_API_KEY=ihmcp_... node make-board-canvas.mjs
const BASE = "https://quant.trading";
const headers = { Authorization: `Bearer ${process.env.QT_API_KEY}`, "Content-Type": "application/json" };
async function call(method, path, body) {
for (;;) {
const res = await fetch(BASE + path, { method, headers, body: body ? JSON.stringify(body) : undefined });
if (res.status === 429) { // too many: wait for the window to reset, then send it again
const wait = Number(res.headers.get("ratelimit-reset")) || 30;
await new Promise((r) => setTimeout(r, wait * 1000));
continue;
}
const data = await res.json();
if (!res.ok) throw new Error(`${method} ${path}: ${res.status} ${data.error}`);
return data;
}
}
const board = [
{ id: "jane", name: "Jane Doe", role: "CEO" },
{ id: "sam", name: "Sam Lee", role: "CFO" },
{ id: "ola", name: "Ola Nordmann", role: "Chair" },
];
const made = await call("POST", "/api/canvases/create", {
name: "Acme board",
nodes: [
{ id: "acme", name: "Acme Corp", isCompany: true, website: "acme.com", isKing: true },
...board.map((p) => ({ id: p.id, name: p.name, notes: p.role })),
],
edges: board.map((p) => ({ from: p.id, to: "acme", label: p.role })),
expand: { nodes: board.map((p) => p.id), people: 5, depth: 1 },
pictures: true,
});
console.log(`Made "${made.canvas.name}" (${made.canvas.nodes} nodes)`);
let job = made.expand;
while (job && job.status === "running") {
await new Promise((r) => setTimeout(r, 15000));
job = await call("GET", `/api/canvases/${made.canvas.id}/expand`);
console.log(`${job.done}/${job.total} nodes, ${job.added.nodes} people added` + (job.current ? `, on ${job.current}` : ""));
}
for (const e of job?.errors || []) console.warn(`Couldn't expand ${e.node}: ${e.error}`);
console.log("Open it:", BASE + made.url);
# make_board_canvas.py: QT_API_KEY=ihmcp_... python make_board_canvas.py
import os, time, requests
BASE = "https://quant.trading"
session = requests.Session()
session.headers["Authorization"] = f"Bearer {os.environ['QT_API_KEY']}"
def call(method, path, body=None):
while True:
res = session.request(method, BASE + path, json=body, timeout=60)
if res.status_code == 429: # too many: wait for the window to reset, then send it again
time.sleep(int(res.headers.get("RateLimit-Reset", 30)))
continue
data = res.json()
if not res.ok:
raise RuntimeError(f"{method} {path}: {res.status_code} {data['error']}")
return data
board = [
{"id": "jane", "name": "Jane Doe", "role": "CEO"},
{"id": "sam", "name": "Sam Lee", "role": "CFO"},
{"id": "ola", "name": "Ola Nordmann", "role": "Chair"},
]
made = call("POST", "/api/canvases/create", {
"name": "Acme board",
"nodes": [{"id": "acme", "name": "Acme Corp", "isCompany": True, "website": "acme.com", "isKing": True}]
+ [{"id": p["id"], "name": p["name"], "notes": p["role"]} for p in board],
"edges": [{"from": p["id"], "to": "acme", "label": p["role"]} for p in board],
"expand": {"nodes": [p["id"] for p in board], "people": 5, "depth": 1},
"pictures": True,
})
print(f'Made "{made["canvas"]["name"]}" ({made["canvas"]["nodes"]} nodes)')
job = made.get("expand")
while job and job["status"] == "running":
time.sleep(15)
job = call("GET", f'/api/canvases/{made["canvas"]["id"]}/expand')
print(f'{job["done"]}/{job["total"]} nodes, {job["added"]["nodes"]} people added')
for e in (job or {}).get("errors", []):
print(f'Couldn\'t expand {e["node"]}: {e["error"]}')
print("Open it:", BASE + made["url"])
When it doesn't work
| Status | When | What to do |
|---|---|---|
400 | The body isn't right: nodes or edges isn't a list, too many nodes, an expand option out of range, a node id that isn't on the canvas, or an expand already running on it. | Read error; it says which. |
401 | No key, or a key that's wrong or revoked. | Check the header is Authorization: Bearer ihmcp_…, or make a new key. |
403 | The key isn't an API key made on the Admin page (a connection token from Settings can't make canvases), or its member isn't an admin any more. | Use an API key from Create canvas API. |
404 | Expanding a canvas that isn't yours or doesn't exist. | Check the id from the create call. |
409 | Your Library is full: 99 canvases. | Delete one you don't need and try again. |
429 | Too many calls in a short time. | Wait for RateLimit-Reset, then send it again. |
500 | Something failed on our side. | Try again a little later. If you sent a create, check your Library first, so you don't make it twice. |
Limits
| What | Limit |
|---|---|
| Request body | 1 MB |
| Nodes in a create | 5,000 |
| Connections in a create | 20,000 |
| Canvas name | 200 characters |
| Node name / notes / id | 160 / 2,000 / 80 characters |
| Canvases in a Library | 99 |
| Nodes in one expand round | 25 |
| People found for each node | 1 to 10 (default 5) |
| Expand depth | 1 to 3, at most 150 node expands in a job |
| Pictures in a job | 200 |
| Expands running at once | 1 a canvas, 2 a member |
| Make and expand calls | 300 in 15 minutes |