An official JavaScript/TypeScript SDK is coming soon. These examples run in Node.js 22+ ESM (
.mjs files or "type": "module") and keep credentials in server-side environment variables. REST calls use built-in fetch; WebSocket examples use the ws package (npm install ws). Native browser WebSocket clients cannot set custom handshake headers, so browsers should use an authenticated backend relay.RUNDOWN_KEY.
Configuration
Helper Function
Getting Sports
Getting Events with Odds
Filtering by Affiliate
Getting Player Props
Stats: sample first, then one completed event
The fixed sample is a zero-data-point schema check. For production stats, request one known completed event with a smallstats_ids filter, cache the response, and fetch again only when your product needs a correction. Do not turn this into a per-team polling loop.
GET /stats?sport_id=3 before filtering. Production routes depend on effective stats access. See Stats Access.
Historical Odds
WebSocket Streaming
Installws with npm install ws and run this Node.js 22+ ESM code, not a browser.
WebSocket with Auto-Reconnect
Error Handling with Retry
TypeScript Types
If you are using TypeScript, here are type definitions for the core response objects: The optionalPrice.closed_at and MarketPriceUpdate.closed_at fields carry the current quote’s availability. A nonempty timestamp means closed; an omitted or empty value means open, including a reopened quote. Do not infer availability from the age of updated_at.
Moneyline lines can omit value, and a market_price update can omit previous_price, price_delta, and sport_id. Check for those fields before calling string or number methods on them.
Next Steps
Getting Live Odds
Detailed guide on fetching odds
WebSocket Streaming
Real-time data streaming guide
Authentication
All authentication methods
Rate Limits
Rate limit details and best practices