New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

unofficial-rottentomatoes

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unofficial-rottentomatoes

This unofficial library provides access to movie and TV show information from Rotten Tomatoes. It enables users to retrieve various details such as ratings, reviews, and additional insights, facilitating seamless interaction with Rotten Tomatoes data.

  • 1.0.16
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

Unofficial Rotten Tomatoes Library

This unofficial library provides access to movie and TV show information from Rotten Tomatoes. It enables users to retrieve various details such as ratings, reviews, and additional insights, facilitating seamless interaction with Rotten Tomatoes data.

Project in progress ...

Prerequisites

  • Node.js >= 18.x
  • Yarn >= 1.x

Installation

Using npm

npm install unofficial-rottentomatoes

Using yarn

yarn add unofficial-rottentomatoes

📚 Documentation

Browse Function Documentation

The browse function retrieves a list of media items based on specified filter criteria. This can include ratings, genres, categories, and other parameters defined in the BrowseFilterSchema.

Usage Example
const filter = {
  categories: 'movies_in_theaters',
  genres: ['action', 'comedy'],
  ratings: ['pg_13'],
  audience: ['verified_hot'],
  critics: ['certified_fresh'],
  affiliates: ['netflix'],
  sortBy: 'sort:newest',
  pagination: {
    page: 1
  },
}
const results = await browse(filter)

Browse Filter Schema

The BrowseFilterSchema defines the structure of the data used in the browse function.

FieldTypePossible ValuesDescription
categoriesBrowseCategories'movies_in_theaters', 'movies_at_home', 'movies_coming_soon', 'tv_series_browse'The selected category to filter media items. You can choose one.
genresArray<BrowseGenre>['action', 'adventure', 'animation', 'biography', 'comedy', 'crime', 'documentary', 'drama', 'entertainment', 'faith_and_spirituality', 'fantasy', 'game_show', 'health_and_wellness', 'history', 'holiday', 'horror', 'house_and_garden', 'kids_and_family', 'lgbtq', 'music', 'musical', 'mystery_and_thriller', 'nature', 'news', 'reality', 'romance', 'sci_fi', 'short', 'soap', 'special_interest', 'sports', 'stand_up', 'talk_show', 'travel', 'variety', 'war', 'western']A list of genres to filter media items.
ratingsArray<BrowseRating>['g', 'pg', 'pg_13', 'r', 'nc_17', 'nr', 'ur']A list of ratings to filter media items (e.g., ['pg_13']).
audienceArray<BrowseAudience>['spilled', 'upright', 'verified_hot']A list of audience types to filter media items.
criticsArray<BrowseCritic>['certified_fresh', 'fresh', 'rotten']A list of critic ratings to filter media items.
affiliatesArray<BrowseAffiliate>['apple-tv-plus', 'disney-plus', 'hulu', 'netflix', 'paramount-plus', 'peacock', 'prime-video']A list of affiliates to filter media items.
sortByBrowseSortBy'sort:popular', 'sort:newest', 'sort:top_box_office', 'sort:a_z', 'sort:critic_highest', 'sort:critic_lowest', 'sort:audience_highest', 'sort:audience_lowest'The sort option for the results. Choose one value as a string.
paginationBrowsePagination{ page: number }An object specifying pagination options such as page and limit.

Browse Response Schema

The response from the browse function follows the structure outlined below, which includes media details such as the ID, title, scores, media type, and more.

FieldTypeDescription
idNullOr(String)The unique identifier for the media item. May be null if not available.
titleNullOr(String)The title of the media item. May be null if not available.
criticsScoreNullOr(NumberFromString)The critic's score, if available, parsed as a number from a string. May be null if not available.
audienceScoreNullOr(NumberFromString)The audience score, if available, parsed as a number from a string. May be null if not available.
mediaTypeNullOr(String)The type of media (e.g., "movie" or "tv"). May be null if not available.
posterNullOr(String)The URL of the media poster image. May be null if not available.
releaseDateStringThe release date of the media item, formatted as a string.

Search for Movies or TV Shows

Utilize the search function to find movies or TV shows by their title. This function returns a list of relevant results based on the search query.

import { search } from 'unofficial-rottentomatoes'

const q = 'Harry Potter and the deathly hallows 2'
const results = await search(q)

Search Response Schema

The SearchSchema defines the structure of the data returned by the search API. Below is a detailed description of each field within the schema:

FieldTypeDescription
idString or nullUnique identifier for the search result.
titleString or nullTitle of the movie or TV show.
castArray of Strings or nullArray of cast members.
yearNumber (from string) or nullRelease year as a number.
scoreNumber (from string) or nullRating score as a number.
mediaTypeString or nullType of media (e.g., movie, TV show).
posterString or nullURL of the poster image.

Get Extra Content

Utilize the getExtraContent function to retrieve additional information about a movie or TV show.

import { getExtraContent } from 'unofficial-rottentomatoes'

const id = 'm/harry_potter_and_the_deathly_hallows_part_2'
const result = await getExtraContent(id)

ExtraContent Response Schema

