API Documentation

Access golf course data programmatically using our REST API.

Authentication

All API requests require an API key. Include your key in the request header:

X-API-Key: tr_your_api_key_here

Or as a query parameter: ?api_key=tr_your_api_key_here

Create an account to get your free API key.

Rate Limits

Request limits reset at midnight UTC.

Free

100/day

Starter

1,000/day
$19/mo

Pro

10,000/day
$49/mo

Enterprise

Unlimited
Contact us

Endpoints

GET /api/v1/courses.php

Search and filter golf courses.

ParameterTypeDescription
qstringSearch query (name, city, country)
countrystringFilter by country
statestringFilter by state/region
min_holesintegerMinimum number of holes
min_ratingfloatMinimum rating (1-5)
min_lengthintegerMinimum yardage
max_lengthintegerMaximum yardage
has_reviewsbooleanOnly courses with reviews
limitintegerResults per page (max 100, default 50)
offsetintegerSkip first N results
Example Request:
curl -H "X-API-Key: YOUR_KEY" \
  "http://teeradar.online/api/v1/courses.php?country=United%20States&min_rating=4&limit=10"
Response:
{
  "total": 1523,
  "limit": 10,
  "offset": 0,
  "count": 10,
  "courses": [
    {
      "course_id": "pebble-beach-golf-links",
      "name": "Pebble Beach Golf Links",
      "city": "Pebble Beach",
      "state": "California",
      "country": "United States",
      "rating": 4.8,
      "ratings_count": 2341,
      "holes": 18,
      "length_yards": 6828,
      "description": "...",
      "primary_image": "/media/courses/abc123.jpg"
    },
    ...
  ]
}

GET /api/v1/course.php

Get detailed information for a single course.

ParameterTypeDescription
idstringCourse ID (required)
Example:
curl -H "X-API-Key: YOUR_KEY" \
  "http://teeradar.online/api/v1/course.php?id=pebble-beach-golf-links"

GET /api/v1/countries.php

List all countries with course counts.

Response:
{
  "count": 45,
  "countries": [
    {"country": "United States", "count": 3200},
    {"country": "United Kingdom", "count": 520},
    ...
  ]
}

GET /api/v1/states.php

List states/regions for a country with course counts.

ParameterTypeDescription
countrystringCountry name (required)

GET /api/v1/leaderboard.php

Get ranked course lists.

ParameterTypeDescription
typestringtop_rated, most_reviewed, or longest
limitintegerNumber of results (max 100)
min_reviewsintegerFor top_rated: minimum review count

Error Handling

The API returns standard HTTP status codes:

CodeMeaning
200Success
400Bad request (missing/invalid parameters)
401Unauthorized (invalid API key)
404Not found
429Rate limit exceeded
500Server error
Error Response Format:
{
  "error": "Rate limit exceeded.",
  "daily_limit": 100,
  "daily_used": 100,
  "reset": "midnight UTC"
}

Ready to get started?

Get Your Free API Key

Questions? Contact us