Skip to content

Weekly attendance in a spreadsheet

Once a week, call GET /v1/insights/offices for the last 7 days and add the daily counts to a spreadsheet.

Terminal window
curl "https://api.officelycrew.com/v1/insights/offices?officeIds=office_london&period=7_days" \
-H "Authorization: Bearer $OFFICELY_API_TOKEN"

period=7_days ends today (UTC). For a fixed week, add referenceDate set to its last day. Leave out officeIds for every office, as long as they share working days.

data.attendance has one row per day, including days with no bookings. The headline figures each compare with the 7 days before.

data.attendance, from the OfficeInsightsExample in openapi.json:

{
"attendance": [
{ "date": "2026-10-09", "bookedCount": 0 },
{ "date": "2026-10-10", "bookedCount": 0 },
{ "date": "2026-10-11", "bookedCount": 0 },
{ "date": "2026-10-12", "bookedCount": 1 },
{ "date": "2026-10-13", "bookedCount": 0 },
{ "date": "2026-10-14", "bookedCount": 0 },
{ "date": "2026-10-15", "bookedCount": 1 }
]
}

With jq, append the days to a CSV that a spreadsheet can import:

Terminal window
curl -s "https://api.officelycrew.com/v1/insights/offices?officeIds=office_london&period=7_days" \
-H "Authorization: Bearer $OFFICELY_API_TOKEN" \
| jq -r '.data.attendance[] | [.date, .bookedCount] | @csv' >> london-attendance.csv

london-attendance.csv then has:

"2026-10-09",0
"2026-10-10",0
"2026-10-11",0
"2026-10-12",1
"2026-10-13",0
"2026-10-14",0
"2026-10-15",1

Want one row per booking instead? The Bookings export gives names, offices and check-ins: /v1/insights/work-statuses?from=…&to=…&types=office&format=csv.

Did this answer your question?

Still need help? Chat to our support team.

Contact support