> ## 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

> Stats API가 제공하는 지표 목록을 조회하고, 필터와 분류를 사용해 계정의 지표를 시간 경과에 따라 쿼리하세요.

Stats API를 사용해 사용 가능한 지표를 찾은 다음, 계정의 시계열을 조회하세요. [Stats 레퍼런스](https://docs.whop.com/ko/api-reference/stats/stats)에서 각 지표와 단위, 지원되는 필터를 설명합니다.

> [!NOTE]
>
> 계정 매출 쿼리에는 `stats:read` 권한이 필요합니다. 앱의 권한을 요청하려면
> [권한](https://docs.whop.com/ko/developer/guides/permissions.md)을 참고하세요.

## 지표 찾기

[시계열 지표 목록을 조회](https://docs.whop.com/ko/api-reference/stats/list-time-series-metrics.md)하여 키, 이름, 단위, 설명 및 필터링 가능한 속성을 가져오세요:

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

다음 요청에서 `gross_revenue`와 같은 지표의 `key`를 사용하세요. `properties` 배열에는 필터링하거나 분류할 수 있는 속성이 나열됩니다.

## 시계열 조회

계정 ID와 날짜 범위를 [지표 시계열 조회](https://docs.whop.com/ko/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"
```

응답의 `data.points` 배열에는 각 기간의 초 단위 Unix `timestamp`와 `value`가 포함됩니다. 값은 카탈로그의 단위로 해석하세요: `count`는 개수, `currency`는 소수 금액, `percent`는 이미 퍼센트 포인트 단위입니다(`1.6`은 1.6%를 의미).

일부 지표는 전체 범위에 대한 `data.totals`도 반환합니다. 제공되는 경우 이 합계를 사용하세요: 일일 비율을 평균하거나 일일 고유 개수를 합산하면 전체 범위의 결과가 나오지 않습니다.

## 결과 필터링 및 분류

속성을 쿼리 매개변수로 직접 전달하여 필터링하세요. `breakdown_by`를 사용하면 각 포인트를 하나의 속성으로 분할할 수 있습니다. 이 예제는 총매출을 카드 결제로 필터링하고 원래 거래 통화별로 분할합니다:

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

각 포인트에는 `{ name, value }` 항목으로 구성된 `breakdown` 배열이 포함됩니다. 거래 지표를 `currency`로 필터링하거나 분류하면 변환 없이 원래 통화 금액이 보고됩니다.

해당 지표에 나열된 속성만 사용하세요. 지원되지 않는 속성은 `400`을 반환합니다. 알 수 없는 지표 키는 `404`를 반환합니다. 시간대, 간격, 스냅샷 기간 및 지표별 옵션은 [쿼리 매개변수](https://docs.whop.com/ko/api-reference/stats/stats#query-parameters)와 [지표 레퍼런스](https://docs.whop.com/ko/api-reference/stats/retrieve-metric-time-series.md)를 참고하세요.
