Content types and ids
webstats('content', ...) takes a type and one or more ids. type is a closed list of 12
values. Providers inside ids are open: any provider: id pair is accepted and stored.
The 12 types
Section titled “The 12 types”type |
Providers, primary first | Example (one is enough) |
|---|---|---|
movie |
tmdb, imdb |
{ tmdb: '278' } |
tvshow |
tmdb, tvdb, imdb |
{ tmdb: '1399' } |
anime |
mal, anilist |
{ mal: '16498' } |
manga |
mal, anilist |
{ mal: '2' } |
music |
mbid |
{ mbid: '5b11f4ce-a62d-471e-81fc-a69a8278c7da' } |
audiobook |
asin, olid |
{ asin: 'B002V1OF70' } |
book |
isbn, olid |
{ isbn: '9780140328721' } |
comic |
cv |
{ cv: '4000-1699' } |
videogame |
igdb |
{ igdb: '1020' } |
podcast |
podcastindex |
{ podcastindex: '75075' } |
sport |
tsdb, sr |
{ tsdb: '133602' } |
person |
wd |
{ wd: 'Q937' } |
One id is enough; extra ids improve catalog matching. The primary provider forms the stored
key, so send it when you have it. IMDb ids keep their tt prefix; every other id is the raw
value.
A type outside this list is rejected and the declaration is dropped.
Series and episodes
Section titled “Series and episodes”For tvshow, anime, and podcast, the top-level ids are the series. The episode block is
optional and gives you per-episode numbers on top of the series total.
webstats('content', { type: 'tvshow', ids: { tmdb: '1399' }, title: 'Game of Thrones', episode: { ids: { tmdb: '63056' }, season: 1, number: 1, title: 'Winter Is Coming' },});Every field in episode is optional, including ids.
No catalog id
Section titled “No catalog id”Use self with any stable id of your own:
webstats('content', { type: 'movie', ids: { self: 'film-9931' }, title: 'Our Original Film' });Cross-source matching is skipped, everything else works. Any unrecognised provider is accepted and stored the same way; it may just not be enriched with poster and metadata yet.
Live streams
Section titled “Live streams”sport has no fixed duration, so completion, retention, and the 25/50/75/100% milestones are
skipped automatically. Engagement and playback quality still record.
Limits
Section titled “Limits”| Rule | Limit |
|---|---|
| Providers per declaration | 12 |
| Provider name | 24 characters |
| Id value | 128 characters |
title |
256 characters |
Ids beyond the limit are dropped, not rejected. An empty ids object drops the declaration.