Skip to content

Get video duration insights

GET
/analytics/duration
curl --request GET \
--url 'https://api.warmup.social/analytics/duration?role=own&from=2026-09-01&to=2026-09-30&tz=UTC' \
--header 'Authorization: Bearer <token>'

Views by video length bucket and the length that performs best.

role
string
Allowed values: own competitor

Whose accounts to analyze — your own or competitors.

from
string format: date

Example

2026-09-01

Period start, YYYY-MM-DD, inclusive. Defaults to 30 days before to. Periods longer than 365 days are cut from the start.

to
string format: date

Example

2026-09-30

Period end, YYYY-MM-DD, inclusive. Defaults to today in tz.

tz
string
default: UTC

Example

Europe/Berlin

IANA time zone used to split days.

platform
Array<string>
Allowed values: instagram tiktok facebook

Only these networks. Comma-separated or repeated.

group
Array<string>

Only accounts from these collections (names from “List analytics filters”).

accountId
Array<string>

Only these accounts (ids from “List analytics filters”).

Duration buckets for the period.

Media typeapplication/json
object
period
required
object
from
required
string format: date
to
required
string format: date
days
required
integer
buckets
required
Array<object>
object
bucket
required
string
Allowed values: 0-15 15-30 30-45 45-60 60-90 90-180 180+
minSeconds
required
integer
maxSeconds
required
integer
nullable
posts
required
integer
avgViews
required
number
nullable
medianViews
required
number
nullable
optimalBucket
required

The bucket with the best average views (at least 3 posts).

string
nullable
optimalSeconds
required

Median video length in the optimal bucket.

number
nullable

Example

{
"period": {
"days": 30
},
"buckets": [
{
"bucket": "0-15"
}
]
}

The Bearer token is missing or invalid.

Media typeapplication/json
object
statusCode
required
integer
message
required
One of:
string
error
string
key
additional properties
any

Example

{
"statusCode": 400,
"message": "Invalid request",
"error": "Bad Request"
}