All tutorials
IntermediateFiltering6 min read

Build a Links Course Finder

Combine course_type with facility and rating filters to help golfers discover links courses that match their preferences.

Course types

course_typeDescription
linksCoastal, open, natural terrain — the classic Scottish/Irish style
parklandTree-lined fairways, softer terrain — most common in England
heathlandSandy soil, heather, pine trees — Surrey/Berkshire belt
moorlandExposed upland terrain — northern England, Wales
clifftopDramatic sea cliff settings
mixedCombined terrain types

Facility filters

Pass true to require a facility, or false to exclude clubs that have it (e.g. has_buggy_hire=false for traditionalist links golfers).

ParameterDescription
has_driving_rangeClubs with a practice driving range
has_buggy_hireClubs offering electric buggy hire
has_club_hireClubs with rental club sets
has_pro_shopClubs with an on-site pro shop
has_barClubs with a bar/19th hole
has_restaurantClubs with a restaurant
has_accommodationClubs with on-site accommodation

Example queries

Classic Scottish links under £100

/clubs?course_type=links&country=SCO&max_green_fee=100&sort=rating_desc

Top-rated English links with a restaurant

/clubs?course_type=links&country=ENG&min_rating=4.2&has_restaurant=true

Welsh links courses with driving range

/clubs?course_type=links&country=WAL&has_driving_range=true

Budget links (under £30) anywhere in the UK

/clubs?course_type=links&max_green_fee=30&sort=green_fee_asc

Full example

JavaScript
async function findLinksCourses({
  country = null,
  region = null,
  maxGreenFee = null,
  requireBuggyFree = false,
  minRating = null,
  limit = 20,
} = {}) {
  const params = new URLSearchParams({
    course_type: 'links',
    limit,
  });

  if (country) params.set('country', country);
  if (region) params.set('region_id', region);
  if (maxGreenFee) params.set('max_green_fee', maxGreenFee);
  if (requireBuggyFree) params.set('has_buggy_hire', 'false');
  if (minRating) params.set('min_rating', minRating);

  const res = await fetch(
    `https://uk-golf-api.vercel.app/clubs?${params}`,
    {
      headers: {
        'X-RapidAPI-Key': process.env.RAPIDAPI_KEY,
        'X-RapidAPI-Host': 'uk-golf-course-data-api.p.rapidapi.com',
      }
    }
  );

  const { data, meta } = await res.json();
  return { clubs: data, total: meta.total };
}

// Coastal links in Scotland, no buggies (traditional), rated 4+ stars
const { clubs, total } = await findLinksCourses({
  country: 'SCO',
  requireBuggyFree: true,
  minRating: 4.0,
});

console.log(`Found ${total} links courses in Scotland`);
clubs.forEach(c => {
  console.log(`  ${c.name}, ${c.county} — ★${c.google_rating}`);
});
Python
import requests

API_KEY = "YOUR_API_KEY"
HEADERS = {
    "X-RapidAPI-Key": API_KEY,
    "X-RapidAPI-Host": "uk-golf-course-data-api.p.rapidapi.com",
}

def find_links_courses(
    country=None,
    max_green_fee=None,
    require_buggy_free=False,
    min_rating=None,
    limit=20,
):
    params = {"course_type": "links", "limit": limit}
    if country:
        params["country"] = country
    if max_green_fee:
        params["max_green_fee"] = max_green_fee
    if require_buggy_free:
        params["has_buggy_hire"] = "false"
    if min_rating:
        params["min_rating"] = min_rating

    res = requests.get(
        "https://uk-golf-api.vercel.app/clubs",
        params=params,
        headers=HEADERS,
    )
    result = res.json()
    return result["data"], result["meta"]["total"]

# Famous links courses in England under £150
clubs, total = find_links_courses(
    country="ENG",
    max_green_fee=150,
    min_rating=4.0,
)
print(f"Found {total} links courses in England under £150")
for c in clubs:
    fee = c.get("min_green_fee", "N/A")
    print(f"  {c['name']}, {c['county']} — from £{fee}, ★{c.get('google_rating','N/A')}")

Next steps