Documentation
Guides and API reference for uploads, image transforms and video.
npm install @cd2/fileboy-react API https://api.fileboy.io
Documentation menu
Video analytics API reference
The video analytics endpoints, generated from the OpenAPI document you can download for code generators and API clients: openapi.json or openapi.yaml. See every endpoint for the rest of the API.
https://api.fileboy.ioViews, unique viewers, watch time, the share watched, completions, call-to-action clicks and retention per video and day, counted by the Fileboy player. Reading them needs your private key (or videos:read); players report viewing with no key, under the video's own read access.
/videos/{id}/viewsReport what a player played
What the Fileboy player (1.8.0+) sends for video analytics, for other players to send too. The body is JSON sent as text/plain (any type is accepted), so navigator.sendBeacon works and no CORS preflight is needed; at most 16 KB. seq counts up from 1 per session: a batch with a seq the session has already had is ignored, so resending is safe. watched is the whole seconds of the video played since the last batch, as [start, end) ranges. Unknown event types are ignored. A batch counts only when the request may read the video (the same fb_* parameters as its stream), the video is ready and version is the one it plays now. Every well-formed batch answers 204, counted or not, so this never says whether a video exists or is private. Rate limits: 240 a minute per address and 30 per session (429 rate_limited with Retry-After); past 6,000 a minute for one video, its batches are dropped (204). Requests from bots are dropped. No cookies are set, and the address and user agent aren't stored: unique viewers are counted by a hash of them with a salt made each day and deleted after two, kept with the sessions for 90 days. View tickets (player 1.9.0+): session and ticket come from analytics in GET /videos/{id}/data. A batch whose ticket isn't for this video and session is dropped (204); a ticket starts its session within two hours of being issued. Batches without a ticket are taken until 1 February 2027, with a lower limit on new sessions. A session starts when the server first hears of it (t is a hint, at most 30 s). At most 60 new sessions per address per video an hour, and 300 per address per app (each counted per API server); past 20,000 new sessions a video a day (100,000 an app), a session only adds to overflowPlays and watch time. Quality of experience (with qoe: 1): startup, rebuffers, rebuffered, errors and renditions are clamped, never refused.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | The video's id. |
fb_exp | query | string | A signed URL's expiry, for a private video (see ReadSignature). |
fb_sig | query | string | A signed URL's signature, for a private video. |
fb_grant | query | string | A password video's playback grant (POST /videos/{id}/unlock). |
fb_link | query | string | A video link's token, for a video shared with an expiring link. |
Request body
text/plainsession * | string | The session id from the view ticket (analytics.session in the video's data). Players before 1.9.0 make a random one. |
ticket | string | The view ticket (analytics.ticket in the video's data). |
seq * | integer | |
version * | integer | |
played | number | Seconds since the last batch. |
watched | integer[][] | Whole seconds played, as [start, end) ranges. |
events | object[] | |
t | number | Seconds since the session began. Only a hint: at most 30 s of it is used. |
qoe | "1" | 1 on every batch of a player that reports quality of experience. |
startup | number | Seconds from pressing play to the first frame, once per session (at most 120 counts). |
rebuffers | integer | Stalls while playing since the last batch (at most 100 count). |
rebuffered | number | Seconds of those stalls. |
errors | object[] | |
renditions | number[][] | [height, seconds played at it] since the last batch. |
page | string | The host of the page the player is on (player 1.17.0+); for Fileboy's embed page in an iframe, the site framing it. Ignored when the request's Origin is another site, which names the page instead. Host only. |
ref | string | The host of the page's referrer (player 1.17.0+). Host only. |
viewer | string | A signed-in viewer's session: the viewer-session of Fileboy's pages or a sign-in hand-off's (player 1.17.0+). Names the viewer in viewers of the video's analytics. One that doesn't check out is ignored and the batch counts anonymously. |
viewerToken | string | The app's viewer token for its signed-in user (see /docs/video/reactions-and-comments), instead of viewer (player 1.17.0+). |
Responses
204 | Taken (or quietly dropped). |
400 | An error. error is a short code and message says what went wrong.application/json |
413 | An error. error is a short code and message says what went wrong.application/json |
429 | An error. error is a short code and message says what went wrong.application/json |
/videos/{id}/analyticsGet a video's analytics
Totals and one row per UTC day from from to to (both included, at most 366 days; days with nothing are zeroes), the retention curve of the version the video plays now, or of version, and the quality of experience (qoe: start-up time, rebuffering and errors, from players 1.9.0+). Without version, when the current version has no curve yet (a blur makes a new version, say), it is the newest version's that has one; retention.version says which. A view is a playback of at least 3 seconds (half the video under 6 seconds); a completion is 90% of the video watched; unique viewers are counted once a day. Figures are added about every 30 minutes, once a playback has stopped.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | The video's id. |
from | query | string (date) | The first UTC day, YYYY-MM-DD. Default: 29 days before to. |
to | query | string (date) | The last UTC day, YYYY-MM-DD. Default: today. |
version | query | integer | The version whose retention curve to return. Default: the current one. |
X-Fileboy-App | header | string (uuid) | With a personal access token: the id of the app the request is for. Ignored for an app's own keys and scoped keys. |
Responses
200 | The video's figures.application/json |
400 | An error. error is a short code and message says what went wrong.application/json |
401 | No key was sent.application/json |
403 | An error. error is a short code and message says what went wrong.application/json |
404 | An error. error is a short code and message says what went wrong.application/json |
/analytics/videosGet your videos' analytics
Every video of the app together, per UTC day, and the top videos by a figure. Unique viewers count a person once a day across all the app's videos, and are null for a range reaching back more than 90 days.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
from | query | string (date) | The first UTC day, YYYY-MM-DD. Default: 29 days before to. |
to | query | string (date) | The last UTC day, YYYY-MM-DD. Default: today. |
sort | query | "views" | "watchSeconds" | "completions" | "ctaClicks" | What the top videos are ranked by. |
limit | query | integer | How many top videos. |
X-Fileboy-App | header | string (uuid) | With a personal access token: the id of the app the request is for. Ignored for an app's own keys and scoped keys. |
Responses
200 | The app's figures.application/json |
400 | An error. error is a short code and message says what went wrong.application/json |
401 | No key was sent.application/json |
403 | An error. error is a short code and message says what went wrong.application/json |