import Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const adReport = await client.adReports.retrieve({
from: '2023-12-01T05:00:00.401Z',
to: '2023-12-01T05:00:00.401Z',
});
console.log(adReport.daily);{
"summary": {
"clicks": 42,
"impressions": 42,
"reach": 42,
"spend": 6.9,
"spend_currency": "usd",
"ctr": 6.9,
"cpc": 6.9,
"cpm": 6.9,
"frequency": 6.9,
"result_count": 42,
"result_label_key": "app_installs",
"result_label_override": "<string>",
"cost_per_result": 6.9,
"roas": 6.9
},
"daily": [
{
"stat_date": "2023-12-01T05:00:00.401Z",
"spend": 6.9,
"spend_currency": "usd",
"impressions": 42,
"clicks": 42,
"reach": 42,
"result_count": 42,
"result_label_key": "app_installs",
"result_label_override": "<string>"
}
]
}Performance report for an ad campaign, ad group, or ad. Returns aggregate totals and an optional per-day breakdown. Exactly one of adCampaignId, adGroupId, or adId must be provided.
Required permissions:
ad_campaign:stats:readimport Whop from '@whop/sdk';
const client = new Whop({
apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});
const adReport = await client.adReports.retrieve({
from: '2023-12-01T05:00:00.401Z',
to: '2023-12-01T05:00:00.401Z',
});
console.log(adReport.daily);{
"summary": {
"clicks": 42,
"impressions": 42,
"reach": 42,
"spend": 6.9,
"spend_currency": "usd",
"ctr": 6.9,
"cpc": 6.9,
"cpm": 6.9,
"frequency": 6.9,
"result_count": 42,
"result_label_key": "app_installs",
"result_label_override": "<string>",
"cost_per_result": 6.9,
"roas": 6.9
},
"daily": [
{
"stat_date": "2023-12-01T05:00:00.401Z",
"spend": 6.9,
"spend_currency": "usd",
"impressions": 42,
"clicks": 42,
"reach": 42,
"result_count": 42,
"result_label_key": "app_installs",
"result_label_override": "<string>"
}
]
}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.
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 ***************************
The unique identifier of an ad campaign. Mutually exclusive with adGroupId and adId.
The unique identifier of an ad group. Mutually exclusive with adCampaignId and adId.
The unique identifier of an ad. Mutually exclusive with adCampaignId and adGroupId.
ISO 4217 currency code to report spend in. Defaults to the company's ads reporting currency.
Inclusive start of the reporting window.
"2023-12-01T05:00:00.401Z"
When true, includes a per-day breakdown alongside the summary.
Inclusive end of the reporting window.
"2023-12-01T05:00:00.401Z"
A successful response
An ads performance report. Returns a summary; daily breakdown is included when includeDaily is true.
Was this page helpful?