Ad InsertionGet Ad Consumption

Get Ad Consumption

Custom Plan Returns ad insertion consumption data grouped by the requested time resolution.

curl -X POST "https://api.5centscdn.com/v2/streams/pull/123/adinsertion/consumption" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "groupBy": "month",
  "r": "2026-01-01 00:00:00 - 2026-01-01 00:00:00"
}'
{
  "result": "success",
  "message": "example_string",
  "from": "2026-01-01 00:00:00",
  "to": "2026-01-31 23:59:59",
  "serviceIds": [
    10001
  ],
  "groupBy": "day",
  "totalAdInsertions": 1284,
  "totalAdImpressions": 3720,
  "totalEgress": 128430000000,
  "egressDetails": {
    "manifests": 1200000,
    "segments": 120000000000,
    "ssat": 300000,
    "transcoding": 8000000000,
    "other": 100000
  },
  "adInsertionsChart": [
    {
      "key": "2026-01-15",
      "value": 42
    }
  ],
  "adImpressionsChart": [
    {
      "key": "2026-01-15",
      "value": 42
    }
  ],
  "egressChart": [
    {
      "key": "2026-01-15",
      "value": 42
    }
  ]
}
POST
/streams/pull/{streamid}/adinsertion/consumption
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-API-Key)
X-API-Keystring
Required

API key (sent in header)

path
streamidinteger
Required

Numeric stream ID.

Content-Typestring
Required

The media type of the request body

Options: application/json
groupBystring
Required

Time resolution for aggregating consumption data.

Options: year, month, week, day, hour
rstring
Required

Date-time range: YYYY-MM-DD HH:MM:SS - YYYY-MM-DD HH:MM:SS

Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-API-Keystring
Required

API Key for authentication. Provide your API key in the header.

Path Parameters

streamidinteger
Required

Numeric stream ID.

Body

application/json
groupBystring
Required

Time resolution for aggregating consumption data.

Allowed values:yearmonthweekdayhour
rstring
Required

Date-time range: YYYY-MM-DD HH:MM:SS - YYYY-MM-DD HH:MM:SS

Example:
2026-01-01 00:00:00 - 2026-01-01 00:00:00

Responses

resultstring

Status of the API response.

Allowed values:successerror
messagestring

Human-readable message describing the result.

fromstring

Start of the requested range.

tostring

End of the requested range.

serviceIdsinteger[]

Service account IDs included in this result.

groupBystring

Time resolution the chart series are bucketed by.

Allowed values:dayhour
totalAdInsertionsinteger

Total number of ad insertions triggered in the requested range.

totalAdImpressionsinteger

Total number of ad impressions delivered in the requested range.

totalEgressinteger

Total egress bytes attributable to ad insertion in the requested range.

egressDetailsobject

Breakdown of total egress bytes by source.

adInsertionsChartarray

Time-series data points for ad insertions.

adImpressionsChartarray

Time-series data points for ad impressions.

egressChartarray

Time-series data points for egress bytes.