trademagic guides

A forex signals API built for developers

Quantified FX signals as clean JSON: bearer auth, a snapshot endpoint, an incremental cursor feed, and read-only keys you can rotate in one click. Built to sit behind an MT5 EA, a Python bot, or an n8n workflow.

Start with a free trial. No credit card required.

Terminal showing JSON output from a forex signals REST API

The surface, in thirty seconds

  • Base URL: https://trademagic.ai/api/ext/v1
  • Auth: Authorization: Bearer tp_live_..., generated on your dashboard's API page. Read-only by design: it can fetch signals, nothing else.
  • Endpoints: /ping for connectivity, /signals for the fresh-signal snapshot, /signals/updates for the cursor feed your bot should live on.
  • Rate limit: 60 requests per minute per key. Polling every 30 to 60 seconds uses a fraction of it.
  • Errors: machine-readable, e.g. invalid_key (401), subscription_inactive (403), stale_cursor (409, re-bootstrap), rate_limited (429).
Three requests to production
# 1) Sanity check your key
curl -s "https://trademagic.ai/api/ext/v1/ping" \
  -H "Authorization: Bearer tp_live_YOUR_KEY"
# {"status":"ok","key_prefix":"tp_live_Ab3dEf9h","server_time":"..."}

# 2) Snapshot: every fresh signal in the rolling window
curl -s "https://trademagic.ai/api/ext/v1/signals" \
  -H "Authorization: Bearer tp_live_YOUR_KEY"

# 3) Incremental: everything since your cursor (the bot loop)
curl -s "https://trademagic.ai/api/ext/v1/signals/updates?after=CURSOR" \
  -H "Authorization: Bearer tp_live_YOUR_KEY"

The signal object

Prices arrive as strings to preserve FX precision. Each signal carries pair, side, entry, sl, tp, status (fresh, tp_hit, sl_hit, expired, force_close), plus the quantified layer: rr (risk to reward), ev (modelled expected value), and eta, the expected time-in-trade window. Status changes flow through the updates feed as events, so your consumer converges on current state no matter when it reconnects.

A complete consumer in 25 lines

Node 18+ (built-in fetch)
const BASE = "https://trademagic.ai/api/ext/v1";
const HEADERS = { Authorization: `Bearer ${process.env.TRADEMAGIC_KEY}` };

let cursor = null;
async function poll() {
  const url = cursor
    ? `${BASE}/signals/updates?after=${encodeURIComponent(cursor)}`
    : `${BASE}/signals/updates`;
  const res = await fetch(url, { headers: HEADERS });
  if (!res.ok) throw new Error(`api ${res.status}`);
  const data = await res.json();
  const fresh = data.bootstrapped
    ? data.signals
    : data.events.filter((e) => e.type === "created").map((e) => e.signal);
  for (const s of fresh) handleSignal(s);   // your sizing + execution
  cursor = data.next_cursor;
  setTimeout(poll, data.has_more ? 0 : 30_000);
}
poll();

Why an API at all

Because systematic execution is the only honest way to trade a model. The certified statistics assume every signal is taken; an API is how your bot matches that assumption around the clock while you keep custody, sizing, and risk entirely on your side. Full reference documentation ships with your account.

Start with a free trial

Create an account and your API key is minutes away.

Start free trial

Frequently asked questions

Is there a WebSocket, or is it polling only?

The consumer API is polling by design: the updates endpoint with a cursor delivers every change exactly once, survives restarts trivially, and 30 to 60 second polling sits well inside the useful window for signals that play out over hours.

What happens to my key if my subscription lapses?

The key stays valid but requests return 403 subscription_inactive until billing is back in good standing. You never need to re-integrate.

How many keys can I have?

One active key per account. Generating a new key revokes the old one instantly, which doubles as one-click rotation. The full key is shown once; only a hash is stored server side.

Where do the signals come from?

Certified, specialist FX models built by quant engineers on more than 900 data feeds: real tape-driven flow, macro and calendar surprise, COT positioning, futures, options, open interest, and carry. No technical indicators.

Start with a free trial

Create an account and your API key is minutes away.

Start free trial