Appearance
Video API
The Video API allows to easily pull up custom clips or create your own playlists for NBA, G League, or Summer League games for which we have video.
API Host
Video API requests should be made to:
https://api.cleaningtheglass.com/video/This host is separate from the data feed host (https://api.cleaningtheglass.com/pro/).
Authentication
Video API requests need a Video API key, which we will provide to you. It is a different key from your data feed key. Include it in the X-API-KEY header of every request:
bash
curl --request GET \
--url 'https://api.cleaningtheglass.com/video/available_game_periods?league=NBA&date=2026-10-12' \
--header 'X-API-KEY: YOUR_VIDEO_API_KEY'Available Leagues
Your Video API key gives you video for these leagues:
league value | League |
|---|---|
NBA | NBA regular season, preseason, and playoffs |
GLEAGUE | NBA G League |
NBASL | NBA Summer League |
Pass these exact values wherever an endpoint takes a league parameter.
Endpoints
| Endpoint | Description |
|---|---|
GET /available_game_periods | List the games and periods that have video, with each game's game_id_nba and video game_id |
GET /clip | Generate one clip and get a URL to stream or download it |
POST /create_playlist/ctg_ids | Create a playlist from data feed marking IDs |
POST /create_playlist/csv | Create a playlist from game, period, and time rows |
GET /playlist/<playlist_id> | Read the clips in a playlist |
POST /save_playlist_for_users | Save a copy of a playlist to the saved playlists of users in your organization |
GET /download_clip | Download one playlist clip as an MP4 |
GET /download_clips | Download up to 20 playlist clips as a ZIP |
POST /playlist_download_jobs | Start a background download of up to 400 playlist clips |
GET /playlist_download_jobs/<job_id> | Check a background download and get its link |
GET /period | Get a URL for a full period of video |
POST /flag_clip | Report a clip that is wrong or does not play |
Quick Start
The fastest way to watch data feed markings is to create a playlist from their IDs. Every marking in the data feed has an ID ending in _id_ctg, such as shot_id_ctg or chance_id_ctg:
bash
curl --request POST \
--url 'https://api.cleaningtheglass.com/video/create_playlist/ctg_ids' \
--header 'X-API-KEY: YOUR_VIDEO_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"ids_string": "shot_8c0ae4ab89d51034a17dcf2cde9a179f\nchance_43b2166610037e91ab6fa6654fcdb0b8"}'Open the returned playlist_id in the CTG video player at https://pro.cleaningtheglass.com/video/<playlist_id>, or download the clips.
Game IDs
The /clip, /period, CSV playlist, and flagging endpoints identify a game in one of two ways:
game_id_nba: the NBA game ID used throughout the data feed, such as0022400121. NBA, G League, and Summer League games have one.game_id: the video game ID, a UUID such as00124539-08e3-4174-bd7f-db5e96a904fb. Every game with video has one, including older G League and Summer League games that have no NBA game ID.
Pass one or the other. If you pass both, game_id is used. A game_id_nba with no video returns a 404 error.
To find video game IDs, call /available_game_periods. Each result includes both game_id and game_id_nba.
You do not need game IDs to create a playlist from data feed marking IDs.
Times
Clips start from one of two kinds of time:
- Game clock: seconds left in the period, such as
581for 9:41. A game clock can repeat during stoppages, so the clip starts at the first moment that matches. - Timestamp: wall clock time in epoch milliseconds, such as
1760313046939. A timestamp identifies one exact moment. Data feed*_wall_clockfields hold this time as an ISO 8601 string. Convert it to epoch milliseconds to use it here.
Errors
Error responses are JSON with the message under a result key, for example:
json
{
"result": "Error: required `game_id` parameter is missing or empty",
"clip_url": null
}| Scenario | HTTP Status |
|---|---|
| Missing or invalid API key | 403 |
| Key lacks access to the requested league | 403 |
| Missing or invalid parameter | 400 |
| Playlist clip or download job not found | 404 |
| No video for the requested game and period | 404 |
