---
updatedAt: 2026-08-01T11:27:34.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Get Campaign Counts

This returns real time reporting data for a campaign.

**Troubleshooting Notes**

1. If no query parameters are included, the endpoint returns the *lifetime* of data for the Id.

2. If `days` and `start`/ `end` are both present in a request (not recommended) `start`/ `end` will take precedence.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "management-api-2",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.kevel.co"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "X-Adzerk-ApiKey",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/instantcounts/campaign/{CampaignID}": {
      "get": {
        "summary": "Get Campaign Counts",
        "description": "This returns real time reporting data for a campaign.",
        "operationId": "get-campaign-counts",
        "parameters": [
          {
            "name": "CampaignID",
            "in": "path",
            "description": "ID of the Campaign",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          },
          {
            "name": "days",
            "in": "query",
            "description": "Returns data for the number of days since the current day. You can request a maximum of 90 days of data and a minimum of 0. `days=0` returns data for the current day.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "start",
            "in": "query",
            "description": "In the format of YYYY-MM-DD. Returns data starting from the date specified. Must be within the past 90 days. If no `end` is included, this will return data up to the current day.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "end",
            "in": "query",
            "description": "In the format of YYYY-MM-DD. Returns data ending at the date specified. Must be within the past 90 days.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"campaigns\": {\n    \"123\": {\n      \"impressions\": 123,\n      \"conversions\": 0,\n      \"revenue\": 0.117,\n      \"clicks\": 0\n    }\n  }\n}"
                  },
                  "200 OK - Multi Day": {
                    "value": "{\n  \"campaigns\": {\n    \"123\": {\n      \"2017-04-18\": {\n        \"impressions\": 1,\n        \"conversions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"2017-04-19\": {\n        \"impressions\": 2,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 2\n      },\n      \"2017-04-20\": {\n        \"impressions\": 3,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"total\": {\n        \"impressions\": 6,\n        \"conversions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 2\n      }\n    }\n  }\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "campaigns": {
                          "type": "object",
                          "properties": {
                            "123": {
                              "type": "object",
                              "properties": {
                                "impressions": {
                                  "type": "integer",
                                  "example": 123,
                                  "default": 0
                                },
                                "conversions": {
                                  "type": "integer",
                                  "example": 0,
                                  "default": 0
                                },
                                "revenue": {
                                  "type": "number",
                                  "example": 0.117,
                                  "default": 0
                                },
                                "clicks": {
                                  "type": "integer",
                                  "example": 0,
                                  "default": 0
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "200 OK - Multi Day",
                      "type": "object",
                      "properties": {
                        "campaigns": {
                          "type": "object",
                          "properties": {
                            "123": {
                              "type": "object",
                              "properties": {
                                "2017-04-18": {
                                  "type": "object",
                                  "properties": {
                                    "impressions": {
                                      "type": "integer",
                                      "example": 1,
                                      "default": 0
                                    },
                                    "conversions": {
                                      "type": "integer",
                                      "example": 1,
                                      "default": 0
                                    },
                                    "revenue": {
                                      "type": "integer",
                                      "example": 0,
                                      "default": 0
                                    },
                                    "clicks": {
                                      "type": "integer",
                                      "example": 0,
                                      "default": 0
                                    }
                                  }
                                },
                                "2017-04-19": {
                                  "type": "object",
                                  "properties": {
                                    "impressions": {
                                      "type": "integer",
                                      "example": 2,
                                      "default": 0
                                    },
                                    "conversions": {
                                      "type": "integer",
                                      "example": 0,
                                      "default": 0
                                    },
                                    "revenue": {
                                      "type": "integer",
                                      "example": 0,
                                      "default": 0
                                    },
                                    "clicks": {
                                      "type": "integer",
                                      "example": 2,
                                      "default": 0
                                    }
                                  }
                                },
                                "2017-04-20": {
                                  "type": "object",
                                  "properties": {
                                    "impressions": {
                                      "type": "integer",
                                      "example": 3,
                                      "default": 0
                                    },
                                    "conversions": {
                                      "type": "integer",
                                      "example": 0,
                                      "default": 0
                                    },
                                    "revenue": {
                                      "type": "integer",
                                      "example": 0,
                                      "default": 0
                                    },
                                    "clicks": {
                                      "type": "integer",
                                      "example": 0,
                                      "default": 0
                                    }
                                  }
                                },
                                "total": {
                                  "type": "object",
                                  "properties": {
                                    "impressions": {
                                      "type": "integer",
                                      "example": 6,
                                      "default": 0
                                    },
                                    "conversions": {
                                      "type": "integer",
                                      "example": 1,
                                      "default": 0
                                    },
                                    "revenue": {
                                      "type": "integer",
                                      "example": 0,
                                      "default": 0
                                    },
                                    "clicks": {
                                      "type": "integer",
                                      "example": 2,
                                      "default": 0
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/campaign/123'\n\n# Using Days\ncurl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/campaign/123?days=42'\n\n# Using Start/End\ncurl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/campaign/123?start=2017-04-18&end=2017-04-20'"
            },
            {
              "language": "javascript",
              "code": "const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getCampaignCounts() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let counts = await client.run(\"realTimeReport\", \"getCampaignCounts\", {\n    campaignId: 123\n  });\n\n  console.log(counts);\n}\n\ngetCampaignCounts();"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\ndef get_campaign_counts()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    campaign_id = 123\n  \tdata = {\n        days: 7\n    }\n    pp client.campaigns.instant_counts(campaign_id, data)\nend\nget_campaign_counts()"
            }
          ],
          "samples-languages": [
            "curl",
            "javascript",
            "ruby"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "X-Adzerk-Sdk-Version",
        "value": "Readme.io:ManagementAPI2"
      }
    ],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```