---
title: "Gets media play statistics aggregated by file."
method: GET
path: "/adhawk/mediaplaystats"
tags: ["AdHawk"]
---

# Gets media play statistics aggregated by file.

`GET /adhawk/mediaplaystats`

## Request

- Base URL: `https://api.reveldigital.com`
- URL: `https://api.reveldigital.com/adhawk/mediaplaystats`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://id.reveldigital.com/connect/authorize`
    - Token URL: `https://id.reveldigital.com/connect/token` scopes: `webapi`
  - API key in header `X-RevelDigital-ApiKey`
  - API key in query parameter `api_key`
- TypeScript: <https://skmtc.dev/reveldigital/apis/revel-digital-rest-api/docs/adhawk/mediaplaystats/get.ts> (a function with typed inputs; its response is checked against the schema)

## Query parameters

- `startDate` string, date-time
- `endDate` string, date-time
- `deviceId` string[]
- `fileId` string[]
- `limit` integer

## Response `200`

OK

- AdHawkMediaPlayStats[]
  - `file_id` string, nullable: The media file ID
  - `file_name` string, nullable: The media file name
  - `total_plays` integer: Total number of times this media was played
  - `total_duration` integer: Total duration of all plays in seconds
  - `avg_duration` number, double, nullable: Average play duration in seconds
  - `device_count` integer: Number of unique devices that played this media

---

[API](https://skmtc.dev/reveldigital/apis/revel-digital-rest-api.md) - [All operations](https://skmtc.dev/reveldigital/apis/revel-digital-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/reveldigital/apis/revel-digital-rest-api/revisions/39d5c8302822?raw)
