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

> ## Agent Instructions
> Treat these docs and the Whop MCP server as the source of truth for Whop API behavior. Don't infer endpoint behavior from marketing pages.
> MCP server: connect https://mcp.whop.com/mcp (streamable HTTP, browser sign-in, no API key in the client config) to search these docs and read or change live Whop data. Setup: https://docs.whop.com/developer/guides/ai_and_mcp.md
> Whop CLI: install with `curl -fsSL https://whop.com/install.sh | sh` to scaffold, run, and deploy Whop apps and websites. It acts on production, not the sandbox. Overview: https://docs.whop.com/cli/overview.md Agent mode: https://docs.whop.com/cli/agent-mode.md
> Hosting: Whop serves a site or app from the build `whop apps deploy` uploads, with rollbacks, secrets, and server logs. Guide: https://docs.whop.com/developer/websites/hosting.md
> Plugins: in Claude Code, run `/plugin marketplace add whopio/plugins`, then `/plugin install whop@whop`. Guide: https://docs.whop.com/developer/guides/plugins/claude-code.md Every agent tool: https://docs.whop.com/developer/ai/overview.md
> Environments: build and test in the sandbox (API `https://sandbox-api.whop.com/api/v1`, keys at https://sandbox.whop.com/dashboard/developer, SDK environment `Sandbox`; no real money). Production (API `https://api.whop.com/api/v1`, keys at https://whop.com/dashboard/developer, SDK environment `Production`, the SDK default) moves real money, so use it only at launch. The two share no accounts, keys, products, or webhooks, and their keys look identical: never mix them. Sandbox guide: https://docs.whop.com/developer/guides/sandbox.md Comparison: https://docs.whop.com/developer/quickstart.md
> API: send `Authorization: Bearer <API_KEY>` from your server only, and pin a dated version with the `Api-Version-Date` header. OpenAPI spec: https://api.whop.com/api/v1/openapi.json
> Which API: build on the Current API, whose pages live under https://docs.whop.com/api-reference/ (start at https://docs.whop.com/api-reference/overview.md). Pages under /api-reference/legacy/ are the Legacy API. Use one only when https://docs.whop.com/api-reference/stability.md lists the resource as Legacy-only.

# Stats API

> Bekijk welke metrics de Stats API biedt en vraag de metrics van een account over een periode op, met filters en uitsplitsingen.

Gebruik de Stats API om beschikbare metrics te ontdekken en haal daarna een tijdreeks op voor een account. De [Stats-referentie](https://docs.whop.com/nl/api-reference/stats/stats) legt elke metric uit, met de eenheden en ondersteunde filters.

> [!NOTE]
>
> Voor omzetquery's van een account is de permissie `stats:read` vereist. Zie
> [Permissies](https://docs.whop.com/nl/developer/guides/permissions.md) om permissies voor je app aan te vragen.

## Metrics ontdekken

[Geef tijdreeksmetrics weer](https://docs.whop.com/nl/api-reference/stats/list-time-series-metrics.md) om hun keys, namen, eenheden, beschrijvingen en filterbare eigenschappen op te halen:

```bash theme={null}
curl "https://api.whop.com/api/v1/stats/time_series" \
  -H "Authorization: Bearer $WHOP_API_KEY"
```

Gebruik de `key` van een metric, zoals `gross_revenue`, in het volgende verzoek. De array `properties` bevat de eigenschappen waarop je kunt filteren of uitsplitsen.

## Een tijdreeks ophalen

Geef je account-ID en een datumbereik door aan [Retrieve metric time series](https://docs.whop.com/nl/api-reference/stats/retrieve-metric-time-series.md):

```bash theme={null}
curl --get "https://api.whop.com/api/v1/stats/time_series/gross_revenue" \
  -H "Authorization: Bearer $WHOP_API_KEY" \
  --data-urlencode "account_id=YOUR_ACCOUNT_ID" \
  --data-urlencode "from=2026-08-01" \
  --data-urlencode "to=2026-08-31" \
  --data-urlencode "interval=day" \
  --data-urlencode "convert_to=usd"
```

De array `data.points` in het antwoord bevat voor elke periode een Unix-`timestamp` in seconden en een `value`. Lees de waarde in de eenheid uit de catalogus: `count` is een aantal, `currency` is een decimaal bedrag en `percent` staat al in procentpunten (`1.6` betekent 1,6%).

Sommige metrics geven ook `data.totals` terug voor het hele bereik. Gebruik die totalen wanneer ze beschikbaar zijn: het middelen van dagelijkse percentages of het optellen van dagelijkse unieke aantallen levert niet het resultaat voor het hele bereik op.

## Resultaten filteren en uitsplitsen

Geef een eigenschap rechtstreeks door als queryparameter om erop te filteren. Gebruik `breakdown_by` om elk punt op één eigenschap uit te splitsen. Dit voorbeeld filtert de bruto-omzet op kaartbetalingen en splitst die uit naar de oorspronkelijke transactievaluta:

```bash theme={null}
curl --get "https://api.whop.com/api/v1/stats/time_series/gross_revenue" \
  -H "Authorization: Bearer $WHOP_API_KEY" \
  --data-urlencode "account_id=YOUR_ACCOUNT_ID" \
  --data-urlencode "from=2026-08-01" \
  --data-urlencode "to=2026-08-31" \
  --data-urlencode "payment_method=card" \
  --data-urlencode "breakdown_by=currency"
```

Elk punt bevat een array `breakdown` met `{ name, value }`-items. Wanneer je transactiemetrics filtert of uitsplitst op `currency`, worden de bedragen in hun oorspronkelijke valuta gerapporteerd, zonder omrekening.

Gebruik alleen eigenschappen die voor de metric worden vermeld. Een niet-ondersteunde eigenschap geeft `400` terug. Een onbekende metric-key geeft `404` terug. Zie de [queryparameters](https://docs.whop.com/nl/api-reference/stats/stats#query-parameters) en de [metricreferentie](https://docs.whop.com/nl/api-reference/stats/retrieve-metric-time-series.md) voor tijdzones, intervallen, snapshotvensters en metricspecifieke opties.


## Related topics

- [Stats API-referentie](https://docs.whop.com/nl/api-reference/stats/stats.md)
- [API-versies](https://docs.whop.com/nl/developer/api/versioning.md)
- [API-stabiliteit](https://docs.whop.com/nl/api-reference/stability.md)
