# Play By Play Shot Commentary

### Endpoint URL

`wss://dde-streams.data.imgarena.com/golf/tournaments/{tournamentId}/pbpcommentary/holes/{holeno}`

The authentication token provided will be required to make a connection to this websocket endpoint.

Sample Endpoint URL for The American Express 2025 for hole 2:

`wss://dde-streams.data.imgarena.com/golf/tournaments/1092/pbpcommentary/holes/2`

**Process for connecting to the web socket endpoints**

* Connect to SSL websocket address
* Send JSON packet containing API token
* Receive response indicating that connection is authorised (or a response indicating why the connection cannot be made)
* Receive heartbeat packets every 10 seconds to verify the connection is live
* Receive data packets

Once you have the API token, any further data that you send over the connection will be ignored.

### Request Parameters

This endpoint currently takes no request parameters currently.

### Response Model

| Field Name                | Type      | Description                                                                                                                                          |
| ------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| distanceToPinYards        | float     | Distance in yards from the player's current ball position to the pin of the hole                                                                     |
| groupNo                   | integer   | The group number of the player, shared with who they are playing their round with                                                                    |
| holeNo                    | integer   | The current Hole Number the event took place on. Holes **1 - 18**                                                                                    |
| latestStrokeNo            | int       | The *n*th shot/stroke on the current hole.                                                                                                           |
| pbpCommentary             | string    | Generated text commentary relative to the shot in question and the surrounding situation of the player's shot                                        |
| playerId                  | integer   | The internal ID of the Player of the current event                                                                                                   |
| tournamentId              | integer   | The unique Tournament ID of the current event                                                                                                        |
| roundNumber               | integer   | The current Round Number the event took place on. Usually would be 1 to 4                                                                            |
| playerName                | string    | The first name and surname of the player                                                                                                             |
| prevDistanceToPinYards    | float     | <p>Distance in yards from the player's previous ball position from their previous shot to the pin of the hole.<br>This field can be optional</p>     |
| teamNumber                | integer   | The player's Team Number for the current Tournament format                                                                                           |
| shotFromLocation          | string    | The description of the location on the hole from where the player took their most recent shot, e.g. rough, fairway, bunker, tee                      |
| shotToLocation            | string    | The description of the location on the hole from where the player's ball has landed after their most recent shot, e.g. rough, fairway, bunker, green |
| latestPlayed              | Binary    | <p>1 = This player within the group was the last to play.<br><br>0 = This player within the group was not the last to play.</p>                      |
| nextToPlay                | Binary    | <p>1 = This player within the group is next to play.<br><br>0 = This player within the group is not the next to play.</p>                            |
| timestamp                 | timestamp | The time stamp of this action.                                                                                                                       |
| tournamentScoreToPar      | string    | The overall player score to par for that tournament. This can be "E" if there are no scoreToPar                                                      |
| groupHoleStartedTimestamp | timestamp | The timestamp of the group on the hole                                                                                                               |
| currentHoleOrder          | integer   | The current hole order                                                                                                                               |
| externalPlayerId          | integer   | The external player id. This field can be optional                                                                                                   |

### Sample Response for Stroke Play

```
{
    "tournamentId": 3369
    "holeNo": 6,
    "seqNum": 799,
    "timestamp": "2025-12-04T15:41:38.000Z",
    "pbpComments": [
        {
            "currentHoleOrder": 1,
            "distanceToPinYards": 138.33836216373763,
            "groupHoleStartedTimestamp": "2025-12-04T15:38:52.000Z",
            "groupNo": 21,
            "holeNo": 6,
            "latestPlayed": 1,
            "latestStrokeNo": 1,
            "nextToPlay": 0,
            "pbpCommentary": "Shot 1: 271yds to Fairway, 138yds to pin",
            "playerId": 27,
            "playerName": "Lee Westwood",
            "prevDistanceToPinYards": 418.0,
            "roundNumber": 4,
            "shotFromLocation": "Tee Box",
            "shotToLocation": "Fairway",
            "teamNumber": 11,
            "timestamp": "2025-12-04T15:41:38.000Z",
            "tournamentId": 3369,
            "tournamentScoreToPar": "-5"
        },
        {
            "currentHoleOrder": 1,
            "distanceToPinYards": 144.99704093028825,
            "groupHoleStartedTimestamp": "2025-12-04T15:38:52.000Z",
            "groupNo": 21,
            "holeNo": 6,
            "latestPlayed": 0,
            "latestStrokeNo": 1,
            "nextToPlay": 0,
            "pbpCommentary": "Shot 1: 264yds to Fairway, 145yds to pin",
            "playerId": 3,
            "playerName": "Matt Wallace",
            "prevDistanceToPinYards": 418.0,
            "roundNumber": 4,
            "shotFromLocation": "Tee Box",
            "shotToLocation": "Fairway",
            "teamNumber": 6,
            "timestamp": "2025-12-04T15:40:31.000Z",
            "tournamentId": 3369,
            "tournamentScoreToPar": "-4"
        }
    ]
}
```
