A/B Test Retention

Retrieve the retention metrics for a specific variant video of an A/B test.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

GET /retention/{video_id}

Returns the retention curve of a video over a date range — i.e. how many viewers are still watching at each second of the video. Used by the A/B Testing UI to render the Retention chart per variant.

📘

Different host: data.pandavideo.com

This endpoint lives on https://data.pandavideo.com, not on api-v2.pandavideo.com.br. Same host as A/B Test Plays Rate.

📘

Authorization

Requires a valid API Key in the Authorization header. Send the key directly — no Bearer prefix.

HTTP Method & Path

GET /retention/{video_id}?a=1&start_date=<YYYY-MM-DD>&end_date=<YYYY-MM-DD>

Base URL: https://data.pandavideo.com

Path Parameters

NameTypeRequiredDescription
video_idstring (uuid)yesVideo to fetch retention for.

Query Parameters

NameTypeRequiredDescription
aintegeryesMust be 1. Internal flag the analytics service uses to switch the retention computation mode; the dashboard always sends 1.
start_datestring (YYYY‑MM‑DD)yesInclusive start.
end_datestring (YYYY‑MM‑DD)yesInclusive end.
📘

Why ?a=1? This is a known inconsistency between the two analytics endpoints — plays-rate is gated by ?type=video, retention by ?a=1. There is no documented alternate value, but both endpoints reject the request when the gate is missing.

Response

Success Response (200)

{
  "retention": {
    "0": 100,
    "1": 99,
    "5": 92,
    "30": 71,
    "60": 58,
    "120": 45,
    "300": 22
  }
}

Response Schema

FieldTypeDescription
retentionobjectMap of "<seconds>" → <percentage>, where the key is the second mark in the video (as a string) and the value is the percentage of viewers still watching. Keys are not necessarily contiguous — render as a sparse line series.

Error Responses

  • 400 — invalid start_date / end_date or missing a.
  • 401 — missing/invalid API Key.
  • 404 — video not found.
  • 500 — internal error.

Example Usage

cURL

curl --request GET \
  --url 'https://data.pandavideo.com/retention/f1f2f3f4-aaaa-bbbb-cccc-d1d2d3d4d5d6?a=1&start_date=2025-01-15&end_date=2025-01-22' \
  --header 'Authorization: <your-api-key>'

Recipes

Path Params
uuid
required

ID of the variant video.

Query Params
integer
enum
required

Aggregation flag. Value: 1.

Allowed:
date
required

Start date (YYYY-MM-DD).

date
required

End date (YYYY-MM-DD).

Responses

Language
LoadingLoading…
Response
Choose an example:
application/json