Docs

Handling responses

Read errors, track usage, cache documents and retry failed requests.

Read an error

Errors contain an error object with type, message, status and request_id. An invalid parameter can also be named in param. The Golfapi-Request-Id header identifies the same request.

StatusAction
400Correct the named parameter, value or version.
401Check the API key and whether it has been revoked. "Empty bearer token" means the request carried no key: set GOLFDEV_API_KEY in the terminal that sends it, as Authentication describes.
403Check account access and the resource or view entitlement.
404Check the identifier and published catalog scope.
429 rate_limitedWait for Retry-After before retrying.
429 quota_exceededStop requests until quota is available.
500 or 503Retry within a defined attempt limit; retain the request ID if the failure persists.

Track usage

The per-minute limit applies to each key. The monthly quota applies to the account and includes requests from both test and live keys. There are no automatic overage charges.

Successful catalog requests count. 304 responses and applicable non-limit 4xx errors are refunded. Rate and quota rejections and authenticated server errors can increment counters. Refunds can finish after the response.

Use the dashboard's period dates and count to interpret remaining monthly quota. An upgrade does not reset the counter. If the displayed period has passed without changing, contact support.

Cache a representation

Store the response document and its ETag with the exact request URL, served version and key access context. Send that ETag in If-None-Match for the same representation. On 304, use the cached document; the response has no body.

Keep caches separate across filters, projections, views, test and live data, and keys with different access. A request already over a limit can return 429 before revalidation. Storage and reuse must comply with the data license.

Bound retries

For transient rate-limit or service failures, honor Retry-After and set a maximum attempt count. Use jitter when multiple callers retry together. Correct a 400, 401 or 403 before sending the request again. Stop on monthly quota exhaustion.

Log the status, endpoint, time and request ID. Exclude API keys and Authorization headers from logs. For support, send the endpoint, time, request ID and redacted error through Contact.