API: Statistics
In this page
- Overview
- Statistics Objects
- OverallStatistics / Totals
- DatedStatistics
- CampaignTotalsItem
- LineitemTotalsItem
- Organization-Level Statistics
- Retrieving Overall Statistics for an Organization
- Example
- Retrieving Per-Campaign Statistics Totals for an Organization
- Example
- Retrieving Time-Series Statistics for an Organization
- Example
- CSV File
- Campaign-Level Statistics
- Retrieving Overall Statistics for a Campaign
- Example
- Retrieving Per-Line-Item Statistics Totals for a Campaign
- Example
- Retrieving Statistics Totals for a Campaign
- Example
- Retrieving Time-Series Statistics for a Campaign
- Example
- CSV File
- Line-Item-Level Statistics
- Retrieving Overall Statistics for a Line Item
- Example
- Retrieving Statistics Totals for a Line Item
- Example
- Retrieving Time-Series Statistics for a Line Item
- Example
- CSV File
- Errors
Overview
The Campaign Statistics APIs return impression and revenue statistics for Campaigns and Line Items, aggregated at the organization, campaign, or line item level.
Statistics Objects
Depending on the endpoint, statistics are returned as one of the following objects.
OverallStatistics / Totals
| Property | Type | Description |
|---|---|---|
impressions_sold |
Numeric | Number of impressions delivered |
revenue_amount |
String | Revenue, as a decimal amount serialized as a string (e.g. "30.50000000") |
DatedStatistics
Returned by the time-series endpoints, one object per date/group bucket.
| Property | Type | Description |
|---|---|---|
date |
String | Date of the bucket, in YYYY-MM-DD format |
impressions_sold |
Numeric | Number of impressions delivered on that date/bucket |
revenue_amount |
String | Revenue, as a decimal amount serialized as a string |
CampaignTotalsItem
Returned by the per-campaign totals endpoint.
| Property | Type | Description |
|---|---|---|
campaign_id |
Numeric | Unique campaign identifier |
name |
String | Campaign name |
is_deleted |
Boolean | Whether the campaign has been deleted |
impressions_sold |
Numeric | Number of impressions delivered by the campaign in the given date range |
revenue_amount |
String | Revenue, as a decimal amount serialized as a string |
LineitemTotalsItem
Returned by the per-line-item totals endpoint.
| Property | Type | Description |
|---|---|---|
lineitem_id |
Numeric | Unique line item identifier |
name |
String | Line item name |
is_deleted |
Boolean | Whether the line item has been deleted |
impressions_sold |
Numeric | Number of impressions delivered by the line item in the given date range |
revenue_amount |
String | Revenue, as a decimal amount serialized as a string |
Organization-Level Statistics
These endpoints aggregate statistics across every campaign belonging to an organization’s team.
Retrieving Overall Statistics for an Organization
GET /v2/organizations/ORGANIZATION-ID/campaign-statisticsAuthenticated: yes
Returns all-time impressions and revenue for every campaign belonging to the organization’s team, with no date range.
Example
curl -H "Authorization: Bearer OAUTH-TOKEN"
https://api.spreaker.com/v2/organizations/59/campaign-statistics{
"response": {
"statistics": {
"impressions_sold": 128500,
"revenue_amount": "1542.00000000"
}
}
}Retrieving Per-Campaign Statistics Totals for an Organization
GET /v2/organizations/ORGANIZATION-ID/campaigns/campaign-statistics/impressions/totalsAuthenticated: yes
Returns a paginated list of every campaign belonging to the organization’s team, each with its total impressions and revenue for the given date range.
| Parameter | Required | Type | Description |
|---|---|---|---|
from |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics since, and including, this date. Must be less than or equal to to. |
to |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics until, and including, this date. |
offset |
No | Numeric | Number of items to skip, for pagination. Defaults to 0. |
limit |
No | Numeric | Maximum number of items to return, for pagination. Defaults to 20. |
Example
curl -H "Authorization: Bearer OAUTH-TOKEN"
"https://api.spreaker.com/v2/organizations/59/campaigns/campaign-statistics/impressions/totals?from=2026-06-01&to=2026-06-30"{
"response": {
"items": [
{
"campaign_id": 9036,
"name": "Acme Summer Launch",
"is_deleted": false,
"impressions_sold": 33333,
"revenue_amount": "333.33"
}
],
"prev_url": null,
"next_url": null
}
}Retrieving Time-Series Statistics for an Organization
GET /v2/organizations/ORGANIZATION-ID/campaign-statistics/impressionsAuthenticated: yes
Returns impressions and revenue for every campaign belonging to the organization’s team, grouped by day, week, or month over the given date range.
| Parameter | Required | Type | Description |
|---|---|---|---|
from |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics since, and including, this date. Must be less than or equal to to. |
to |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics until, and including, this date. |
group |
Yes | String | Time bucket granularity. Can be day, week, or month. |
Example
curl -H "Authorization: Bearer OAUTH-TOKEN"
"https://api.spreaker.com/v2/organizations/59/campaign-statistics/impressions?from=2026-06-01&to=2026-06-03&group=day"{
"response": {
"statistics": [
{
"date": "2026-06-01",
"impressions_sold": 4200,
"revenue_amount": "50.40000000"
},
{
"date": "2026-06-02",
"impressions_sold": 3900,
"revenue_amount": "46.80000000"
},
{
"date": "2026-06-03",
"impressions_sold": 0,
"revenue_amount": "0"
}
]
}
}CSV File
To get a CSV file instead, add .csv to the end of the endpoint and use the same parameters as the regular request.
GET /v2/organizations/ORGANIZATION-ID/campaign-statistics/impressions.csvCampaign-Level Statistics
These endpoints resolve the campaign’s team to authorize the request, so 403 is returned both when the user lacks the required privileges and when there is no valid authorization available for that team.
Retrieving Overall Statistics for a Campaign
GET /v2/campaigns/CAMPAIGN-ID/campaign-statisticsAuthenticated: yes
Returns all-time impressions and revenue for a single campaign, with no date range.
Example
curl -H "Authorization: Bearer OAUTH-TOKEN"
https://api.spreaker.com/v2/campaigns/9036/campaign-statistics{
"response": {
"statistics": {
"impressions_sold": 12000,
"revenue_amount": "144.00000000"
}
}
}Retrieving Per-Line-Item Statistics Totals for a Campaign
GET /v2/campaigns/CAMPAIGN-ID/lineitems/campaign-statistics/impressions/totalsAuthenticated: yes
Returns a paginated list of every line item belonging to the campaign, each with its total impressions and revenue for the given date range.
| Parameter | Required | Type | Description |
|---|---|---|---|
from |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics since, and including, this date. Must be less than or equal to to. |
to |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics until, and including, this date. |
offset |
No | Numeric | Number of items to skip, for pagination. Defaults to 0. |
limit |
No | Numeric | Maximum number of items to return, for pagination. Defaults to 20. |
Example
curl -H "Authorization: Bearer OAUTH-TOKEN"
"https://api.spreaker.com/v2/campaigns/9036/lineitems/campaign-statistics/impressions/totals?from=2026-06-01&to=2026-08-31"{
"response": {
"items": [
{
"lineitem_id": 21044,
"name": "Acme Summer - Show Targeting",
"is_deleted": false,
"impressions_sold": 8214,
"revenue_amount": "98.57"
}
],
"prev_url": null,
"next_url": null
}
}Retrieving Statistics Totals for a Campaign
GET /v2/campaigns/CAMPAIGN-ID/campaign-statistics/impressions/totalsAuthenticated: yes
Returns total impressions and revenue for a single campaign over the given date range.
| Parameter | Required | Type | Description |
|---|---|---|---|
from |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics since, and including, this date. Must be less than or equal to to. |
to |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics until, and including, this date. |
Example
curl -H "Authorization: Bearer OAUTH-TOKEN"
"https://api.spreaker.com/v2/campaigns/9036/campaign-statistics/impressions/totals?from=2026-06-01&to=2026-08-31"{
"response": {
"statistics": {
"impressions_sold": 12000,
"revenue_amount": "144.00000000"
}
}
}Retrieving Time-Series Statistics for a Campaign
GET /v2/campaigns/CAMPAIGN-ID/campaign-statistics/impressionsAuthenticated: yes
Returns impressions and revenue for a single campaign, grouped by day, week, or month over the given date range.
| Parameter | Required | Type | Description |
|---|---|---|---|
from |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics since, and including, this date. Must be less than or equal to to. |
to |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics until, and including, this date. |
group |
Yes | String | Time bucket granularity. Can be day, week, or month. |
Example
curl -H "Authorization: Bearer OAUTH-TOKEN"
"https://api.spreaker.com/v2/campaigns/9036/campaign-statistics/impressions?from=2026-06-01&to=2026-06-30&group=week"{
"response": {
"statistics": [
{
"date": "2026-06-01",
"impressions_sold": 2800,
"revenue_amount": "33.60000000"
},
{
"date": "2026-06-08",
"impressions_sold": 3100,
"revenue_amount": "37.20000000"
}
]
}
}CSV File
To get a CSV file instead, add .csv to the end of the endpoint and use the same parameters as the regular request.
GET /v2/campaigns/CAMPAIGN-ID/campaign-statistics/impressions.csvLine-Item-Level Statistics
These endpoints resolve the line item’s team to authorize the request, so 403 is returned both when the user lacks the required privileges and when there is no valid authorization available for that team.
Retrieving Overall Statistics for a Line Item
GET /v2/lineitems/LINEITEM-ID/campaign-statisticsAuthenticated: yes
Returns all-time impressions and revenue for a single line item, with no date range.
Example
curl -H "Authorization: Bearer OAUTH-TOKEN"
https://api.spreaker.com/v2/lineitems/21044/campaign-statistics{
"response": {
"statistics": {
"impressions_sold": 8214,
"revenue_amount": "98.57000000"
}
}
}Retrieving Statistics Totals for a Line Item
GET /v2/lineitems/LINEITEM-ID/campaign-statistics/impressions/totalsAuthenticated: yes
Returns total impressions and revenue for a single line item over the given date range.
| Parameter | Required | Type | Description |
|---|---|---|---|
from |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics since, and including, this date. Must be less than or equal to to. |
to |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics until, and including, this date. |
Example
curl -H "Authorization: Bearer OAUTH-TOKEN"
"https://api.spreaker.com/v2/lineitems/21044/campaign-statistics/impressions/totals?from=2026-06-01&to=2026-08-31"{
"response": {
"statistics": {
"impressions_sold": 8214,
"revenue_amount": "98.57000000"
}
}
}Retrieving Time-Series Statistics for a Line Item
GET /v2/lineitems/LINEITEM-ID/campaign-statistics/impressionsAuthenticated: yes
Returns impressions and revenue for a single line item, grouped by day, week, or month over the given date range.
| Parameter | Required | Type | Description |
|---|---|---|---|
from |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics since, and including, this date. Must be less than or equal to to. |
to |
Yes | A date string in the format YYYY-MM-DD |
Date filter to get statistics until, and including, this date. |
group |
Yes | String | Time bucket granularity. Can be day, week, or month. |
Example
curl -H "Authorization: Bearer OAUTH-TOKEN"
"https://api.spreaker.com/v2/lineitems/21044/campaign-statistics/impressions?from=2026-06-01&to=2026-08-31&group=month"{
"response": {
"statistics": [
{
"date": "2026-06-01",
"impressions_sold": 4102,
"revenue_amount": "49.22400000"
},
{
"date": "2026-07-01",
"impressions_sold": 4112,
"revenue_amount": "49.34400000"
},
{
"date": "2026-08-01",
"impressions_sold": 0,
"revenue_amount": "0"
}
]
}
}CSV File
To get a CSV file instead, add .csv to the end of the endpoint and use the same parameters as the regular request.
GET /v2/lineitems/LINEITEM-ID/campaign-statistics/impressions.csvErrors
Besides the standard 401 for a missing or invalid access token, these endpoints can return:
| Status | Meaning |
|---|---|
403 |
The authenticated user lacks the required privileges, is not authorized on the organization, or (for campaign/line-item endpoints) has no valid authorization for the team. |
404 |
The organization was not found, was deleted, or has no associated team; or the campaign/line item was not found. |
400 |
Missing or invalid query parameters — e.g. missing from/to, from after to, or an invalid group value — or an error propagated from the upstream statistics service. |
500 |
An error propagated from the upstream statistics service. |