API guide Back to quant.trading

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

CanvasMake research canvases of people, companies and how they connect, have the AI expand them, and find pictures for everyone on them.
More areas soonFurther parts of the app will get their own sections here as they open up.

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_.

KeyWhere you make itWhat it can do
API keyAdmin 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 tokenSettings, 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:

Header
Authorization: Bearer ihmcp_your_key_here
Keep keys secret

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

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:

400 Bad Request
{ "error": "nodes must be a list." }
StatusMeans
400Something in the request isn't right. error says what.
401No key, or a key that's wrong or revoked.
403The key works, but its member may not do this.
404There's no such thing of yours (another member's canvas is a 404 too, never a 403).
409It clashes with what you have, like a full Library.
429Too many requests. Wait and try again (see Rate limits).
500Something 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.

WhatAllowance
Canvas calls that make or expand300 in 15 minutes
MCP server (/mcp)60 a minute, per member
All API calls together500 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.

CallDoes
POST /api/canvases/createMakes a new canvas, and can start an expand and pictures on it.
POST /api/canvases/:id/expandExpands a canvas you have with AI, or finds its pictures.
GET /api/canvases/:id/expandSays how far an expand is.

Who can use it

Admins only for now

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.

  1. Open the Admin page and find Create canvas API.
  2. Under API keys, name the key after what will use it (e.g. "CRM sync") and choose Make a key.
  3. 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" }
    ]
  }'

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

POST/api/canvases/createAPI key (admin)

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

FieldWhat it is
namestringThe 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.
nodesarrayThe people, companies and notes. See Nodes. Up to 5,000.
edgesarrayThe connections between them. See Connections. Up to 20,000.
expandstring, array or objectHave 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.
picturesbooleantrue finds a picture for every person and company on the canvas, after any expand. See Pictures.
viewportobjectThe 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.
thumbnailstringA 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:

A node
{ "id": "jane", "name": "Jane Doe", "notes": "CEO of Acme since 2019" }
FieldWhat it is
idstringYour 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.
namestringThe 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.
notesstringA line or two under the name (a role, what a company does), up to 2,000 characters. description works too.
textstringWhat 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.
isCompanybooleantrue 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.
websitestringA company's own domain, like acme.com, so the picture search finds its logo and not another company's of the same name.
imagestringA picture for the node, as an https:// URL. A node that has one keeps it: Pictures only fills in nodes without.
sourceUrlstringWhere the information came from (a Wikipedia page, a filing). It shows as the node's source.
x, ynumberWhere the node goes. See Where nodes go.
width, heightnumberThe node's size. Default 560 by 230, the size the app gives every node.
isKingbooleantrue 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:

A connection
{ "from": "jane", "to": "acme", "label": "CEO" }
FieldWhat it is
fromstringOne node's id. fromNode or source work too.
tostringThe other node's id. toNode or target work too.
labelstringWhat's written on the line, up to 300 characters, like "CEO", "invested in" or "married to". relationship works too.
idstringYour 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 x and y, 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 x and y, nodes are put where you say (and one without them at 0, 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 exactly 0, 0 is 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

201 Created
{
  "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"
}
FieldWhat it is
canvas.idThe canvas's id. Keep it to expand the canvas later.
canvas.nameThe name it got, which has a number after it if you already had one with that name.
canvas.nodes, canvas.edgesHow many nodes and connections it has (connections to missing nodes left out).
urlThe 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.
expandOnly 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 of POST /api/canvases/create.
  • On a canvas you have (made by the API or in the app):
POST/api/canvases/:id/expandAPI key (admin)

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:

FormExpands
"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.
OptionWhat it does
nodes"all" or arrayWhich 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 10How many people to find for each node. Default 5.
companiesbooleantrue also adds the companies the people it found are tied to. Default false.
depth1 to 3How 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.
picturesbooleantrue 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 }'
Getting good results

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

GET/api/canvases/:id/expandAPI key (admin)

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.

200 OK
{
  "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
}
FieldWhat it is
status"running", "done" or "failed"; "none" if the canvas has no expand to report (none started, or the server restarted since).
total, doneHow many nodes it will expand in all, and how many it has. With depth, total grows as each round adds people.
currentThe name of the node it's on now, or null.
addedHow many nodes and connections it has added to the canvas so far.
depth, level, levelsOnly with a depth of 2 or 3: the depth asked for, the round it's on, and each round's { level, total, done }.
picturesOnly 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).
errorsNodes 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, finishedAtWhen 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:

MCP server
URL:     https://quant.trading/mcp
Header:  Authorization: Bearer ihmcp_your_token
ToolWhoDoes
list_canvasesAny memberYour canvases (up to 200, newest first) with their ids, names, node counts and when they last changed.
get_canvasAny memberOne canvas by id: its nodes (id, name, type, notes; up to 500) and connections (from, to, label; up to 1,500).
create_canvasAPI keyThe same as POST /api/canvases/create, with name, nodes, connections and expand.
expand_canvasAPI keyStarts 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
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);

When it doesn't work

StatusWhenWhat to do
400The 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.
401No key, or a key that's wrong or revoked.Check the header is Authorization: Bearer ihmcp_…, or make a new key.
403The 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.
404Expanding a canvas that isn't yours or doesn't exist.Check the id from the create call.
409Your Library is full: 99 canvases.Delete one you don't need and try again.
429Too many calls in a short time.Wait for RateLimit-Reset, then send it again.
500Something 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

WhatLimit
Request body1 MB
Nodes in a create5,000
Connections in a create20,000
Canvas name200 characters
Node name / notes / id160 / 2,000 / 80 characters
Canvases in a Library99
Nodes in one expand round25
People found for each node1 to 10 (default 5)
Expand depth1 to 3, at most 150 node expands in a job
Pictures in a job200
Expands running at once1 a canvas, 2 a member
Make and expand calls300 in 15 minutes