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 simplejustwatchpythonapi.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.4.tar.gz (17.2 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for simple-justwatch-python-api-0.4.tar.gz
Algorithm Hash digest
SHA256 4f480b8aafc5fb20a05aba073f90c8c8454ec5171839348eb90f54ff1cf044c8
MD5 0bbf913d0322b5086d7d833409448db4
BLAKE2b-256 8a4a04c3a89c9f0b8a9d0463c9e62d87b92d52355f37956d5190cf62e1e61f60

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