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.7.tar.gz (17.4 kB view hashes)

Uploaded Source

Supported by

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