Skip to main content
GET
/
buoys
/
{buoy_id}
/
readings
/
search
Search for reading closest to a specific time
curl --request GET \
  --url https://thesurfkit.com/api/v2/buoys/{buoy_id}/readings/search \
  --header 'Authorization: Bearer <token>'
{
  "status": "success",
  "data": {
    "closest_reading": {
      "id": 123,
      "uuid": "<string>",
      "significient_height": 123,
      "maximum_height": 123,
      "period": 123,
      "time": "2023-11-07T05:31:56Z",
      "water_temperature": 123,
      "direction": 123,
      "direction_compass": "<string>",
      "unit": "<string>",
      "energy_per_wave": 123,
      "time_diff_minutes": 123
    },
    "search_parameters": {
      "target_datetime": "2023-11-07T05:31:56Z",
      "tolerance_hours": 123,
      "search_range": {
        "start": "2023-11-07T05:31:56Z",
        "end": "2023-11-07T05:31:56Z"
      }
    }
  }
}

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.

Path Parameters

buoy_id
integer
required

Query Parameters

date
string<date>
required

Target date (YYYY-MM-DD)

time
string
required

Target time (HH:MM)

Pattern: ^[0-9]{2}:[0-9]{2}$
tolerance_hours
integer
default:3

Hours to search around target time (default: 3, max: 24)

Required range: 1 <= x <= 24

Response

Successful response

status
string
Example:

"success"

data
object