Distance to the flag
distance_to_flagHow far the golfer is from the flag, from where they are standing: 'how far is that flag', 'what's the yardage'. Returns the course, the hole, its par and stroke index, and yards to the flag (today's pin as the club set it) and to the middle of the green. Pass lat and lng only if your device gives you the golfer's GPS position; otherwise call it with no arguments, and GolfCore reads the golfer's position from the GolfCore app on their phone. It is part of GolfCore Premium: the golfer signs in to GolfCore the first time, and without Premium the result lists the plans for subscribe_premium. position_age_s says how old that position is. When hole_inferred is true the hole was chosen from the position, so say which hole you assumed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat | No | Optional. The golfer's precise latitude, only when your device gives you their GPS position. Never ask the golfer for coordinates: leave lat and lng out and GolfCore uses the position from the GolfCore app on their phone. | |
| lng | No | Optional. The golfer's precise longitude, with lat. | |
| hole | No | Optional. The hole number the golfer says they are on. Otherwise the hole is chosen from the position. | |
| course | No | Optional. The course slug, when known. Otherwise the course is found from the position. | |
| accuracy_m | No | Optional. The location's horizontal accuracy in meters, when the device reports it. |