---
title: "Weekly attendance in a spreadsheet"
description: "Once a week, call GET /v1/insights/offices for the last 7 days and add the daily counts to a spreadsheet."
url: https://help.officelycrew.com/developers/weekly-attendance
product: developers
product_name: Developers
type: guide
platforms: [slack, teams]
private_beta: "The Officely Crew API is in private beta. Want in? [Contact support](/account/contact-support) to ask to join, and we'll turn on API tokens for your workspace. Once it's on, Account Admins see the API token setting under **Account & Billing**."
audience: [developer]
updated: 2026-11-30
verified: 2026-11-30
related:
  - https://help.officelycrew.com/developers/v1-insights-offices
  - https://help.officelycrew.com/developers/csv-exports
  - https://help.officelycrew.com/developers/filters-and-dates
---
# Weekly attendance in a spreadsheet

> **Private beta.** The Officely Crew API is in private beta. Want in? [Contact support](https://help.officelycrew.com/account/contact-support) to ask to join, and we'll turn on API tokens for your workspace. Once it's on, Account Admins see the API token setting under **Account & Billing**.

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

## Get the week

```sh
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.

## What comes back

`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`:

```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 }
  ]
}
```

## Turn it into rows

With [jq](https://jqlang.org), append the days to a CSV that a spreadsheet can import:

```sh
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:

```csv
"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](https://help.officelycrew.com/developers/csv-exports) gives names, offices and check-ins: `/v1/insights/work-statuses?from=…&to=…&types=office&format=csv`.
