get_class_occupancy
Check how full group classes were between two dates, per slot and overall, to identify peak hours and attendance trends.
Instructions
How full group classes were between two dates, per slot and in aggregate.
Use this for questions about attendance, busy or quiet times, peak hours, or how a class type is performing. Returns:
totals: slots, capacity, check-ins, and occupancy_pct over the whole range;
by_class: the same per class type;
by_weekday_hour: the same per (weekday, start hour), sorted busiest first, so the first rows are the peak times;
slots: each class slot chronologically (start time in local gym time, coach, capacity, check-ins), capped at 200 rows;
truncatedis true if cut. occupancy_pct = check-ins / capacity * 100, rounded to one decimal.
Dates are inclusive, YYYY-MM-DD, at most 366 days apart. Classes run Monday-Saturday. Valid class_name values: HIIT, Spin, Yoga, Pilates, Boxing, Strength.
If no class slots match, the result also has available_range
({"from": ..., "to": ...}): the first and last dates that have any class slots.
Retry with dates inside it rather than concluding there were no classes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_date | Yes | Last day to include, YYYY-MM-DD (inclusive). Must be >= start_date. | |
| class_name | No | Only include this class type. Omit for all classes. | |
| start_date | Yes | First day to include, YYYY-MM-DD (inclusive). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slots | Yes | Chronological; capped at 200. | |
| by_class | Yes | ||
| end_date | Yes | ||
| truncated | Yes | True if `slots` was cut at 200 rows. | |
| class_name | Yes | ||
| start_date | Yes | ||
| total_slots | Yes | ||
| occupancy_pct | Yes | ||
| total_capacity | Yes | ||
| total_checkins | Yes | ||
| available_range | No | Present only when no class slots fall in the requested range: the first and last dates that have class slots. Retry with dates inside it. | |
| by_weekday_hour | Yes | Sorted busiest first (highest occupancy_pct). |