Working with campaigns
Campaign list
INFO
GET /campaigns
Example:
http
https://client.adstat.pro/api/campaigns/?period=today&limit=50&offset=0Query parameters:
| Parameter | Type | Description |
|---|---|---|
period | String | Time period for campaign data. Values: today, all, yesterday, starts_month. |
offset | Number | Offset in the result list. |
limit | Number | Maximum number of campaigns in the response. |
campaign_name | String | Campaign name to filter by. |
is_active | Boolean | Status filter. Values: true (active), false (inactive). If omitted, campaigns in both statuses are returned. |
Example successful response:
json
{
"items": [
{
"id": 999999,
"name": "example",
"description": "",
"account_id": "ACC000000",
"account_name": "SOME_test",
"status": "not_active",
"number_of_advertisements": 2,
"goals": 0,
"impressions": 0,
"budget": 0.01,
"cps": 0,
"cpm": 0,
"ctr": 0,
"cpc": 0,
"clicks": 0,
"spent": 0
}
],
"count": 0
}Response fields:
| Field | Type | Description |
|---|---|---|
items | Array | List of campaign objects. |
id | Number | Unique campaign identifier. |
name | String | Campaign name. |
description | String | Campaign description. |
account_id | String | Cabinet identifier the campaign belongs to. |
account_name | String | Cabinet name the campaign belongs to. |
status | String | Campaign status. |
number_of_advertisements | Number | Number of ads in the campaign. |
goals | Number | Goals achieved in the campaign. |
impressions | Number | Ad impressions. |
budget | Number | Campaign budget. |
cps | Number | Cost per goal (CPS). |
cpm | Number | Cost per thousand impressions (CPM). |
ctr | Number | Click-through rate (CTR). |
cpc | Number | Cost per click (CPC). |
clicks | Number | Ad clicks. |
spent | Number | Total amount spent on the campaign. |
count | Number | Number of campaigns in the list. |