-
Notifications
You must be signed in to change notification settings - Fork 0
Stats
The stats resource exposes analytics and metrics for a Whop company — letting you discover available metrics, query aggregated metric values, fetch raw data points, and run ad-hoc SQL queries against your analytics dataset.
This resource has an unusual shape: three of its methods are GET requests that pass parameters as a query string, while sql is a POST request that sends a request body.
$client->stats // Matchable\Whop\Resource\StatsResource| HTTP | GET stats/describe |
| Does | Describes the available stats — metrics, dimensions, and schema you can query. |
| Parameters |
$query — optional query-string filters. Optional (defaults to []). |
| Returns | array |
| HTTP | GET stats/metric |
| Does | Retrieves an aggregated metric value (e.g. revenue, signups) over a time range. |
| Parameters |
$query — query-string parameters selecting the metric, range, and grouping. Required.
|
| Returns | array |
| HTTP | GET stats/raw |
| Does | Retrieves raw, un-aggregated stat data points. |
| Parameters |
$query — query-string parameters selecting the dataset and filters. Required.
|
| Returns | array |
| HTTP | POST stats/sql |
| Does | Runs an ad-hoc SQL query against the company's analytics dataset. |
| Parameters |
$data — request body containing the SQL query (and any parameters). Required.
|
| Returns | array |
Note:
describe,metric, andrawareGETcalls whosearrayargument is serialized into the query string.sqlis aPOSTcall whosearrayargument is sent as the request body.
// Discover what's available.
$schema = $client->stats->describe();
// Aggregated metric over a date range.
$revenue = $client->stats->metric([
'metric' => 'revenue',
'start' => '2026-01-01',
'end' => '2026-01-31',
]);
// Ad-hoc SQL query (POST body).
$result = $client->stats->sql([
'query' => 'SELECT date, revenue FROM daily_revenue ORDER BY date DESC LIMIT 30',
]);Official Whop documentation: https://docs.whop.com
Core Company · AccountLink · File · AccessToken · AuthorizedUser · User · Member · Webhook
Payments & Billing Payment · Checkout · Plan · Product · Membership · Refund · Invoice · PromoCode · PaymentMethod · SetupIntent
Platform & Finance Transfer · FeeMarkup · Topup · Withdrawal · LedgerAccount · PayoutAccount · PayoutMethod
Disputes Dispute · DisputeAlert · ResolutionCenter
Commerce Shipment · Lead · Entry · Review · Affiliate · Stats
Experiences & Courses Experience · Course · CourseChapter · CourseLesson · CourseLessonInteraction · CourseStudent
Communication ChatChannel · DmChannel · DmMember · Message · Reaction · Forum · ForumPost · SupportChannel · Notification
Advertising AdCampaign · AdGroup · Ad
Apps & AI App · AppBuild · AiChat · CompanyTokenTransaction
Verifications Verification