Skip to main content

Stats

Computed, read-only operational numbers for a site: today's arrivals, departures and occupancy, and booking revenue over a period. Nothing here mutates data, so it is safe to poll — voice assistants ("what's my dashboard?", "what's my revenue this month?"), wall panels, and uptime monitors all hit these endpoints every minute if they like.

Endpoints​

MethodPathDescription
GET/v1/statsToday's operational snapshot
GET/v1/stats/revenueBooking revenue for a period

Today's snapshot​

curl -s $API/v1/stats -H "Authorization: Bearer $KEY"
{
"object": "stats",
"date": 1793107200,
"arrivals_today": 3,
"departures_today": 2,
"current_occupancy": 41,
"total_pitches": 58,
"occupancy_rate": 71
}
  • date — the UTC day the stats describe (unix seconds, midnight).
  • arrivals_today / departures_today — non-cancelled bookings arriving / departing on that UTC day.
  • current_occupancy — non-cancelled bookings on site: arrived on or before today and not yet departed.
  • total_pitches — bookable inventory for the day, summed from the rate sheet (maxAllocation).
  • occupancy_rate — whole-number percentage, rounded.

Revenue​

curl -s "$API/v1/stats/revenue?from=2026-03-01&to=2026-04-01" \
-H "Authorization: Bearer $KEY"
{
"object": "revenue_stats",
"from": 1772323200,
"to": 1793107200,
"booking_count": 37,
"revenue": { "amount": 4567890, "currency": "gbp" }
}
  • Both bounds are optional and default to the current calendar month (UTC).
  • Revenue is attributed by arrival date: a booking counts towards the period it starts in. Cancelled bookings are excluded.
  • revenue.amount sums the accommodation cost in minor units (pence), consistent with every other money field in the API.
  • to must be after from; the interval is half-open: [from, to).