Skip to main content

Login Message

Connect and send a login message immediately:
{
  "type": "login",
  "apiKey": "YOUR_API_KEY"
}
Rules:
  • Must be the first message
  • Send within 10 seconds
  • Defines all subscriptions and filters

Login with Channels and Filters

{
  "type": "login",
  "apiKey": "YOUR_API_KEY",
  "receiveType": "binary",
  "channels": ["fixtures", "scores", "odds"],
  "sportIds": [10, 11, 12, 13],
  "tournamentIds": [35430, 39351],
  "fixtureIds": ["id1103543066138356", "id1103935163991375"],
  "bookmakers": ["stake"]
}

Filter Mode

FieldTypeDescription
channelsstring[]Streams you want to receive.
sportIdsnumber[]Restrict to these sports.
tournamentIdsnumber[]Restrict to these tournaments.
fixtureIdsstring[]Exact fixtures (fixture-scoped channels only).
futureIdsstring[]Specific futures (future-scoped channels).
bookmakersstring[]Only receive these bookmakers (bookmaker-gated).
langstringTranslations (en, de, fr, etc.).
receiveTypestring"json" or "binary".
clientNamestringOptional debug/metrics tag.
serverEpochstringFor resume.
lastSeenIdobject{ "<channel>": "<entryId>" } for resume.
IDs like fixtureId and futureId are structured but should be treated as opaque in your logic. See Concepts.

Access: Live vs Pregame

After login, the server tells you what you’re allowed to receive:
{
  "access": { "live": true, "pregame": false }
}
These are determined by your apiKey, not client filters.

Bookmaker-Gated Channels

These channels require explicit bookmaker access:
  • odds, bookmakers
  • oddsFutures, bookmakersFutures
You can restrict which bookmakers you receive:
{
  "type": "login",
  "apiKey": "YOUR_API_KEY",
  "channels": ["odds", "bookmakers"],
  "receiveType": "binary",
  "bookmakers": ["stake", "pinnacle"]
}

🐍 Python Example

import asyncio, json, websockets, msgpack

WS_URL = "wss://v5.oddspapi.io/ws"
API_KEY = "your-api-key"

LOGIN = {
    "type": "login",
    "apiKey": API_KEY,
    "channels": ["fixtures", "scores", "odds"],
    "receiveType": "binary",
    "sportIds": [10, 11],
    "bookmakers": ["stake"],
}

async def main():
    async with websockets.connect(WS_URL) as ws:
        await ws.send(json.dumps(LOGIN))

        async for raw in ws:
            if isinstance(raw, str):
                print("CONTROL:", json.loads(raw))
            else:
                msg = msgpack.unpackb(raw, raw=False)
                print("DATA:", msg.get("channel"), msg.get("entryId"))

asyncio.run(main())