All URIs are relative to https://up.go-adserver.com
| Method | HTTP request | Description |
|---|---|---|
| apiV1PublisherStatsGet | GET /api/v1/publisher/stats | Publisher earnings (sites / adzones). |
StatsResponse apiV1PublisherStatsGet(from, to, interval, groupBy, metrics, format, page, perPage, sort)
Publisher earnings (sites / adzones).
group_by: `adzone`, `website`, `country`, `os`, `browser`, `device`, `domain`, `subid`, `tag`. Filters: `ad_type`, `website`, `adzone_id`, `selling_type`, `device`, `country`, `tag_id`. Metrics: `views`, `clicks`, `ctr`, `ecpm`, `earned`, `un_views`, `no_ads`, `bot_views`, `bot_clicks`, `conv_a`, `conv_b`, `conv_c`.
import {
Configuration,
StatsPublisherApi,
} from 'goadserver-sdk';
import type { ApiV1PublisherStatsGetRequest } from 'goadserver-sdk';
async function example() {
console.log("π Testing goadserver-sdk SDK...");
const config = new Configuration({
// Configure HTTP bearer authorization: apiKey
accessToken: "YOUR BEARER TOKEN",
});
const api = new StatsPublisherApi(config);
const body = {
// Date | ISO date β inclusive start. Defaults to 7 days ago. (optional)
from: 2013-10-20,
// Date | ISO date β inclusive end. Defaults to today. Max range 92 days. (optional)
to: 2013-10-20,
// 'day' | 'hour' | 'week' | 'month' | 'sum' (optional)
interval: interval_example,
// string | Comma-separated dimensions to aggregate by, in priority order. Max 4 dimensions. Available dimensions vary per endpoint β see the per-endpoint description. (optional)
groupBy: groupBy_example,
// string | Optional comma-separated metric whitelist. When omitted, all metrics for the endpoint are returned. (optional)
metrics: metrics_example,
// 'json' | 'csv' (optional)
format: format_example,
// number (optional)
page: 56,
// number (optional)
perPage: 56,
// string | Field name. Prefix with `-` for descending (e.g. `-views`). (optional)
sort: sort_example,
} satisfies ApiV1PublisherStatsGetRequest;
try {
const data = await api.apiV1PublisherStatsGet(body);
console.log(data);
} catch (error) {
console.error(error);
}
}
// Run the test
example().catch(console.error);| Name | Type | Description | Notes |
|---|---|---|---|
| from | Date |
ISO date β inclusive start. Defaults to 7 days ago. | [Optional] [Defaults to undefined] |
| to | Date |
ISO date β inclusive end. Defaults to today. Max range 92 days. | [Optional] [Defaults to undefined] |
| interval | day, hour, week, month, sum |
[Optional] [Defaults to 'sum'] [Enum: day, hour, week, month, sum] |
|
| groupBy | string |
Comma-separated dimensions to aggregate by, in priority order. Max 4 dimensions. Available dimensions vary per endpoint β see the per-endpoint description. | [Optional] [Defaults to undefined] |
| metrics | string |
Optional comma-separated metric whitelist. When omitted, all metrics for the endpoint are returned. | [Optional] [Defaults to undefined] |
| format | json, csv |
[Optional] [Defaults to 'json'] [Enum: json, csv] |
|
| page | number |
[Optional] [Defaults to 1] |
|
| perPage | number |
[Optional] [Defaults to 100] |
|
| sort | string |
Field name. Prefix with `-` for descending (e.g. `-views`). | [Optional] [Defaults to undefined] |
- Content-Type: Not defined
- Accept:
application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Stats response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]