> For the complete documentation index, see [llms.txt](https://docs.sportradar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sportradar.com/tennis/p-and-b-tracking-websockets/p-and-b-tracking-rally.md).

# P\&B Tracking - Rally

Below are the available websocket with more information on the data being returned.

## Endpoint URL

## Live Rally Summary Feed

`CONNECT` `wss://dde-generic-datastream.dde-prod.imgarena.dev/ws/tennis/rally/tracking/tdi`

This endpoint returns 4 different types of rally information for a match:

| Content                      | Description                                                                                                                                                                                           |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Rally Summary                | Describes all the summary for a rally - Breakdown of points won per player by rally length grouping and the Average number of shots per rally, distance travelled, winning shot (speed/stroke/result) |
| Per Rally Event              | Describes all the events which happened during a rally (spin, type (back/forehand), speed, duration, result)                                                                                          |
| Per Rally Ball/Shot Tracking | Describes all the shots in a rally (arcs x/y/z)                                                                                                                                                       |
| Per Rally Player Tracking    | Describes all the player movement in a set timeframe- (Time, Position, velocity)                                                                                                                      |

{% tabs %}
{% tab title="404: Not Found Unknown Fixture" %}

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

{% endtab %}

{% tab title="400: Bad Request Failed Authentication Request" %}

```javascript
{
    "message": "Authentication message had incorrect format",
    "level": "ERROR"
}
```

{% endtab %}

{% tab title="200: OK " %}

```json
{
    "created": "2022-08-14T06:10:23.4908526Z",
    "id": "e28fc19b-69ec-4504-b77b-a4e0cca6ef46",
    "type": "live.tracking.summary",
    "packetDetails": {
        "set": 1,
        "game": 1,
        "point": 1,
        "serve": 1,
        "rally": 1,
        "sequence": 1,
        "start": "2022-08-14T06:10:13.7513333Z",
        "end": "2022-08-14T06:10:20.4825333Z"
    },
    "matchDetails": {
        "competitionId": "5817",
        "year": 2022,
        "court": "2",
        "matchId": "LS001",
        "singles": true,
        "wheelchair": false,
        "electronicLineCalling": false,
        "televised": false,
        "format": "BestOfThreeTiebreakSets",
        "round": "RoundOf2",
        "players": [
            {
                "team": 1,
                "player": 1,
                "id": "320922",
                "seed": "",
                "firstName": "Ksenia",
                "lastName": "Laskutova"
            },
            {
                "team": 2,
                "player": 1,
                "id": "00BQ9O",
                "seed": "",
                "firstName": "Marketa",
                "lastName": "Petruzelova"
            }
        ]
    },
    "summary": {
        "shots": 2,
        "result": "Played",
        "scorer": 2,
        "matchPoint": false,
        "setPoint": false,
        "breakPoint": false,
        "decidingPoint": false,
        "gamePoint": false,
        "tiebreak": false,
        "finalSet": false,
        "finalSetATieBreak": false,
        "teamToLeftOfUmpire": 2,
        "teamAtPositiveX": 2,
        "server": {
            "team": 2,
            "player": 1
        },
        "receiver": {
            "team": 1,
            "player": 1
        },
        "conclusion": {
            "stroke": "Backhand",
            "result": "Error",
            "action": "Forced",
            "eventId": "698bb76a-6df7-352f-88c8-6610f6b0d150",
            "speed": 71.193
        },
        "serve": {
            "eventId": "d2dd6483-fe40-3cf9-9cc3-059aae7e73b2",
            "side": "Advantage",
            "speed": 98.213
        },
        "playersDistanceTravelled": [
            {
                "team": 1,
                "player": 1,
                "distance": 5.197
            },
            {
                "team": 2,
                "player": 1,
                "distance": 8.624
            }
        ],
        "match": {
            "start": "2020-09-13T20:16:57.175Z",
            "duration": 170,
            "sets": {
                "team1": 2,
                "team2": 1
            },
            "games": {
                "team1": 19,
                "team2": 17
            },
            "points": {
                "team1": 119,
                "team2": 116
            }
        },
        "sets": [
            {
                "start": "2020-09-13T20:16:57.175Z",
                "end": "2020-09-13T20:47:26.688Z",
                "duration": 30,
                "games": {
                    "team1": 6,
                    "team2": 2
                },
                "tiebreak": {
                    "team1": 0,
                    "team2": 0
                },
                "points": {
                    "team1": 29,
                    "team2": 17
                }
            },
            {
                "start": "2020-09-13T20:49:57.128Z",
                "end": "2020-09-13T21:36:04.457Z",
                "duration": 46,
                "games": {
                    "team1": 6,
                    "team2": 4
                },
                "tiebreak": {
                    "team1": 0,
                    "team2": 0
                },
                "points": {
                    "team1": 39,
                    "team2": 34
                }
            },
            {
                "start": "2020-09-13T21:38:32.196Z",
                "end": "2020-09-13T22:26:40.248Z",
                "duration": 48,
                "games": {
                    "team1": 4,
                    "team2": 6
                },
                "tiebreak": {
                    "team1": 0,
                    "team2": 0
                },
                "points": {
                    "team1": 32,
                    "team2": 36
                }
            },
            {
                "start": "2020-09-13T22:29:44.602Z",
                "duration": 37,
                "games": {
                    "team1": 3,
                    "team2": 5
                },
                "tiebreak": {
                    "team1": 0,
                    "team2": 0
                },
                "points": {
                    "team1": 19,
                    "team2": 29
                }
            }
        ],
        "game": {
            "start": "2020-09-13T23:06:52.165Z",
            "duration": 0,
            "team1Score": "0",
            "team2Score": "15"
        }
    }
}
```

{% endtab %}
{% endtabs %}

## JSON Response

<details>

<summary>Rally</summary>

```json
{
    "id": "aea5ae6a-7d21-4a5c-b2e3-520af63c6f4a",
    "updated": "2024-09-05T08:05:31.898Z",
    "source": "IMG Arena",
    "revision": 0,
    "sequences": {
        "set": 1,
        "game": 4,
        "point": 2,
        "serve": 1,
        "rally": 1
    },
    "match": {
        "season": 2024,
        "tournament_id": 8000,
        "draw_code": "QS801",
        "court_id": 1,
        "players": [
            {
                "forename": "Aaaa",
                "surname": "A. TEST-A",
                "team": 1,
                "player": 1,
                "atp_id": "TC48"
            },
            {
                "forename": "Bbbb",
                "surname": "B. TEST-B",
                "team": 2,
                "player": 1,
                "atp_id": "TC49"
            }
        ]
    },
    "summary": {
        "server": 2,
        "result": "played",
        "scorer": 1,
        "team_to_left_of_umpire": 2,
        "team_at_positive_x": 2,
        "serve_side": "advantage",
        "duration": 22.853
    },
    "events": [
        {
            "shot_no": 1,
            "team": 2,
            "stroke": "serve",
            "side": "right",
            "spin": {
                "type": "backspin",
                "rpm": -533.5
            },
            "speed_ms": 37.2,
            "call": "out",
            "distance": 1.315,
            "time_utc": "2024-08-28T10:34:59.163Z",
            "time": 0.0,
            "duration": 0.933,
            "arcs": [
                {
                    "type": "hit",
                    "time": {
                        "start": 0.0,
                        "end": 0.6183576122602972
                    },
                    "curve_params": {
                        "x": [
                            11.448379085900681,
                            -37.59106509224906,
                            12.882074073756797,
                            -3.8061409856201465,
                            -1.2590817277668975E-11
                        ],
                        "y": [
                            1.1927701387883975,
                            -2.568742428903281,
                            1.7800706599161629,
                            -0.03579140449295437,
                            1.7053025658242404E-13
                        ],
                        "z": [
                            2.956248539571349,
                            -2.8732483416899584,
                            -2.8792345401092234,
                            -0.12075730895730885,
                            -4.547473508864641E-13
                        ]
                    }
                },
                {
                    "type": "bounce",
                    "time": {
                        "start": 0.6183576122602972,
                        "end": 0.9333333333361225
                    },
                    "curve_params": {
                        "x": [
                            0.7626723812172713,
                            -9.445114334346727,
                            -10.304013277345803,
                            5.202559269644553,
                            0.0
                        ],
                        "y": [
                            0.792581574953374,
                            -1.435910410994893,
                            1.1418036552777266,
                            -0.2986747712266151,
                            -8.640199666842818E-12
                        ],
                        "z": [
                            -4.260098177796436,
                            6.11232057540667,
                            4.300642381593889,
                            -4.727909594821313,
                            -1.0516032489249483E-11
                        ]
                    }
                }
            ]
        }
    ],
    "samples": [
        {
            "time": 0.0,
            "event": [
                "hit",
                "peak"
            ],
            "ball": {
                "pos": {
                    "x": 11.448,
                    "y": 1.193,
                    "z": 2.956
                }
            },
            "players": [
                {
                    "team": 1,
                    "pos": {
                        "x": -12.975,
                        "y": -2.727
                    }
                },
                {
                    "team": 2,
                    "pos": {
                        "x": 11.901,
                        "y": 1.38
                    }
                }
            ]
        },
        {
            "time": 0.02,
            "ball": {
                "pos": {
                    "x": 10.702,
                    "y": 1.142,
                    "z": 2.898
                }
            },
            "players": [
                {
                    "team": 1,
                    "pos": {
                        "x": -12.975,
                        "y": -2.727
                    }
                },
                {
                    "team": 2,
                    "pos": {
                        "x": 11.904,
                        "y": 1.387
                    }
                }
            ]
        },
        {
            "time": 0.04,
            "ball": {
                "pos": {
                    "x": 9.965,
                    "y": 1.093,
                    "z": 2.837
                }
            },
            "players": [
                {
                    "team": 1,
                    "pos": {
                        "x": -12.975,
                        "y": -2.727
                    }
                },
                {
                    "team": 2,
                    "pos": {
                        "x": 11.9,
                        "y": 1.385
                    }
                }
            ]
        },
        {
            "time": 0.06,
            "ball": {
                "pos": {
                    "x": 9.238,
                    "y": 1.045,
                    "z": 2.773
                }
            },
            "players": [
                {
                    "team": 1,
                    "pos": {
                        "x": -12.975,
                        "y": -2.727
                    }
                },
                {
                    "team": 2,
                    "pos": {
                        "x": 11.896,
                        "y": 1.383
                    }
                }
            ]
        },
        {
            "time": 0.08,
            "ball": {
                "pos": {
                    "x": 8.522,
                    "y": 0.999,
                    "z": 2.708
                }
            },
            "players": [
                {
                    "team": 1,
                    "pos": {
                        "x": -12.975,
                        "y": -2.727
                    }
                },
                {
                    "team": 2,
                    "pos": {
                        "x": 11.892,
                        "y": 1.382
                    }
                }
            ]
        },
        {
            "time": 0.1,
            "ball": {
                "pos": {
                    "x": 7.814,
                    "y": 0.954,
                    "z": 2.64
                }
            },
            "players": [
                {
                    "team": 1,
                    "pos": {
                        "x": -12.975,
                        "y": -2.727
                    }
                },
                {
                    "team": 2,
                    "pos": {
                        "x": 11.888,
                        "y": 1.38
                    }
                }
            ]
      ..................
        }
    ]
}
```

</details>

## Response Fields

{% file src="/files/B0Rb46UjAdYfb0C26PEJ" %}

For availability of P\&B Tracking feeds across specific Tournaments and Tours, please contact <support@imgarena.com>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sportradar.com/tennis/p-and-b-tracking-websockets/p-and-b-tracking-rally.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
