Skip to main content

A simple JustWatch Python API

Project description

Simple JustWatch Python API

CodeQL Black Flake8 isort Pytest Coverage Status PyPI - Version

A simple unofficial JustWatch Python API which uses GraphQL to access JustWatch data, built with httpx and Python3.11.

Installation

Project is available in PyPi:

pip install simple-justwatch-python-api

Usage

Currently, there's only one function available - search JustWatch:

from simplejustwatchapi.justwatch import search

results = search("title", "US", "en", 5, True)

Only the first argument is required, it specifies a title to search.

Other arguments in order are:

  1. str country code to search for offers, have to be a 2-letter code, e.g. US, GB, FR, etc. It should be uppercase, however lowercase codes are automatically converted to uppercase. By default US is used.
  2. str language code, usually 2-letter lowercase code, e.g. en, fr, etc. By default en is used.
  3. int how many results should be returned. Actual response can contain fewer entries if fewer are found. By default 4 is used.
  4. bool specify if only best offers should be returned (True) or all offers (False). By default True is used.

Returned value is a list of MediaEntry objects:

class MediaEntry(NamedTuple):
    entry_id: str
    object_id: int
    object_type: str
    title: str
    url: str
    release_year: int
    release_date: str
    genres: list[str]
    imdb_id: str | None
    poster: str
    backdrops: list[str]
    offers: list[Offer]

class Offer(NamedTuple):
    monetization_type: str
    presentation_type: str
    url: str
    price_string: str | None
    price_value: float | None
    price_currency: str
    name: str
    technical_name: str
    icon: str

Disclaimer

This API is in no way affiliated, associated, authorized, endorsed by, or in any way officially connected with JustWatch. This is an independent and unofficial project. Use at your own risk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple-justwatch-python-api-0.6.tar.gz (17.4 kB view details)

Uploaded Source

File details

Details for the file simple-justwatch-python-api-0.6.tar.gz.

File metadata

File hashes

Hashes for simple-justwatch-python-api-0.6.tar.gz
Algorithm Hash digest
SHA256 2dd76ad63241192fc11ed5ec068b28e0a439beffe9499009b09af83cbd5ef54a
MD5 fda02bf53647b6038fe14ea5dee3e4ee
BLAKE2b-256 9d94864516ffd6a47d640fff228880506500a51dcd605765c9f1ea721e72e7a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page