Find a club or pick a country
Type part of its name below. Searching is free.
Account
Pick one to start. The other one stays on your dashboard.
Type part of its name below. Searching is free.
Either way you have a working API key in about a minute, and you can switch at any time.
Free trial · no card
There is one free trial per person or organisation, and one has already been used for this address, its domain or this network. Lists and search still work with a key; course data comes with a plan. If this is wrong, write to hello@golfdata.io.
Pick the size that fits. Only fetching a course counts; listing and searching is free on every plan.
You pay in Stripe's checkout. Prices exclude VAT. Change or cancel on your account page.
The key works on every endpoint. On the trial it has 10 course requests in all, for any country; lists and search are free. Without a plan it lists and searches; course data comes with a plan.
You already have a key. A key is shown only once, so use the one you saved, or create a new one.
Creating your key…
Copy it now. We keep only a fingerprint, so it cannot be shown again.
GOLFDATA_KEY Keep the key out of your code. Set it where your server code runs, never in code that runs in a browser or an app, where anyone can read it.
Using a .env file? Add .env to .gitignore so the key never ends up in git. On a hosted app, put it in the host's environment variables.
Fetch a whole course: holes, tees and ratings. It counts as one course request.
curl "https://api.golfdata.io/v1/courses/fr-golf-du-sporting-club-de-vichy-vichy-18?units=yards" \
-H "Authorization: Bearer $GOLFDATA_KEY"This course also has GPS positions for its greens. They come from a call of their own, which counts as one more course request:
Give Claude, ChatGPT or Cursor a briefing that teaches it the API: endpoints, fields, quota and how to keep your key safe. Save it in your project's AGENTS.md or CLAUDE.md so it applies in every chat.
Copied. Paste it into your AI assistant.
0
There is one free trial per person or organisation, and one has already been used for this address, its domain or this network. If this is wrong, write to hello@golfdata.io.
Plans from $25 a month.
UpgradeNew here, or want a refresher?
Your new key. Copy it now: we keep only a fingerprint, so it cannot be shown again.
Try it:
No keys yet. Create one to start calling the API.
Search for a club, open a scorecard and download it as CSV for Excel or Google Sheets. Searching is free; opening a scorecard counts as one course request, and the download that follows is free.
Pick a country to see every course in it; the list is free. Open any scorecard, or download the whole country as one CSV for Excel, one row per tee, which counts one course request per course.
each, from a purchase, with no plan needed. They are used when your plan or trial has run out, and they also pay for whole countries.
A larger plan applies at once and starts a new period with a full quota, with what is left of your current period deducted from its price; a smaller plan or a cancellation applies from the end of the period you have paid for. To change the card your plan is charged to, open Card and receipts and use the pencil next to the card under your plan. Payments, receipts and invoices are handled by Stripe through Link. Prices exclude VAT.
A briefing that teaches Claude, ChatGPT or Cursor the API. Save it in your project's AGENTS.md or CLAUDE.md so your assistant knows it in every chat. Your key is not in it.
This is a briefing on the golfdata.io API: golf course data for clubs, courses, holes, tees, course rating and slope. Use it whenever I work with golfdata.io.
## Basics
- Base URL: https://api.golfdata.io
- Full schema (OpenAPI, no key needed): https://api.golfdata.io/openapi.json. Use it for exact field names and types.
- Every request sends the header `Authorization: Bearer <key>`. Answers are JSON.
## The API key
- The key is read from the environment variable GOLFDATA_KEY. Never hard-code it, log it, print it or commit it. In a .env file, .env belongs in .gitignore.
- Keys are created on https://golfdata.io/account/ and are shown only once.
- GET /v1/usage is free and checks a key: 200 means it works, and `plan` says which plan it has (`trial` is the free trial). 401 means the key is missing or wrong.
- The key belongs on a server. Code that runs in a browser or a mobile app must never hold it; such an app calls its own server endpoint, which calls golfdata.io. That endpoint should allow only the requests and course ids the app needs, cache the answers and limit requests per user or device, so nobody can use up the quota through it.
## Endpoints
- GET /v1/clubs?q=kilmacolm - search clubs by name, town or region (also country= and updated_since=)
- GET /v1/clubs?lat=55.89&lng=-4.61&radius_km=25 - clubs near a point, nearest first
- GET /v1/clubs/{id} - one club and its courses
- GET /v1/courses?country=gb-sct&limit=500 - list courses (also q= to search by name, and updated_since= for courses changed since then: an ISO 8601 date or date-time, UTC when no time zone is given); follow paging.next_cursor by sending it as cursor=
- GET /v1/courses/{id} - one course with holes, tees and ratings; add units=yards for lengths in yards too
- GET /v1/courses/{id}/greens - the position of the middle of each green of a course (lat and lon, WGS 84), where the course has them
- GET /v1/courses/batch?ids=a,b,c - several courses in one request (up to 100 ids)
- GET /v1/export/{country} - a whole country as one JSON file, sent as application/gzip (not as compressed transfer), so your client must unzip it itself
- GET /v1/export/{country}/greens - the green positions of a whole country as one file of the same kind; 404 when the country has none
- GET /v1/changes?since=<data_version> - what was added, changed or removed since the version you hold
- GET /v1/meta - the current data_version; store it and send it to /v1/changes?since= next time
- GET /v1/countries, /v1/releases and /v1/usage
- POST /v1/reports with {"course_id": "...", "field": "...", "message": "..."} - report a value that looks wrong
- A moved id answers 301 with Location set to its new id. Your HTTP client may follow it without telling you, so compare the id in the answer with the one you asked for and store the new id (in a batch, moved[].alias_of). A withdrawn id answers 410: drop it.
## Shapes
- Lists (/v1/clubs, /v1/courses): {data: [...], paging: {total_count, limit, next_cursor}}. A club search hit is {club, distance_km}; distance_km is set only for searches near a point.
- Club: id, name, country, region, location {lat, lon}, address {street, housenumber, postcode, city, region}, website {value}, other_names, and courses.
- Course: one playable layout of 18 or 9 holes. par_men and index_men hold par and stroke index per hole, hole 1 first; par_women and index_women are for women. rating_status is rated (every tee has a rating), partial or unrated (the last two only with include_unrated=true).
- The same nine holes can be both a 9-hole course and a half of an 18-hole course: part_of on the nine names the 18-hole course and half, loops on the 18-hole course and used_in on the nine link them. In a list, show them as related, not as unrelated duplicates.
- Tee: name, color, distances_m per hole and total_m (with units=yards also distances_yd and total_yd). A tee may carry its own par_men, par_women, index_men or index_women.
- Rating, in each tee's ratings: {category: "men" or "women", holes: 18 or 9, course_rating, slope_rating, par_total}. A rating with half "front" or "back" is the nine-hole rating for that half.
- Green positions: {course_id, holes_count, greens_count, greens: [{hole, lat, lon}, ...]}, one entry per hole, hole 1 first. lat and lon are null for a hole without a position, and greens is null when the course has none. greens_count on a course and in course lists tells how many holes have one, so check it before you ask.
- Batch: {courses: [...], moved: [{id, alias_of}], gone: [ids], not_found: [ids]}.
- Changes: {since, data_version, courses: {added, changed, removed}, clubs: {added, changed, removed}}; removed entries are {id, alias_of}, where alias_of is the new id or null when withdrawn.
- Usage: {customer, plan, countries, day, month, daily_quota, monthly_quota, quota_used_today, quota_used_this_month, requests_today, requests_this_month}.
- null: there are only two fallback rules. On a course, par_women or index_women null means use par_men or index_men. On a tee, par_men, par_women, index_men or index_women null means use the course's value. Every other null means unknown: show it as unknown and never fill it in or copy it from another tee.
- Only tees with a rating are returned. Add include_unrated=true to get the rest too, marked with rated: false.
## Errors
Every error is {"error": {"code": "...", "message": "..."}}. Handle them by `code`; the message is for people.
- bad_request (400), unauthorized (401), plan_limit (403: the key's plan does not include it, such as country files, or the free trial is used up), not_found (404), method_not_allowed (405), gone (410), quota_exceeded (429), internal (500), unavailable (503, with Retry-After in seconds).
- quota_exceeded (429) always comes with Retry-After: wait that many seconds before you try again. It is 60 for the per-minute limit on free requests; for a used-up quota (daily or monthly course requests, or reports for the day) it is the time until the quota starts again, which can also be short just before midnight UTC. X-Quota-Remaining 0 on the answer means a quota is used up.
- Treat a code you do not know as a generic error of its HTTP status.
## Quota
- Only course data counts: GET /v1/courses/{id} counts 1, a batch 1 for each course it returns, an export 1 for each course in the file. Green positions count on their own, on top of the course: GET /v1/courses/{id}/greens counts 1 when the course has any (0 when greens_count is 0), and the country's green file 1 for each course in it. Everything else is free, and so is every 304.
- Course requests can also be bought once on the account page. They never expire and pay for a whole request when the plan's or the trial's quota cannot cover it; X-Quota-Remaining includes them.
- Answers carry X-Request-Cost, and X-Quota-Remaining when the key has a quota. A 301 has only Location and X-Request-Id.
- Store what you fetch. Send If-None-Match with the ETag you got to receive 304 when nothing changed, and use /v1/changes to refetch only the courses that changed.
## The free trial
A trial key (plan `trial` in /v1/usage) sees every country but has only 10 course requests in all, and no country files. The 10 do not start again: when they are used up, course requests answer 403 plan_limit, and waiting does not help; a plan or course requests bought once give more. Lists and search are free, so find the right course ids first and spend course requests only on the courses I ask for. Try it with the course gb-sct-new-golf-club-st-andrews-st-andrews-old-course-18 or the club gb-sct-st-andrews-links-trust.
## Tests
Tests should mock the HTTP calls so they never use quota. At most one optional test calls the real API, against the course gb-sct-new-golf-club-st-andrews-st-andrews-old-course-18, and only when GOLFDATA_KEY is set.
If I give you this without a task, check my key with GET /v1/usage, tell me whether it works and which plan it has, and wait for my task.Your keys stop working at once and your email address is removed. This cannot be undone. Read more in the privacy policy.