Skip to content

Quickstart

  1. 1

    Get your API key

    Sign in on the site with your wallet, add credits, then make a key on your account page. A key is btak_ followed by 32 letters and digits. The full key is shown once; store it on your server. The same key connects the MCP

  2. 2

    Read the catalog

    GET /v1/catalog lists every daily metric, the sections the token page shows and every tool with its input and price. It is free and needs no key

    curl
    curl "https://api.blocktronics.xyz/v1/catalog"
  3. 3

    Call a tool

    Send the tool's input as JSON. token_series takes a token (or a list of up to 5), the metrics you want and how many days

    curl -X POST "https://api.blocktronics.xyz/v1/tools/token_series" \
      -H "Authorization: Bearer $BLOCKTRONICS_KEY" \
      -H "content-type: application/json" \
      -d '{"token":"base:0x4ed4e862860bed51a9570b96d89af5e1b0efefed","metrics":["holders","netflow_usd"],"days":30}'
  4. 4

    Read the answer

    A 200 is the answer, charged 2 credits per token. It is served at once from what Blocktronics has stored; if the token was more than 15 minutes behind, it is being brought up to the hour behind your answer, and text says so

    200: the answer

    data is the JSON, text the same in words, charged what it took. Keep a missing day as a gap

    400: tool_error

    The tool couldn't answer that input, a token Blocktronics hasn't indexed for one. error says why. Nothing is charged

    402: not enough credits

    Refused before it ran. Nothing is charged

Several things at once

POST /v1/query asks for metrics, today, the overview, sections and the readout for up to 5 tokens in one request. Each part is 2 credits per token; the readout is at its own price. The balance must cover it before anything runs

TypeScript
// Server side only: the key never reaches the browser.
const res = await fetch("https://api.blocktronics.xyz/v1/query", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.BLOCKTRONICS_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({
    tokens: ["base:DEGEN", "base:AERO"],
    metrics: ["holders", "netflow_usd"],
    days: 14,
    today: true,
  }),
});
const body = await res.json();

// 402 insufficient, 401 bad_key and the rest: refused before anything ran, nothing charged.
if (!res.ok) throw new Error(`${body.code}: ${body.error}`);

console.log("charged", body.charged); // 8: 2 tokens × (metrics + today) × 2 credits
for (const t of body.tokens) {
  // A part that failed is named in errors, and wasn't charged.
  if (t.errors) console.warn(t.query, t.errors);
  console.log(t.token?.symbol, t.series?.summary, t.today?.everyone);
}

Billing and data rules

A pull costs 2 credits (token_series: per token). Refusals, errors and quotes are free. Join series by date, keep gaps and read unavailable before rendering a metric. See billing, freshness and new tokens and availability.

Next