# Player Statistics Rankings

This endpoint is a live websocket endpoint that returns the full set up player statistics rankings metrics for all rounds in a given tournament. Currently the whole player stats event is sent whenever a new RoundDetails packet is received from either Sport Services (formerly FlightScope), or PGA.

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.

N.B – This endpoint sends heartbeats in-between data packets to let you know that it is still connected.

This endpoint currently takes no request parameters

This can be found at:

* **Scoring** = `wss://dde-streams.data.imgarena.com/media/golf/tournaments/{tournamentId}/stats/scoring`
* **Approach Play =** `wss://dde-streams.data.imgarena.com/media/golf/tournaments/{tournamentId}/stats/approach`
* **Short Game** = `wss://dde-streams.data.imgarena.com/media/golf/tournaments/{tournamentId}/stats/shortgame`
* **Putting =** `wss://dde-streams.data.imgarena.com/media/golf/tournaments/{tournamentId}/stats/putting`
* **Driving** = `wss://dde-streams.data.imgarena.com/media/golf/tournaments/{tournamentId}/stats/driving`

### Player Statistics Ranking via RestAPI

Note that the player statistics ranking websockets are available via Rest:

* Scoring - `https://dde-api.data.imgarena.com/media/golf/tournaments/{tournamentId}/stats/scoring?rest=true`
* Approach - `https://dde-api.data.imgarena.com/media/golf/tournaments/{tournamentId}/stats/approach?rest=true`
* Shortgame - `https://dde-api.data.imgarena.com/media/golf/tournaments/{tournamentId}/stats/shortgame?rest=true`
* Putting - `https://dde-api.data.imgarena.com/media/golf/tournaments/{tournamentId}/stats/putting?rest=true`
* Driving - `https://dde-api.data.imgarena.com/media/golf/tournaments/{tournamentId}/stats/driving?rest=true`)

**Full list of statistics**

* Scoring
  * teeToGreenStrokesGained
  * Birdies or Better
  * Bogeys or Worse
  * Par 3 scoring
  * Par 4 scoring
  * Par 5 scoring
* Driving
  * offTheTeeStrokesGained
  * Accuracy
  * Distance
  * driverUsage
  * bigMisses
  * Longest Drive
* Approach
  * approachStrokesGained
  * Greens in Regulation
  * Green under Regulation
  * 10-20ft
  * 20-30ft
  * 30ft+
  * Chances inside 10ft
  * Chances inside 20ft
  * Chances inside 30ft
  * offGreen
* Short game
  * aroundTheGreenStrokesGained
  * fairway
  * fringe
  * other
  * rough
  * sand
  * scrambleFromFairwayFringe
  * screambleFromRoughHazard
  * Scrambles
  * Sand saves
  * Scrambles Other
* Putting
  * puttingStrokesGained
  * Total putts
  * longest holed putt
  * Putts holed distance
  * putts per GIR
  * three putts

Each of these statistics has the following qualifying components:

* Tournament
  * Total
  * Divisor
  * Rank (the overall player rank across a tournament for each metric within each discipline)
  * Field Average (the tournament average for each metric within each discipline)
* Round
  * Total
  * Divisor
  * Rank (the specific round player rank across a tournament for each metric within each discipline)
  * Field Average (the round average for each metric within each discipline)

These qualifying components have different meanings that are dependent on the context. These are outlined along with the definitions of each statistic.

**Definitions**

