Skip to content

Commit f986f71

Browse files
committed
Add video GET /current endpoint docs
1 parent 0950007 commit f986f71

File tree

1 file changed

+65
-21
lines changed

1 file changed

+65
-21
lines changed

source/includes/_analytics.md

Lines changed: 65 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,21 @@
1-
# Analytics
1+
# Video analytics (VOD)
22

3-
## Video analytics
4-
5-
### Get analytics for a specific video
3+
## Get analytics for a specific video
64

75
This endpoint is used to query anlytics for a specific video. It returns view and display counts and segments view counts.
86
A `view` is counted when playback starts and a `display` happens when the video player is shown for this video.
97

108
The video timeline is divided into 100 `segments`. The return value of this endpoint includes view counts for each of
119
these 100 segments.
1210

13-
### HTTP Request
14-
15-
`GET http://localhost:3000/videos/:id`
16-
17-
### Request parameters
18-
19-
Parameter | Description
20-
--------- | -------------------------------------
21-
starts | Optional starting date/time of the interval, format `YYY-MM-DDTHH` or `YYY-MM-DD`
22-
ends | optional ending date/time of the interval, format `YYY-MM-DDTHH` or `YYY-MM-DD`
23-
24-
25-
2611
> Get analytics for video with ID 360b8f49-3c98-4020-ac72-83f958405239
2712
2813
```shell
29-
curl "http://localhost:3000/videos/360b8f49-3c98-4020-ac72-83f958405239" \
14+
curl "https://api.flowplayer.com/videos/360b8f49-3c98-4020-ac72-83f958405239" \
3015
-H 'Content-Type: application/json; charset=utf-8' \
3116
-d $'{
32-
"ends": "2017-12-31T00",
33-
"starts": "2017-12-01T00"
17+
"end": "2017-12-31T00",
18+
"start": "2017-12-01T00"
3419
}'
3520
```
3621

@@ -50,4 +35,63 @@ curl "http://localhost:3000/videos/360b8f49-3c98-4020-ac72-83f958405239" \
5035
}
5136
```
5237

53-
## Live
38+
### HTTP Request
39+
40+
`GET https://api.flowplayer.com/videos/:id`
41+
42+
### Request parameters
43+
44+
Parameter | Description
45+
--------- | -------------------------------------
46+
start | Optional starting date/time of the interval, format `YYY-MM-DDTHH` or `YYY-MM-DD`
47+
end | optional ending date/time of the interval, format `YYY-MM-DDTHH` or `YYY-MM-DD`
48+
49+
50+
## Current viewers
51+
52+
This endpoint returns the current view count matching the specified parameters.
53+
54+
> Get current number of viewers for all videos belonging to the site group
55+
56+
```shell
57+
curl "https://api.flowplayer.com/current"
58+
```
59+
60+
> returns the the estimated number of viewers
61+
62+
```json
63+
{"views":250}
64+
```
65+
66+
> Get current number of viewers for one video
67+
68+
```shell
69+
curl "https://api.flowplayer.com/current?id=360b8f49-3c98-4020-ac72-83f958405239"
70+
```
71+
72+
> Get current number of viewers for two videos
73+
74+
```shell
75+
curl "https://api.flowplayer.com/current?id=[360b8f49-3c98-4020-ac72-83f958405239,00048d7e-7ffb-46ee-ae21-e49b3668fea8]"
76+
```
77+
78+
### HTTP Request
79+
80+
`/videos/:id/current`
81+
82+
### Request parameters
83+
84+
The query can be restricted to one or more videos, and/or to one or more sites. The query will match all videos in all sites
85+
in the account's site group, if no `site` not `id` is passed as a parameter.
86+
87+
Parameter | Description
88+
--------- | -------------------------------------
89+
id | optional video ID, or a list of several IDs
90+
site | optional site ID, or a list of site IDs
91+
92+
### Errors
93+
94+
HTTP status | Description
95+
----------- | --------------------------------------------
96+
404 | if the specified site or video is not found
97+

0 commit comments

Comments
 (0)