1. Send your first request
Ask for five golf clubs in Arizona:GET /api/v1/clubs is the one endpoint. Every filter is an optional query parameter. A request with no filters returns the first page of the whole directory, sorted by club name.
2. Read the response
The body has three keys:clubs, total and fee_access. Here is the response to the request above, trimmed to its first club and a few fields, with description left out:
totalcounts every club that matches your filters, across all pages. TheX-Total-Clubsheader carries the same number. Your total will differ as listings change.fee_accessislockedfor calls without a theprivateclubs.com session, which is every call from your server or script. The fee fieldsinitiation_fee,annual_duesandmonthly_duesare then alwaysnull.- Each entry in
fee_viewshas akind. You will seenonewhen no figure is on file, orlockedwhen a figure exists but is not shared. See Authentication and fees. - Rows carry no profile link.
- Successful responses carry
Cache-Control: private, no-store.
3. Narrow by place and type
Filters combine, so each club returned matches all of them.
With no
country, the search covers every country. A state with no country stays in the US and Canada. For a region elsewhere, such as Scotland, send country as well:
4. Page through results
page starts at 1. limit sets the page size. It defaults to 50, and values above 200 are clamped to 200.
Stop when page * limit reaches total. A page past the last one returns a 500 clubs_unavailable error, not an empty list, so check total before you ask for the next page.
This loop prints the name and city of every golf club in Arizona. It needs jq:
5. Handle errors
Errors come back asapplication/problem+json. Each body has type, title, status, detail, code, hint and instance. Branch on code, which stays stable.
Send a limit that is not a number:
clubs_unavailable means the directory could not be read. Wait a moment and retry, unless you asked for a page past the last one. The API overview lists every code.
Next steps
API overview
The spec, base URL, error codes and versioning.
Authentication and fees
Why calls need no key, and what the fee fields hold.
Club object
Every field in a club record.
Club types
The 15 types and how the API groups them.