| **Stat**                    | **Total**                                                                                                                                                                    | Data type for total | **Divisor**                                                                            |         |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | -------------------------------------------------------------------------------------- | ------- |
| Birdies or better           | Total number of completed holes where the number of strokes is less than Par for that hole                                                                                   | integer             | Holes Played                                                                           | integer |
| Bogeys or worse             | Total number of completed holes where the number of strokes is more than Par for that hole.                                                                                  | integer             | Holes Played                                                                           | integer |
| Par 3 scoring               | Total Score to Par of all holes that are Par 3s. So if a player scores 4, 5, 3, 5 or the 4 Par 3s, they will be “+5”.                                                        | integer             | Holes Played                                                                           | integer |
| Par 4 scoring               | Total Score to Par of all holes that are Par 4s. So if a player scores 4, 5, 3, 5 or the 4 Par 4s, they will be “+1”                                                         | integer             | Holes Played                                                                           | integer |
| Par 5 scoring               | Total Score to Par of all holes that are Par 5s. So if a player scores 4, 5, 3, 5 or the 4 Par 5s, they will be “-3”.                                                        | integer             | Holes Played                                                                           | integer |
| Driving accuracy            | Total number of Fairways found from Shot 1 on Par 4s and 5s.                                                                                                                 | integer             | Total number of Par 4 and 5s played.                                                   | integer |
| Driving distance            | Average Drive Distance of all par 4/5s. Limit to one decimal place                                                                                                           | float               | Number of driving holes played (\*)                                                    | integer |
| Longest Drive               | The longest distance from all tee shots on Par 4 and 5 holes for the round                                                                                                   | float               | Number of driving holes played (\*)                                                    |         |
| Driver Usage                | The number of Par 4/5 holes played where the tee shot Club Type is a Driver                                                                                                  | float               | Number of driving holes played (\*)                                                    |         |
| Greens in Regulation        | Total number of Greens in Regulation. Defined as finding the Green or Hole on or before the (n-2)th stroke.                                                                  | integer             | Total number of Holes Played                                                           | integer |
| Birdie Chances 10ft         | Total number of Greens in Regulation, where the distance left to the hole is 10ft or 3 metres. If they mad an Eagle or Albatross this should count as a birdie chance hole   | integer             | Total number of holes played so far                                                    | integer |
| Birdie Chances 20ft         | Total number of Greens in Regulation, where the distance left to the hole is 20ft or 6 metres. If they made an Eagle or Albatross this should count as a birdie chance hole. | integer             | Total number of holes played so far                                                    | integer |
| Birdie Chances 30ft         | Total number of Greens in Regulation, where the distance left to the hole is 30ft or 9 metres. If they made an Eagle or Albatross this should count as a birdie chance hole. | integer             | Total number of holes played so far                                                    | integer |
| Sand Saves                  | Total number of holes where the “Greenside Bunker” has been found and the number of putts is 1 or 0.                                                                         | integer             | Total number of holes where the Greenside Bunker has been found.                       | integer |
| Scrambles                   | Total number of holes where the Green in Regulation is false but Score to Par 0 or -1.                                                                                       | integer             | Total number of holes where the Green in Regulation is false                           | integer |
| Total Putts                 | Total number of strokes where the previous lie was “Green”.                                                                                                                  | integer             | Total number of Holes Played                                                           | integer |
| Putts per GIR               | Total number of strokes where the previous lie was “Green”. Only on holes where Green in Regulation was also made.                                                           | integer             | Total number of Greens in Regulation                                                   | integer |
| Putts Holed Distance        | Total distance of strokes that are defined as a Putt where the final lie was the Hole. Provide this value in “Meters”, with one decimal place.                               | float               | Total number of Holes Played                                                           | integer |
| holeOuts                    | Total sum of any time a ball is holed where the previous surfaceType does NOT equal Green.                                                                                   | integer             | Total number of holes Played                                                           | integer |
| threePutts                  | Total count of 3 or more putts on a hole.                                                                                                                                    | integer             | Total number of holes Played                                                           | integer |
| penaltyShots                | Total sum of Penalty shots in a round.                                                                                                                                       | integer             | Total number of holes Played                                                           | integer |
| teeToGreenStrokesGained     | Sum of Stroke Gained value for teeToGreen.                                                                                                                                   | float               | Total number of strokes considered to be teeToGreen.                                   | integer |
| offTheTeeStrokesGained      | Sum of Stroke Gained value for offTheTee.                                                                                                                                    | float               | Total number of strokes considered to be offTheTee.                                    | integer |
| approachStrokesGained       | Sum of Stroke Gained value for approach.                                                                                                                                     | float               | Total number of strokes considered to be approach.                                     | integer |
| greensUnderRegulation       | Total number of Greens Under Regulation. Defined as reaching the green in one on a par 4 (off the tee) or Reaching the green in two on a par 5.                              | integer             | Total number of holes Played                                                           | integer |
| 20-30ft                     | Total number of Birdie or Better Chances Inside 20 - 30 ft                                                                                                                   | integer             | Total number of holes Played                                                           | integer |
| 30ft+                       | Total number of Birdie or Better Chances inside 30 ft+                                                                                                                       | integer             | Total number of holes Played                                                           | integer |
| 10-20ft                     | Total number of Birdie or Better Chances Inside 10 - 20 ft                                                                                                                   | integer             | Total number of holes Played                                                           | integer |
| puttingStrokesGained        | Sum of Stroke Gained value for putting                                                                                                                                       | float               | Total number of strokes considered to be putting.                                      | integer |
| sand                        | Total number of times the ball has ended up in the sand                                                                                                                      | integer             | Total number of holes Played                                                           | integer |
| aroundTheGreenStrokesGained | Sum of Stroke Gained value for aroundTheGreen.                                                                                                                               | float               | Total number of strokes considered to be aroundTheGreen.                               | integer |
| fringe                      | Total number of times the ball has ended up on the fringe.                                                                                                                   | integer             | Total number of holes Played                                                           | integer |
| scrambleFromSand            | Total number of scrambling success (inside 40 yards) where the surface type is either fairway bunker or greenside bunker.                                                    | integer             | Total number of scrambling opportunity from either fairway bunker or greenside bunker. | integer |
| rough                       | Total number of times the ball has ended up in the rough.                                                                                                                    | integer             | Total number of holes Played                                                           | integer |
| fairway                     | Total number of times the ball has ended up on the fairway                                                                                                                   | integer             | Total number of holes Played                                                           | integer |
| scrambleFromFairwayFringe   | Total number of scrambling success (inside 40 yards) where the surface type is either fairway or fringe.                                                                     | integer             | Total number of scrambling opportunity from either fairway or fringe.                  | integer |
| shortGame - other           | <p>Total number of times the ball has ended up in an area other then - Fairway and fringe (greenside bunker and fairway bunker)<br>IMrough and primRough</p>                 | integer             | Total number of holes Played                                                           | integer |
| scrambleFromRoughHazard     | Total number of scrambling success (inside 40 yards) where the surface type is either rough or other.                                                                        | integer             | Total number of scrambling opportunity from either rough or other.                     | integer |

