Find nearest buoy to coordinates
curl --request GET \
--url https://api.thebuoy.app/v2/buoys/nearest \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.thebuoy.app/v2/buoys/nearest"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thebuoy.app/v2/buoys/nearest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.thebuoy.app/v2/buoys/nearest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.thebuoy.app/v2/buoys/nearest"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.thebuoy.app/v2/buoys/nearest")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.thebuoy.app/v2/buoys/nearest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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"
}
}Buoys
Find nearest buoy to coordinates
Find the closest active buoy(s) to a given latitude and longitude within a maximum distance.
Use the limit parameter to control how many results are returned (default: 1, max: 20).
GET
/
buoys
/
nearest
Find nearest buoy to coordinates
curl --request GET \
--url https://api.thebuoy.app/v2/buoys/nearest \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.thebuoy.app/v2/buoys/nearest"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.thebuoy.app/v2/buoys/nearest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.thebuoy.app/v2/buoys/nearest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.thebuoy.app/v2/buoys/nearest"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.thebuoy.app/v2/buoys/nearest")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.thebuoy.app/v2/buoys/nearest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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
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
Latitude in decimal degrees (-90 to 90)
Required range:
-90 <= x <= 90Longitude in decimal degrees (-180 to 180)
Required range:
-180 <= x <= 180Maximum search radius in kilometers (default: 150)
Required range:
x >= 0Maximum number of results to return (default: 1, max: 20)
Required range:
1 <= x <= 20