Sessions are the foundation of the API. An active session represents a connection to a betting site and is required before you can place bets.
A session is an active connection to a specific betting site (e.g., TAB, Sportsbet). The API drives open sessions: a session with no strategy attached, which you manage under Sessions → Open in the dashboard. Sessions:
To retrieve all active sessions for your account, send a POST request to /api/session_ids:
POST /api/session_ids X-API-Key: YOUR_API_KEY Content-Type: application/json
{ "sessions": [ { "session_id": "uuid-string", "bookie": "tab", "username": "user@example.com", "active": true, "pc_id": "pc-identifier" }, { "session_id": "uuid-string-2", "bookie": "sportsbet", "username": "user@example.com", "active": true, "pc_id": "pc-identifier" } ] }
curl -X POST https://api.b337.ai/api/session_ids \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json"
import requests response = requests.post( 'https://api.b337.ai/api/session_ids', headers={ 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json', } ) data = response.json() print('Active Sessions:', data['sessions'])
Sessions can have the following statuses:
active - Session is ready to accept betsinactive - Session is not currently activeThe following bookmaker groups are supported for racing betting:
Currently, only TAB is supported for Same Game Multi (SGM) and basketball betting.
{ "detail": "Session not found or has expired" }
{ "detail": "Session is not active" }