We just closed our $20K pre-seed.Read more
API reference

Build on the fair price.

REST + WebSocket access to AlphaLine's real-time fair-value engine. Stream signals, query mispriced markets, and pipe alerts into your own systems.

GEThttps://api.alphaline.gg/v1/markets
·v1 · stable
Interactive playground · predict.fun

Try it live

API playground·predict.funpredict.fun
Auth
al_live_••••••dca7
key authorized
List mispriced markets on predict.fun
Returns every predict.fun market where AlphaLine's fair price diverges from the book by ≥ 5%.
GET/v1/predictfun/markets?min_edge=5
code
import { AlphaLine } from "@alphaline/node";

const al = new AlphaLine(process.env.ALPHALINE_API_KEY);

const { data } = await al.predictfun.markets.list({
  min_edge: 5,
  sport: "NBA",
});

for (const m of data) {
  console.log(m.game, m.pick, m.edge);
}
Test suitepredict.fun integration · 8 tests
8 passing· 0 failing1.93s
auth_succeeds_with_valid_key41ms
rejects_expired_jwt18ms
lists_predictfun_markets_with_min_edge142ms
stream_emits_edge_crossed_events219ms
webhook_signature_verifies_hmac_sha25633ms
rate_limit_429_after_600_rps1284ms
respects_filter_min_edge_threshold87ms
predictfun_url_is_well_formed12ms
Get started in 30 seconds

Quickstart

Install the SDK or hit the REST API directly. Every response is JSON; every endpoint speaks UTF-8 over HTTPS.

  • Bearer-token auth on every request
  • Full historical odds + signals (Pro+)
  • WebSocket firehose with sub-second push
  • Webhooks for edge alerts & line moves
import { AlphaLine } from "@alphaline/node";

const client = new AlphaLine(process.env.ALPHALINE_API_KEY);

// list every market with edge >= 5%
const { data } = await client.markets.list({
  sport: "NBA",
  min_edge: 5,
  limit: 20,
});

console.log(data[0]);
Bearer tokens

Authentication

Authenticate with a bearer token in the Authorization header. Issue and rotate keys from your dashboard. Test keys are prefixedal_test_and live keys withal_live_.

Never expose live keys client-side.
Use a server-side proxy or our short-lived JWTs for browser apps.
Authorization: Bearer al_live_8f3c91e2d54a7b06f1e3a8d2c9e7b4a5
Content-Type: application/json
User-Agent: alphaline-node/2.4.0
Core resource

Markets

A market represents a tradeable proposition (moneyline, spread, total, prop). Each market includes the consensus market price, AlphaLine's fair-value price, and the signal vector that produced it.

GET/v1/markets
GET/v1/markets/:id
GET/v1/markets/:id/history
sportstring
NBA · NHL · MLB · NFL
min_edgenumber
Filter by absolute edge %
signalstring
injury · lineup · sharp · weather
limitnumber
1–100, default 20
{
  "object": "list",
  "data": [
    {
      "id": "mkt_lal_hou_g5_2026_04_29",
      "sport": "NBA",
      "game": "Rockets @ Lakers — Game 5",
      "pick": "Will Lakers close out Rockets in Game 5?",
      "market_prob": 0.64,
      "alpha_prob": 0.71,
      "edge": +0.07,
      "confidence": 0.91,
      "signal": {
        "type": "lineup",
        "label": "Reaves cleared, KD remains OUT",
        "vector": {
          "reaves_active":      +0.038,
          "durant_out":         +0.022,
          "vanvleet_out":       +0.011,
          "closeout_home_adj":  +0.009
        }
      },
      "updated_at": "2026-04-29T22:14:08.482Z",
      "venues": ["predictfun", "draftkings", "fanduel", "polymarket", "kalshi"]
    }
  ],
  "has_more": true,
  "next_cursor": "mkt_phi_pit_g6_2026_04_29"
}
The why behind every fair-price update

Signals

Signals are the discrete events that move our fair-value model: an injury wire, a confirmed lineup, a weather change, a reverse-line move. Each signal includes its source, magnitude, and the markets it updated.

GET/v1/signals
GET/v1/signals/:id
{
  "id": "sig_8f3c91e2d54a7b06",
  "type": "lineup",
  "league": "NBA",
  "subject": { "player_id": "austin_reaves", "team": "LAL" },
  "label": "Austin Reaves — cleared (oblique)",
  "magnitude": +0.038,
  "source": { "feed": "official_injury_wire", "ts": "2026-04-29T22:13:30.118Z" },
  "markets_affected": [
    "mkt_lal_hou_g5_2026_04_29",
    "mkt_lal_hou_spread_g5_2026_04_29",
    "mkt_reaves_pts_g5_2026_04_29"
  ],
  "received_at": "2026-04-29T22:13:30.302Z",
  "applied_at":  "2026-04-29T22:13:30.486Z"
}
Realtime — Pro & Desk

WebSocket firehose

Subscribe to the channels you care about and receive every fair-price update, signal, and edge alert as it happens. Median push latency is 184ms.

WSwss://stream.alphaline.gg/v1
markets.*channel
Fair-price updates per market
signals.*channel
New signals across all leagues
edges.>=Nchannel
Markets crossing N% edge
import WebSocket from "ws";

const ws = new WebSocket("wss://stream.alphaline.gg/v1", {
  headers: { Authorization: "Bearer al_live_..." },
});

ws.on("open", () => {
  ws.send(JSON.stringify({
    type: "subscribe",
    channels: ["edges.>=5", "signals.injury", "markets.NBA"],
  }));
});

ws.on("message", (raw) => {
  const event = JSON.parse(raw.toString());
  if (event.type === "edge.crossed") {
    console.log(event.market.game, event.edge);
  }
});
Push events to your stack

Webhooks

Configure webhooks to receive edge alerts, line-move notifications, and signal events. We sign every payload with HMAC-SHA256.

POST/v1/webhooks
GET/v1/webhooks
DELETE/v1/webhooks/:id
curl https://api.alphaline.gg/v1/webhooks \
  -H "Authorization: Bearer al_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://hooks.example.com/alphaline",
    "events": ["edge.crossed", "signal.injury"],
    "filter": { "leagues": ["NBA","NHL"], "min_edge": 5 }
  }'
Predictable, machine-readable

Errors

AlphaLine uses standard HTTP codes. Every error response includes a type, human-readable message, and a stable code.

400
invalid_request
Malformed parameter or missing field.
401
unauthorized
Missing or invalid API key.
402
quota_exceeded
Plan limit reached. Upgrade to continue.
404
not_found
Resource doesn't exist.
429
rate_limited
Too many requests — back off.
500
server_error
We broke something. Retry with exp backoff.
{
  "error": {
    "type": "rate_limited",
    "code": "rate_limited.minute",
    "message": "You have exceeded 600 requests per minute on the markets endpoint.",
    "retry_after_ms": 1283,
    "request_id": "req_8f3c91e2d54a"
  }
}
Ready in 30 seconds

Get an API key, ship by lunch.

Sign in to issue a test key, then upgrade to Pro when you're ready for live data and the firehose.