# GymCam Analytics — Developers

REST API, API keys, quickstart, and sandbox environment.

## Get an API key

Free at [get-key](/get-key) — 100 free lookups, no credit card required.

## Base URL

`https://gymcamanalytics.com`

## Authentication

Send your API key as a Bearer token:

```http
Authorization: Bearer <api-key>
```

Machine-readable auth metadata: [oauth-protected-resource](/.well-known/oauth-protected-resource) (RFC 9728) and [authorization-server](/.well-known/oauth-authorization-server) (RFC 8414).

## Endpoints

| Method | Path | Description |
|--------|------|-------------|
| GET | `/v1/summary` | Today's classes, total attendance, top classes |
| GET | `/v1/trainers/{trainer}` | Fill rate and no-shows per trainer (day or week) |
| GET | `/v1/classes/performance` | Classes ranked by fill rate (spot dead classes) |
| GET | `/v1/revenue` | Most profitable vs. dead classes |
| GET | `/health` | Service health |
| GET | `/metrics` | Per-endpoint access counts |
| POST/GET | `/ask` | NLWeb natural-language endpoint |

Full machine-readable spec: [openapi.json](/openapi.json).

## Sandbox

Add the `X-Sandbox: true` header to exercise the API against sample data without touching production.

```bash
curl -H "X-Sandbox: true" https://gymcamanalytics.com/v1/summary
```

## Quickstart

```bash
# 1. Get a free key at https://gymcamanalytics.com/get-key
# 2. Today's summary
curl -H "Authorization: Bearer $GYMCAM_API_KEY" \
  https://gymcamanalytics.com/v1/summary

# 3. Trainer performance
curl -H "Authorization: Bearer $GYMCAM_API_KEY" \
  https://gymcamanalytics.com/v1/trainers/Alex
```

## SDKs

- Python: `pip install gymcam-sdk`
- JavaScript: `npm install @gymcam/sdk`

## MCP server

Use GymCam as an MCP server — see [mcp.md](/mcp.md) or connect to `https://gymcamanalytics.com/mcp`.