The ExtraContentSchema defines the structure for the additional content retrieved for a media item. Below are the details of each field in the schema:

FieldTypeDescription
synopsisNullOr(String)A brief summary of the media item's plot or storyline.
castAndCrewNullOr(Array)An array of objects containing details about cast and crew. Each object includes:
- name: StringThe name of the cast or crew member.
- role: StringThe role of the individual (e.g., actor, director).
- poster: StringThe URL of the individual's poster image.
- id: StringThe unique identifier for the cast or crew member.
directorNullOr(Array)An array of directors associated with the media item.
producerNullOr(Array)An array of producers associated with the media item.
seasonsNullOr(Array)An array of seasons for TV shows, structured according to SeasonSchema.
screenwriterNullOr(Array)An array of screenwriters associated with the media item.
distributorNullOr(String)The name of the distributor for the media item.
productionCompaniesNullOr(Array)An array of production companies involved in creating the media item.
networkNullOr(String)The network that aired the media item (for TV shows).
ratingNullOr(String)The rating of the media item (e.g., PG, R).
genresNullOr(Array)An array of genres associated with the media item.
originalLanguageNullOr(String)The original language in which the media item was produced.
releaseDateTheatersNullOr(String)The release date of the media item in theaters.
releaseDateStreamingNullOr(String)The release date of the media item for streaming.
boxOfficeGrossNullOr(String)The total box office gross revenue of the media item.
runtimeNullOr(String)The runtime duration of the media item.
soundMixNullOr(Array)An array of sound mixes used in the media item.
promoEndpointNullOr(String)The promo video endpoint (m3u8) for the media item.
episodesNullOr(Array)An array of episodes for TV shows, where each episode includes:
- title: StringThe title of the episode.
- description: StringA brief description of the episode's plot or storyline.
- airDate: StringThe air date of the episode.
- episodeNumber: NumberThe episode number within the season.
- seasonNumber: NumberThe season number to which the episode belongs.

Get TopCritics

import { getTopCritics } from 'unofficial-rottentomatoes'

const id = 'm/harry_potter_and_the_deathly_hallows_part_2'
const row = await getTopCritics(id)

TopCritics Response Schema

The TopCriticsSchema defines the structure for top critic reviews of a specific media item. Each field provides details about a critic's review, including the critic's identity, publication, and additional context for the review.

FieldTypeDescription
reviewerIdNullOr(String)Unique identifier for the reviewer.
reviewerNullOr(String)Name of the reviewer.
publicationNullOr(String)The publication that the review is associated with.
quoteNullOr(String)A quote or excerpt from the review.
originalScoreNullOr(String)The score or rating given by the reviewer, in its original format.
reviewDateNullOr(String)Date when the review was published.
reviewLinkNullOr(String)URL link to the full review.
criticPictureNullOr(String)URL of the critic's picture.

Get Critic

import { getCritic } from 'unofficial-rottentomatoes'

const reviewerId = 'critics/christopher-kelly'
const criticMediaType = 'movies'

const row = await getCritic(reviewerId, mediaType)

Critic Schema

The CriticSchema defines the structure for the data returned by the getCritic function.

CriticsSchema

The CriticsSchema captures the details of a critic's profile, including their biography and individual reviews.

CriticReviewSchema

Each review provided by a critic is structured as follows:

FieldTypeDescription
ratingNullOr(String)Rating provided by the critic in text format.
tomatometerScoreNullOr(NumberFromString)Numeric score on the tomatometer scale.
titleNullOr(String)Title of the media reviewed.
yearNullOr(NumberFromString)Year of the media release.
reviewSnippetNullOr(String)Short excerpt or summary of the review.
publicationNullOr(String)Name of the publication where the review was published.
reviewLinkNullOr(String)URL link to the full review.
reviewDateNullOr(String)Date when the review was published.

CriticBioSchema

The critic's biographical information is captured as follows:

FieldTypeDescription
nameNullOr(String)Name of the critic.
imageNullOr(String)URL to an image of the critic.
approvalStatusNullOr(String)Status of the critic’s approval, if available.
publicationsNullOr(Array(NullOr(String)))List of publications the critic is associated with.
criticsGroupNullOr(String)Name of the critics' group or association.

Full Response Schema Structure

The CriticsSchema combines both the bio and reviews data structures:

FieldTypeDescription
reviewsArray(CriticReviewSchema)Array of individual reviews by the critic.
bioCriticBioSchemaBiographical information of the critic.

:handshake: Contributing

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request

:busts_in_silhouette: Credits

  • Chris Michael (Project Leader, and Developer)

:anger: Troubleshootings

This is just a personal project created for study / demonstration purpose and to simplify my working life, it may or may not be a good fit for your project(s).


:heart: Show your support

Please :star: this repository if you like it or this project helped you!
Feel free to open issues or submit pull-requests to help me improving my work.


:robot: Author

Chris M. Perez

You can follow me on github · twitter


Copyright ©2024 Rotten tomatoes.

Keywords

FAQs

Package last updated on 24 Nov 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