> ## Documentation Index
> Fetch the complete documentation index at: https://docs.technicallyfit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gym traffic

> Read check-ins by day and by hour, and active teammates, for a location or your whole organization, with small groups withheld.

Gym traffic counts the [visit check-ins](https://docs.technicallyfit.com/guides/visit-check-ins.md) at your locations: how many
check-ins each day or hour, and how many teammates came each week. It is aggregate only. It
never names a teammate, and a figure that describes too few people is withheld.

Your key needs `insights:read`. A test key reads test locations and test teammates; a live key
reads live ones. The two never mix.

```bash curl theme={null}
curl "$TF_API_BASE/v1/insights/traffic?location=club-014&from=2026-11-09&to=2026-11-15" \
  -H "X-API-Key: $TF_API_KEY"
```

```typescript TypeScript theme={null}
import { createClient } from '@technicallyfit/sdk';

const tf = createClient({ credential: process.env.TF_API_KEY ?? '', baseUrl: process.env.TF_API_BASE });

const traffic = await tf.GET('/v1/insights/traffic', {
  params: { query: { location: 'club-014', from: '2026-11-09', to: '2026-11-15' } },
});
for (const week of traffic.weeks) console.log(week.from, week.active_teammates.value);
```

```python Python theme={null}
import os

from technicallyfit import Client

tf = Client(os.environ["TF_API_KEY"], base_url=os.environ.get("TF_API_BASE"))

traffic = tf.get_traffic(location="club-014", from_="2026-11-09", to="2026-11-15")
for week in traffic["weeks"]:
    print(week["from"], week["active_teammates"]["value"])
```

```json 200 theme={null}
{
  "location": "club-014",
  "time_zone": "America/Chicago",
  "from": "2026-11-09",
  "to": "2026-11-15",
  "bucket": "day",
  "min_group_size": 5,
  "weeks": [
    {
      "from": "2026-11-09",
      "to": "2026-11-15",
      "active_teammates": { "value": 388, "withheld": false },
      "buckets": [
        { "date": "2026-11-09", "hour": null, "check_ins": 214, "withheld": false },
        { "date": "2026-11-10", "hour": null, "check_ins": 197, "withheld": false },
        { "date": "2026-11-11", "hour": null, "check_ins": 205, "withheld": false },
        { "date": "2026-11-12", "hour": null, "check_ins": 189, "withheld": false },
        { "date": "2026-11-13", "hour": null, "check_ins": 162, "withheld": false },
        { "date": "2026-11-14", "hour": null, "check_ins": 131, "withheld": false },
        { "date": "2026-11-15", "hour": null, "check_ins": 98, "withheld": false }
      ]
    }
  ]
}
```

```json 400 theme={null}
{
  "error": {
    "code": "invalid_request",
    "message": "Start the range on a Monday: figures are reported for whole weeks.",
    "request_id": "c3a1f09e5b7d42e88f6a1b2c3d4e5f60",
    "details": { "parameter": "from" }
  }
}
```

## Who is counted

Only claimed teammates who allow `usage_insights` for your organization are counted. The
answer is read at every request, so a teammate who turns it off is gone from every figure at
your next request, past weeks included. Placeholders that were never claimed, teammates who said
no or never answered, and teammates who left are not counted, even when you sent their
check-ins yourself.

## Read traffic

```bash curl theme={null}
curl "$TF_API_BASE/v1/insights/traffic?location=club-014&from=2026-11-02&to=2026-11-15&bucket=hour" \
  -H "X-API-Key: $TF_API_KEY"
```

```typescript TypeScript theme={null}
import { createClient } from '@technicallyfit/sdk';

const tf = createClient({ credential: process.env.TF_API_KEY ?? '', baseUrl: process.env.TF_API_BASE });

const traffic = await tf.GET('/v1/insights/traffic', {
  params: { query: { location: 'club-014', from: '2026-11-02', to: '2026-11-15', bucket: 'hour' } },
});
console.log(traffic.weeks.length);
```

```python Python theme={null}
import os

from technicallyfit import Client

tf = Client(os.environ["TF_API_KEY"], base_url=os.environ.get("TF_API_BASE"))

traffic = tf.get_traffic(location="club-014", from_="2026-11-02", to="2026-11-15", bucket="hour")
print(len(traffic["weeks"]))
```

| Parameter | Meaning |
| - | - |
| `location` | Your own id for the location. Leave it out for the whole organization. |
| `from` | A Monday. |
| `to` | A Sunday, at most 13 weeks after `from`, and at least two days ago. |
| `bucket` | `day` (the default) or `hour`. Hourly figures need a location. |

Figures are reported for whole weeks, Monday to Sunday, in each location's own time zone. A
week can be read once it has ended everywhere, two days after its Sunday. A range is split into
its weeks and each week is reported on its own: there is no total across weeks.

An hourly answer, shortened to two of the week's hours (the real answer lists every hour of
every day, and a second week for this range):

```json 200 theme={null}
{
  "location": "club-014",
  "time_zone": "America/Chicago",
  "from": "2026-11-02",
  "to": "2026-11-15",
  "bucket": "hour",
  "min_group_size": 5,
  "weeks": [
    {
      "from": "2026-11-02",
      "to": "2026-11-08",
      "active_teammates": { "value": 412, "withheld": false },
      "buckets": [
        { "date": "2026-11-03", "hour": 4, "check_ins": null, "withheld": true },
        { "date": "2026-11-03", "hour": 17, "check_ins": 42, "withheld": false }
      ]
    }
  ]
}
```

Every day (or every hour of every day) of the week is listed, whether or not anyone came. For
the whole organization, `location` and `time_zone` are null and each check-in counts on its own
location's date.

## Withheld figures

A figure is withheld when showing it could single out a teammate. A withheld figure has
`withheld: true` and a null value. It is never rounded and never shown as zero.

* **Small groups.** A check-in figure for fewer than `min_group_size` teammates (5, the same for
  every organization) is withheld. An hour nobody came looks the same as an hour one teammate
  came.
* **Totals.** A day total is withheld when subtracting the figures you can see from it would
  give a withheld figure, for example a day with one shown busy hour and one quiet hour. The same
  applies to the organization's day against its locations' days.
* **Active teammates.** A location's figure is withheld below 5. The organization's figure is
  also withheld when it would show, by subtraction, a group of 1 to 4 teammates, such as the
  few who went only to one small location.

Because a withheld figure stays withheld, totals of the figures you can see may be less than a
shown total. That gap is the withheld part.

## Errors

| Status | Code | When |
| - | - | - |
| 400 | `invalid_request` | `from` is not a Monday, `to` is not a Sunday, the range is longer than 13 weeks or has not ended, or `bucket=hour` without a location. `details.parameter` names the parameter. |
| 403 | `forbidden` | The key does not hold `insights:read` (`details.required_scope`). |
| 404 | `not_found` | No location with that id in your organization and mode. |

Requests count toward your key's [rate limits](https://docs.technicallyfit.com/guides/rate-limits.md) like any other.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.