Data structures¶
Data structures for parsed JustWatch API responses.
Each response is parsed into a NamedTuple for easy access to
each field and type checking. Each function available in this library is returning
one (or more) of these structures.
Some of the returned fields are marked optional (with | None), as they might be
missing from the API response. I tried to only mark fields as optional when they are
actually optional, based on my own testing. However, if you need maximum safety you
might need to treat all fields as optional, as there is no guarantee what the API
will return.
| CLASS | DESCRIPTION |
|---|---|
Episode |
Parsed data related to a single episode. |
Interactions |
Parsed data regarding number of likes and dislikes on JustWatch for a single entry. |
MediaEntry |
Parsed full details for a single entry. |
Offer |
Parsed single offer from JustWatch GraphQL API for a single entry. |
OfferPackage |
Parsed single offer package from one provider from JustWatch GraphQL API. |
Scoring |
Parsed data related to user scoring for a single entry. |
StreamingCharts |
Parsed data related to JustWatch rank for a single entry. |
Episode
¶
Bases: NamedTuple
Parsed data related to a single episode.
It's a subset of fields available in MediaEntry.
| ATTRIBUTE | DESCRIPTION |
|---|---|
episode_id |
Episode ID, contains type code and numeric ID.
TYPE:
|
object_id |
Object ID, the numeric part of full episode ID.
TYPE:
|
object_type |
Type of entry, for episodes should be
TYPE:
|
title |
Full title.
TYPE:
|
release_year |
Release year as a number.
TYPE:
|
release_date |
Full release date as a string, e.g.
TYPE:
|
runtime_minutes |
Runtime in minutes.
TYPE:
|
short_description |
Short description of this episode.
TYPE:
|
episode_number |
Number of this episode.
TYPE:
|
season_number |
Season number with this episode.
TYPE:
|
offers |
List of available offers for this episode, empty if there are no available offers. |
Interactions
¶
Bases: NamedTuple
Parsed data regarding number of likes and dislikes on JustWatch for a single entry.
| ATTRIBUTE | DESCRIPTION |
|---|---|
likes |
Number of likes on JustWatch.
TYPE:
|
dislikes |
Number of dislikes on JustWatch.
TYPE:
|
MediaEntry
¶
Bases: NamedTuple
Parsed full details for a single entry.
Used by multiple functions in this library, e.g.,
details,
search,
seasons.
Some details might be specific for different media types, e.g. total_episode_count
is only relevant for seasons, total_season_count for seasons and shows, etc.
For non-relevant fields, the value is None.
| ATTRIBUTE | DESCRIPTION |
|---|---|
entry_id |
Entry ID, contains type code and numeric ID.
TYPE:
|
object_id |
Object ID, the numeric part of full entry ID.
TYPE:
|
object_type |
Type of entry, e.g.
TYPE:
|
title |
Full title.
TYPE:
|
url |
URL to JustWatch with details for this entry.
TYPE:
|
release_year |
Release year as a number.
TYPE:
|
release_date |
Full release date as a string, e.g.
TYPE:
|
runtime_minutes |
Runtime in minutes.
TYPE:
|
short_description |
Short description of this entry.
TYPE:
|
genres |
List of genre codes for this entry,
e.g. |
imdb_id |
ID of this entry in IMDB.
TYPE:
|
tmdb_id |
ID of this entry in TMDB.
TYPE:
|
poster |
URL to poster for this ID.
TYPE:
|
backdrops |
List of URLs for backdrops (full screen images to use as background). |
age_certification |
Age rating as a string, e.g.:
TYPE:
|
scoring |
Scoring data.
TYPE:
|
interactions |
Interactions (likes/dislikes) data.
TYPE:
|
streaming_charts |
JustWatch charts/ranks data.
TYPE:
|
offers |
List of available offers for this entry, empty if there are no available offers. |
total_season_count |
Total season count,
for non-shows it's always
TYPE:
|
total_episode_count |
Total number of episodes in this season,
for non-seasons it's always
TYPE:
|
season_number |
Number of this season,
for movies it's always
TYPE:
|
episode_number |
Number of this episode,
for non-episodes it's always
TYPE:
|
Offer
¶
Bases: NamedTuple
Parsed single offer from JustWatch GraphQL API for a single entry.
One platform can have multiple offers for one entry available, e.g., renting, buying, streaming; each with different prices, etc.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
Offer ID.
TYPE:
|
monetization_type |
Type of monetization of this offer,
e.g.
TYPE:
|
presentation_type |
Quality of media in this offer, e.g.
TYPE:
|
price_string |
Current price as a string with currency, suitable for
displaying to users. Format can change based on used
TYPE:
|
price_value |
Current price as a numeric value.
TYPE:
|
price_currency |
Represents only currency, without price, or value.
TYPE:
|
last_change_retail_price_value |
Previous available price if change in price was recorded.
TYPE:
|
type |
Type of offer.
TYPE:
|
package |
Information about platform on which this offer is available.
TYPE:
|
url |
URL to this offer.
TYPE:
|
element_count |
Element count, usually
TYPE:
|
available_to |
Date until which this offer will be available.
TYPE:
|
deeplink_roku |
Deeplink to this offer in Roku.
TYPE:
|
subtitle_languages |
List of 2-letter language codes of available
subtitles, e.g. |
video_technology |
List of known video technologies available in this
offer, e.g. |
audio_technology |
List of known audio technologies available in this
offer, e.g. |
audio_languages |
List of 2-letter language codes of available audio
tracks, e.g. |
OfferPackage
¶
Bases: NamedTuple
Parsed single offer package from one provider from JustWatch GraphQL API.
Contains information about platform (e.g., Netflix, Hulu) on which given offer
is available. Also used by providers
function to return data about all available providers.
| ATTRIBUTE | DESCRIPTION |
|---|---|
id |
ID of the provider/platform for this offer.
TYPE:
|
package_id |
Package ID. I'm not sure how it's different from regular
TYPE:
|
name |
Name of the platform in format suited to display for users.
TYPE:
|
technical_name |
Technical name of the platform, usually all lowercase with no whitespaces.
TYPE:
|
short_name |
3-letter provider name.
TYPE:
|
monetization_types |
List of monetization types available for this
provider (e.g., |
icon |
Platform icon URL.
TYPE:
|
Scoring
¶
Bases: NamedTuple
Parsed data related to user scoring for a single entry.
| ATTRIBUTE | DESCRIPTION |
|---|---|
imdb_score |
IMDB score.
TYPE:
|
imdb_votes |
Number of votes on IMDB.
TYPE:
|
tmdb_popularity |
TMDB popularity score.
TYPE:
|
tmdb_score |
TMDB score.
TYPE:
|
tomatometer |
Tomatometer score on Rotten Tomatoes.
TYPE:
|
certified_fresh |
Flag whether entry has "Certified Fresh" seal on Rotten Tomatoes.
TYPE:
|
jw_rating |
JustWatch rating.
TYPE:
|
StreamingCharts
¶
Bases: NamedTuple
Parsed data related to JustWatch rank for a single entry.
| ATTRIBUTE | DESCRIPTION |
|---|---|
rank |
Rank on JustWatch.
TYPE:
|
trend |
Trend in ranking on JustWatch,
TYPE:
|
trend_difference |
Difference in rank; related to trend.
TYPE:
|
top_rank |
Top rank ever reached.
TYPE:
|
days_in_top_3 |
Number of days in top 3 ranks.
TYPE:
|
days_in_top_10 |
Number of days in top 10 ranks.
TYPE:
|
days_in_top_100 |
Number of days in top 100 ranks.
TYPE:
|
days_in_top_1000 |
Number of days in top 1000 ranks.
TYPE:
|
updated |
Date when rank data was last updated as a string,
e.g.:
TYPE:
|