Skip to main content
GET
/
stats
/
metric
Metric stats
curl --request GET \
  --url https://api.whop.com/api/v1/stats/metric \
  --header 'Authorization: Bearer <token>'
{
  "columns": [
    "<string>"
  ],
  "data": [
    {}
  ],
  "debug": {
    "engine": "<string>",
    "request_id": "<string>",
    "sql": "<string>"
  },
  "node": "<string>",
  "pagination": {
    "next_cursor": "<string>"
  },
  "typename": "<string>"
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Query Parameters

resource
string
required

Metric resource using : as separator (e.g., 'receipts:gross_revenue', 'members:new_users').

granularity
string | null

Time granularity (daily, weekly, monthly).

breakdowns
string[] | null

Columns to break down the metric by.

Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text.

filters
object

Key-value pairs to filter the data.

from
string<date-time> | null

Start of time range (unix timestamp).

Example:

"2023-12-01T05:00:00.401Z"

to
string<date-time> | null

End of time range (unix timestamp).

Example:

"2023-12-01T05:00:00.401Z"

company_id
string | null

Scope query to a specific company.

Example:

"biz_xxxxxxxxxxxxxx"

user_id
string | null

Scope query to a specific user.

Example:

"user_xxxxxxxxxxxxx"

Response

A successful response

Result from a stats query (raw, metric, or SQL).

columns
string[] | null
required

Column names in the order they appear in each data row.

Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text.

data
object[] | null
required

Array of data rows, where each row is an array of values matching the columns order.

debug
object
required

Debug information including engine and SQL.

node
string | null
required

The node path that was queried.

pagination
object
required

Pagination information.

typename
string
required

The typename of this object

Allowed value: "Result"