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.
Try it live
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);
}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]);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_.
Authorization: Bearer al_live_8f3c91e2d54a7b06f1e3a8d2c9e7b4a5
Content-Type: application/json
User-Agent: alphaline-node/2.4.0Markets
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.
sportstringmin_edgenumbersignalstringlimitnumber{
"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"
}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.
{
"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"
}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.
markets.*channelsignals.*channeledges.>=Nchannelimport 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);
}
});Webhooks
Configure webhooks to receive edge alerts, line-move notifications, and signal events. We sign every payload with HMAC-SHA256.
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 }
}'Errors
AlphaLine uses standard HTTP codes. Every error response includes a type, human-readable message, and a stable code.
{
"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"
}
}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.