GET

/courses/:id/holes

PRO

Retrieve detailed GPS coordinates for each hole on a course.

Requires Pro or Enterprise plan.

GPS Hole Data is a Pro Feature

Upgrade to Pro ($29/mo) or Enterprise ($99/mo) to access GPS coordinates for every hole.

View pricing →

Path Parameters

ParameterTypeDescription
idintegerThe course_id from the list courses response

Example Request

bash
curl "https://golfly.dev/api/v1/courses/19271/holes" \
  -H "x-api-key: gf_your_api_key"

Response

json
{
  "data": {
    "course_id": 19271,
    "hole_count": 18,
    "holes": [
      {
        "hole_number": 1,
        "par": 5,
        "length_yards": 451,
        "coordinates": {
          "tee": { "lat": 32.3347889, "lng": -86.3283939 },
          "green": {
            "front": { "lat": 32.3327640, "lng": -86.3316233 },
            "center": { "lat": 32.3326751, "lng": -86.3316760 },
            "back": { "lat": 32.3325829, "lng": -86.3317355 }
          },
          "fairway": { "lat": 32.3339946, "lng": -86.3308427 },
          "dogleg": { "lat": 32.3337874, "lng": -86.3311825 },
          "layup": { "lat": 32.3341234, "lng": -86.3299876 }
        },
        "hazards": [
          {
            "type": "bunker",
            "label": "Front Bunker",
            "lat": 32.3338,
            "lng": -86.3305
          },
          {
            "type": "water",
            "label": "Left Water",
            "lat": 32.3336,
            "lng": -86.3308
          }
        ]
      }
    ]
  }
}

Response Fields

Hole Object

FieldTypeDescription
hole_numberintegerHole number (1-18)
parintegerHole par
length_yardsintegerHole length in yards
coordinatesobjectGPS coordinates object
hazardsarrayArray of hazard objects

Coordinates Object

FieldTypeDescription
teeobjectTee box coordinates {lat, lng}
green.frontobjectFront of green coordinates
green.centerobjectCenter of green coordinates
green.backobjectBack of green coordinates
fairwayobjectFairway target (optional)
doglegobjectDogleg point (optional)
layupobjectLayup target for positioning (optional)

Hazard Object

FieldTypeDescription
typestring"bunker" or "water"
labelstringDescriptive name
latnumberLatitude
lngnumberLongitude

Errors

403upgrade_required

Your plan doesn't include GPS hole data. Upgrade to Pro or Enterprise.

404course_not_found

The specified course ID does not exist.

Related