Live P&B Tracking

This section details and describes the values within the P&B tracking payload.

The P&B Tracking websocket contains a live 'stream' of the team, player, ball and referee locations happening within a match. These are typically for clients wanting to integrate P&B tracking data for visualisations but not live betting markets.

This websocket provides an updated list of player positions and speeds and describes actions as they occur, such as passes and player sprints. The authentication token provided will be required to make a connection to this websocket endpoint. Once you have the API token, any further data that you send over the connection will be ignored. This endpoint sends heartbeats in-between data packets to let you know that it is still connected.

Endpoint URL

Live P&B Tracking

CONNECT wss://dde-generic-datastream.dde-prod.imgarena.dev/ws/soccer/tracking/low_latency

{
    "message": "Could not find fixture topic soccer.tracking.enrichment.08456e52-9cf7-48cc-913c-f45ec",
    "level": "WARN"
}

Polling limits

IMG Arena monitor the incoming traffic from our customers and strive to ensure that traffic is controlled, in-keeping with our guidelines and not unnecessarily excessive. We would suggest a polling rate of 5 requests per second, whilst we strive towards implementing rate limiting.

Connection Protocol

This section defines how to connect to the websocket. This works well in Postman.

Submit Auth Request
  1. Open websocket connection to the host and path for the data feed desired

  2. Submit authentication request

a. Use the same bearer token used to access any other part of the DDE b.

{
  "authToken": "<BEARER TOKEN>"
}
Successful Authentication Response

Successful authentication will return a json response {

  "message":"Authorisation accepted",
  "level":"INFO"
}
Heartbeats

At this point a Heartbeat will be sent every 10seconds

{
    "message": "Heartbeat sent at <ISO_DATE_TIME_STAMP>",
    "level": "INFO"
}
Submit a fixture request
{
  "fixtureId": "<FIXTURE ID>", 
  "backfill": <BACKFILL>
}
  1. Backfill Logic

    1. n = null -> all messages from start of feed + all future messages

    2. n = -1 -> all messages from start of feed + all future messages

    3. n = 0 -> all future messages ONLY

    4. n > 0 -> last n messages + all future messages

If the fixture exists then the data feed will commence

Once a fixture has been requested and accepted, any further fixture requests will be ignored.The connection must be closed and a new one opened to get a new fixture feed

Replay Fixture Request

This should be done by making the fixture request as below:

{
  "fixtureId": "<FIXTURE ID>", 
  "backfill": <BACKFILL>,
  "replay": {
    "enabled" : <boolean true/false>,
    "packetsPerSecond": <PACKETS_PER_SECOND>,
    "looped": <boolean true/false>
  }
}
  1. enabled is a boolean denoting if the replay functionality should be enabled or not. This allows you to use the same JSON body for all requests but to not have a request be a replay.

  2. packetsPerSecond is an integer between 1 and a 1000 denoting the number of packets that should be sent per second.

    a. The upper limit of 1000 is currently due to the speed we can read off kafka and produce to the websocket

  3. looped is a boolean denoting if the replay should loop when the end of the feed is reached. This allows you to request a match to keep replaying without making any further requests.

    a. Note that the replay will end when you close the websocket

Response Fields

Properties
Sub Properties
Description

id String

fixtureId as defined in DDE

ix Integer

Index per channel and sub-type (event type in event channel)

mt Integer

Match time- time clock of the phase [milliseconds]

ph Integer

Phase - number of the current phase

st String

State of the current phase: [start] first message of the phase [running] phase is in progress [end] final message of the phase

ut Integer

UTC time, in milliseconds

ba Integer

Ball - Statistics on the ball

jn Number

Jersey number for the player, -1 for unknowns

pn Number

Position - (x, y, z) ball coordinates. Origin is the pitch centre in metres

tr String

Track Id of the ball

tm String

Team in possession of the ball

hm Array

Home Team - statistics on the home team's players

tr String

Track Id - track Id associated to the player

ro Integer

Role - Index identifying player's role, -1 for unknowns

jn Integer

Jersey number for the player, -1 for unknowns

pl String

Player id for the player. null for unknowns

d Number

Distance - distance traveled by the player since the beginning [meters]

v Number

Speed - current speed of the player [meters/second]

aw Array

Away Team - statistics on the away team's players

tr String

As Above

ro Integer

As Above

jn Integer

As Above

pl String

As Above

d Number

As Above

v Number

As Above

rf

Referees - statistics on the referees

tr String

As Above

ro Integer

As Above

jn Integer

As Above

d Number

As Above

v Number

As Above

pn array

As Above

Last updated