**Sample json output (Putting)**

````
```json
[
    {
        "fieldsAverage": {
            "longestHoledPutt": {
                "rounds": [
                    {
                        "average": 0.007,
                        "round": 1
                    },
                    {
                        "average": 0.008,
                        "round": 2
                    },
                    {
                        "average": 0.02,
                        "round": 3
                    },
                    {
                        "average": 0.017,
                        "round": 4
                    }
                ],
                "total": 0.003
            },
            "puttingStrokesGained": {
                "rounds": [
                    {
                        "average": 0.001,
                        "round": 1
                    },
                    {
                        "average": 0.001,
                        "round": 2
                    },
                    {
                        "average": 0.0,
                        "round": 3
                    },
                    {
                        "average": 0.001,
                        "round": 4
                    }
                ],
                "total": 0.001
            },
            "puttsHoledDistance": {
                "rounds": [
                    {
                        "average": 1.196,
                        "round": 1
                    },
                    {
                        "average": 1.263,
                        "round": 2
                    },
                    {
                        "average": 1.285,
                        "round": 3
                    },
                    {
                        "average": 1.354,
                        "round": 4
                    }
                ],
                "total": 1.26
            },
            "puttsPerGIR": {
                "rounds": [
                    {
                        "average": 1.75,
                        "round": 1
                    },
                    {
                        "average": 1.764,
                        "round": 2
                    },
                    {
                        "average": 1.701,
                        "round": 3
                    },
                    {
                        "average": 1.704,
                        "round": 4
                    }
                ],
                "total": 1.739
            },
            "threePutts": {
                "rounds": [
                    {
                        "average": 0.024,
                        "round": 1
                    },
                    {
                        "average": 0.032,
                        "round": 2
                    },
                    {
                        "average": 0.022,
                        "round": 3
                    },
                    {
                        "average": 0.024,
                        "round": 4
                    }
                ],
                "total": 0.027
            },
            "totalPutts": {
                "rounds": [
                    {
                        "average": 1.574,
                        "round": 1
                    },
                    {
                        "average": 1.557,
                        "round": 2
                    },
                    {
                        "average": 1.532,
                        "round": 3
                    },
                    {
                        "average": 1.603,
                        "round": 4
                    }
                ],
                "total": 1.613
            }
        },
        "rankings": [
            {
                "players": [
                    {
                        "country": "ENG",
                        "displayName": "Matt Wallace",
                        "firstName": "Matt",
                        "gender": "male",
                        "id": 3,
                        "isAmateur": false,
                        "lastName": "Wallace"
                    }
                ],
                "putting": {
                    "longestHoledPutt": {
                        "rounds": [
                            {
                                "divisor": 1,
                                "rank": 71,
                                "round": 1,
                                "total": 4.92
                            },
                            {
                                "divisor": 1,
                                "rank": 111,
                                "round": 2,
                                "total": 3.61
                            }
                        ],
                        "total": {
                            "divisor": 1,
                            "rank": 127,
                            "total": 4.92
                        }
                    },
                    "puttingStrokesGained": {
                        "rounds": [
                            {
                                "divisor": 29,
                                "rank": 33,
                                "round": 1,
                                "total": 1.137
                            },
                            {
                                "divisor": 29,
                                "rank": 81,
                                "round": 2,
                                "total": -0.246
                            }
                        ],
                        "total": {
                            "divisor": 58,
                            "rank": 51,
                            "total": 0.89
                        }
                    },
                    "puttsHoledDistance": {
                        "rounds": [
                            {
                                "divisor": 18,
                                "rank": 37,
                                "round": 1,
                                "total": 24.892
                            },
                            {
                                "divisor": 18,
                                "rank": 112,
                                "round": 2,
                                "total": 16.992
                            }
                        ],
                        "total": {
                            "divisor": 36,
                            "rank": 109,
                            "total": 41.884
                        }
                    },
                    "puttsPerGIR": {
                        "rounds": [
                            {
                                "divisor": 11,
                                "rank": 48,
                                "round": 1,
                                "total": 19.0
                            },
                            {
                                "divisor": 10,
                                "rank": 17,
                                "round": 2,
                                "total": 17.0
                            }
                        ],
                        "total": {
                            "divisor": 21,
                            "rank": 20,
                            "total": 36.0
                        }
                    },
                    "threePutts": {
                        "rounds": [
                            {
                                "divisor": 18,
                                "rank": 93,
                                "round": 1,
                                "total": 1.0
                            },
                            {
                                "divisor": 18,
                                "rank": 80,
                                "round": 2,
                                "total": 1.0
                            }
                        ],
                        "total": {
                            "divisor": 36,
                            "rank": 86,
                            "total": 2.0
                        }
                    },
                    "totalPutts": {
                        "rounds": [
                            {
                                "divisor": 18,
                                "rank": 66,
                                "round": 1,
                                "total": 29.0
                            },
                            {
                                "divisor": 18,
                                "rank": 59,
                                "round": 2,
                                "total": 29.0
                            }
                        ],
                        "total": {
                            "divisor": 36,
                            "rank": 30,
                            "total": 58.0
                        }
                    }
                },
                "teamId": 133
            },
            {
                "players": [
                    {
                        "country": "BEL",
                        "displayName": "Thomas Detry",
                        "firstName": "Thomas",
                        "gender": "male",
                        "id": 4,
                        "isAmateur": false,
                        "lastName": "Detry"
                    }
                ],
                "putting": {
                    "longestHoledPutt": {
                        "rounds": [
                            {
                                "divisor": 1,
                                "rank": 49,
                                "round": 1,
                                "total": 6.19
                            },
                            {
                                "divisor": 1,
                                "rank": 33,
                                "round": 2,
                                "total": 7.58
                            },
                            {
                                "divisor": 1,
                                "rank": 31,
                                "round": 3,
                                "total": 5.67
                            },
                            {
                                "divisor": 1,
                                "rank": 22,
                                "round": 4,
                                "total": 8.17
                            }
                        ],
                        "total": {
                            "divisor": 1,
                            "rank": 66,
                            "total": 8.17
                        }
                    },
                    "puttingStrokesGained": {
                        "rounds": [
                            {
                                "divisor": 27,
                                "rank": 42,
                                "round": 1,
                                "total": 0.82
                            },
                            {
                                "divisor": 28,
                                "rank": 18,
                                "round": 2,
                                "total": 1.841
                            },
                            {
                                "divisor": 27,
                                "rank": 38,
                                "round": 3,
                                "total": 0.261
                            },
                            {
                                "divisor": 25,
                                "rank": 3,
                                "round": 4,
                                "total": 2.46
                            }
                        ],
                        "total": {
                            "divisor": 107,
                            "rank": 9,
                            "total": 5.38
                        }
                    },
                    "puttsHoledDistance": {
                        "rounds": [
                            {
                                "divisor": 18,
                                "rank": 63,
                                "round": 1,
                                "total": 22.097
                            },
                            {
                                "divisor": 18,
                                "rank": 23,
                                "round": 2,
                                "total": 29.44
                            },
                            {
                                "divisor": 18,
                                "rank": 34,
                                "round": 3,
                                "total": 21.614
                            },
                            {
                                "divisor": 18,
                                "rank": 15,
                                "round": 4,
                                "total": 28.805
                            }
                        ],
                        "total": {
                            "divisor": 72,
                            "rank": 17,
                            "total": 101.956
                        }
                    },
                    "puttsPerGIR": {
                        "rounds": [
                            {
                                "divisor": 10,
                                "rank": 27,
                                "round": 1,
                                "total": 17.0
                            },
                            {
                                "divisor": 12,
                                "rank": 79,
                                "round": 2,
                                "total": 21.0
                            },
                            {
                                "divisor": 10,
                                "rank": 12,
                                "round": 3,
                                "total": 17.0
                            },
                            {
                                "divisor": 11,
                                "rank": 12,
                                "round": 4,
                                "total": 16.0
                            }
                        ],
                        "total": {
                            "divisor": 43,
                            "rank": 76,
                            "total": 71.0
                        }
                    },
                    "threePutts": {
                        "rounds": [
                            {
                                "divisor": 18,
                                "rank": 1,
                                "round": 1,
                                "total": 0.0
                            },
                            {
                                "divisor": 18,
                                "rank": 1,
                                "round": 2,
                                "total": 0.0
                            },
                            {
                                "divisor": 18,
                                "rank": 1,
                                "round": 3,
                                "total": 0.0
                            },
                            {
                                "divisor": 18,
                                "rank": 1,
                                "round": 4,
                                "total": 0.0
                            }
                        ],
                        "total": {
                            "divisor": 72,
                            "rank": 1,
                            "total": 0.0
                        }
                    },
                    "totalPutts": {
                        "rounds": [
                            {
                                "divisor": 18,
                                "rank": 20,
                                "round": 1,
                                "total": 27.0
                            },
                            {
                                "divisor": 18,
                                "rank": 38,
                                "round": 2,
                                "total": 28.0
                            },
                            {
                                "divisor": 18,
                                "rank": 20,
                                "round": 3,
                                "total": 27.0
                            },
                            {
                                "divisor": 18,
                                "rank": 7,
                                "round": 4,
                                "total": 25.0
                            }
                        ],
                        "total": {
                            "divisor": 72,
                            "rank": 77,
                            "total": 107.0
                        }
                    }
                },
                "teamId": 108
            },
```
````
