Skip to main content
GET
/
buoys
/
nearest
Find nearest buoy to coordinates
curl --request GET \
  --url https://thesurfkit.com/api/v2/buoys/nearest \
  --header 'Authorization: Bearer <token>'
{
  "status": "success",
  "data": {
    "buoy": {
      "id": 10,
      "name": "Anglet",
      "lat": 43.4832,
      "lng": -1.5586,
      "source": "Candhis",
      "source_identifier": "64002",
      "distance_km": 2.5
    }
  },
  "meta": {
    "timestamp": "2025-11-01T10:00:00Z"
  }
}

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token in the Authorization header.

Format: Authorization: Bearer YOUR_API_KEY

Alternative: Pass as query parameter ?api_key=YOUR_API_KEY

Security: API keys are stored as BCrypt hashes (never plain text). Only the hash is stored in the database.

Query Parameters

lat
number<float>
required

Latitude in decimal degrees (-90 to 90)

Required range: -90 <= x <= 90
lng
number<float>
required

Longitude in decimal degrees (-180 to 180)

Required range: -180 <= x <= 180
max_distance
number<float>
default:150

Maximum search radius in kilometers (default: 150)

Required range: x >= 0
limit
integer
default:1

Maximum number of results to return (default: 1, max: 20)

Required range: 1 <= x <= 20

Response

Successful response with nearest buoy(s)

Response when limit=1 (single buoy)

status
string
Example:

"success"

data
object