Ad InsertionGet Ad Consumption

Get Ad Consumption

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

curl -X POST "https://api.5centscdn.com/v2/streams/push/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",
  "totalAdInsertionHours": 3.14,
  "adInsertionHoursChart": [
    {
      "date": "example_string",
      "value": 3.14
    }
  ]
}
POST
/streams/push/{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.

totalAdInsertionHoursnumber

Total ad insertion hours in the requested range.

adInsertionHoursChartarray

Time-series data points.