Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

justwatch_client

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

justwatch_client

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

Justwatch client

Ruby Client for JustWatch API

How to configure

If you are using Rails, the better way is to define an initializer in config/initializers, defining the default locale and the token (we encourage to not push the token to the repo).

# config/initializers/justwatch.rb

JustWatch::Api.locale = 'es_ES'
JustWatch::Api.token = ENV.fetch('JUSTWATCH_API_TOKEN', nil)

The locale defined here is the default, you can override it in the different calls.

General Provider Info

We can fetch the data for providers with the following call:

JustWatch::Provider.list(locale:)
ParameterExplanationExample values
locale (optional)Locale you are searching fores_ES, en_US

Genres list

We can fetch the genre list with the following call:

JustWatch::Genre.list(locale:)
ParameterExplanationExample values
locale (optional)Locale you are searching fores_ES, en_US

Country list

We can fetch the country list with the following call:

JustWatch::Country.list(locale:)
ParameterExplanationExample values
locale (optional)Locale you are searching fores_ES, en_US

Movie offers by ID

We can fetch the data for a movie using a service ID with the following call:

JustWatch::Movie.offers_by_id(id:, service_id_type:, locale:)
ParameterExplanationExample values
idTMDB, IMDB or Justwatch ID12345, tt0125439, 39130
service_id_typeService for which the ID has been providedtmdb, imdb or justwatch
locale (optional)Locale you are searching fores_ES, en_US

Movie offers by title and year

We can fetch the data for a movie using title and year with the following call:

JustWatch::Movie.offers_by_title_and_year(title:, year:, locale: Api.locale)
ParameterExplanationExample values
titleMovie title12 monkeys, The Shining
yearMovie release year1999, 2021
locale (optional)Locale you are searching fores_ES, en_US

TvShow offers by ID

We can fetch the data for a tv show using a service ID with the following call:

JustWatch::TvShow.offers_by_id(id:, service_id_type:, locale:)
ParameterExplanationExample values
idTMDB, IMDB or Justwatch ID12345, tt0125439, 39130
service_id_typeService for which the ID has been providedtmdb, imdb or justwatch
locale (optional)Locale you are searching fores_ES, en_US

TvShow offers by title and year

We can fetch the data for a tv show using the tv show title and the year with the following call:

JustWatch::TvShow.offers_by_title_and_year(title:, year:, locale:)
ParameterExplanationExample values
titleTv show titleHouse, Lost
yearTv show release year2004, 2021
locale (optional)Locale you are searching fores_ES, en_US

Season offers by id and season number

We can fetch the data for a season using the tv show ID and the season number with the following call:

JustWatch::Season.offers_by_id_and_season_number(id:, service_id_type:, season_number:, locale:)
ParameterExplanationExample values
idTMDB, IMDB or Justwatch tv show ID12345, tt0125439, 39130
service_id_typeService for which the ID has been providedtmdb, imdb or justwatch
locale (optional)Locale you are searching fores_ES, en_US

Season offers by title, year and season number

We can fetch the data for a season using the tv show tv show title, year and season number with the following call:

JustWatch::Season::offers_by_title_year_and_season_number(title:, year:, season_number:, locale:)
ParameterExplanationExample values
titleTv show titleHouse, Lost
yearTv show release year2004, 2021
season_numberTv show season number1, 2
locale (optional)Locale you are searching fores_ES, en_US

Troubleshoot

Locale

Your JustWatch account is restricted to a bunch of locales. If you are getting Unauthorized errors this could be the reason.

FAQs

Package last updated on 14 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc