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_type | Description |
|---|---|
| links | Coastal, open, natural terrain — the classic Scottish/Irish style |
| parkland | Tree-lined fairways, softer terrain — most common in England |
| heathland | Sandy soil, heather, pine trees — Surrey/Berkshire belt |
| moorland | Exposed upland terrain — northern England, Wales |
| clifftop | Dramatic sea cliff settings |
| mixed | Combined 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).
| Parameter | Description |
|---|---|
| has_driving_range | Clubs with a practice driving range |
| has_buggy_hire | Clubs offering electric buggy hire |
| has_club_hire | Clubs with rental club sets |
| has_pro_shop | Clubs with an on-site pro shop |
| has_bar | Clubs with a bar/19th hole |
| has_restaurant | Clubs with a restaurant |
| has_accommodation | Clubs with on-site accommodation |
Example queries
Classic Scottish links under £100
/clubs?course_type=links&country=SCO&max_green_fee=100&sort=rating_descTop-rated English links with a restaurant
/clubs?course_type=links&country=ENG&min_rating=4.2&has_restaurant=trueWelsh links courses with driving range
/clubs?course_type=links&country=WAL&has_driving_range=trueBudget links (under £30) anywhere in the UK
/clubs?course_type=links&max_green_fee=30&sort=green_fee_ascFull 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
- → Combine with postcode search to find links courses near a user
- → Display full club profiles for the results