API Documentation
Access your Short Game Wizard data programmatically. All endpoints return JSON.
Authentication
All API requests require authentication via a Bearer token. Generate tokens from your Settings page.
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://shortgamewizard.com/api/v1/rounds
Alternatively, pass the token as a query parameter:
curl https://shortgamewizard.com/api/v1/rounds?token=YOUR_TOKEN
Pagination
List endpoints support pagination via
limit
and
offset
parameters.
| Parameter | Default | Max | Description |
|---|---|---|---|
limit
|
25 | 100 | Number of records to return |
offset
|
0 | — | Number of records to skip |
Paginated responses include a meta object:
{
"rounds": [...],
"meta": {
"total": 47,
"limit": 25,
"offset": 0
}
}
Endpoints
Rounds
GET
/api/v1/rounds
List all your rounds, ordered by date (newest first).
Response
{
"rounds": [
{
"id": "rnd_abc123",
"course_name": "Pebble Beach",
"played_at": "2024-03-15",
"finished_at": "2024-03-15T18:30:00Z",
"stats": {
"holes_played": 18,
"putts": 32,
"chips": 8,
"bunkers": 3
}
}
],
"meta": { "total": 47, "limit": 25, "offset": 0 }
}
GET
/api/v1/rounds/:id
Get a single round with full hole and shot details.
Response
{
"round": {
"id": "rnd_abc123",
"course_name": "Pebble Beach",
"played_at": "2024-03-15",
"finished_at": "2024-03-15T18:30:00Z",
"notes": "Wind was brutal on the back nine",
"stats": { ... },
"holes": [
{
"number": 1,
"par": 4,
"score": 5,
"shots": [
{
"id": "sht_xyz789",
"type": "chip",
"position": 1,
"distance": 360,
"distance_display": "10 yards",
"slope": "level",
"holed": false,
"result_distance": 48,
"result_display": "4 feet",
"miss_depth": "good",
"miss_direction": "left",
"club": "pw",
"lie": "fairway"
},
{
"id": "sht_def456",
"type": "putt",
"position": 2,
"distance": 48,
"distance_display": "4 feet",
"slope": "level",
"holed": true,
"break_direction": "slight_left"
}
]
}
]
}
}
Shots
GET
/api/v1/shots
Query shots across all rounds. Useful for analysis.
Query Parameters
| Parameter | Description | Example |
|---|---|---|
type
|
Filter by shot type |
putt
,
chip
,
bunker
|
holed
|
Filter by result |
true
or
false
|
round_id
|
Filter by round |
rnd_abc123
|
from
|
Rounds played on or after date |
2024-01-01
|
to
|
Rounds played on or before date |
2024-12-31
|
Example
GET /api/v1/shots?type=putt&holed=false&from=2024-01-01
Response
{
"shots": [
{
"id": "sht_abc123",
"type": "putt",
"position": 1,
"distance": 72,
"distance_display": "6 feet",
"slope": "uphill",
"holed": false,
"result_distance": 24,
"result_display": "2 feet",
"miss_depth": "short",
"miss_direction": "left",
"break_direction": "slight_left",
"round_id": "rnd_xyz789",
"hole_number": 7,
"course_name": "Pebble Beach",
"played_at": "2024-03-15"
}
],
"meta": { "total": 156, "limit": 25, "offset": 0 }
}
Schema Reference
Distances are stored in inches. Use the conversion constants below. The schema endpoint returns this data as JSON.
Units
| Constant | Value |
|---|---|
| Inches per foot | 12 |
| Inches per yard | 36 |
Enumerations
Slope
steep_downhill
downhill
level
uphill
steep_uphill
Miss Depth
good
short
long
Miss Direction
center
left
right
Break Direction
strong_left
slight_left
straight
slight_right
strong_right
Club
lw
sw
gw
pw
nine_iron
eight_iron
seven_iron
six_iron
five_iron
four_iron
hybrid
wood
Lie
fairway
rough
fringe
Bunker Lie
clean
fried_egg
plugged
firm
Lip
low
medium
high
Error Handling
| Status | Meaning | Response |
|---|---|---|
401
|
Unauthorized |
{ "error": "Unauthorized" }
|
404
|
Not Found |
{ "error": "Not found" }
|