# the-rotten-api

> A Node.js wrapper for the Rotten Tomatoes API v1.0

Latest version **1.1.0** (published 2016-01-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install the-rotten-api
pnpm add the-rotten-api
yarn add the-rotten-api
bun add the-rotten-api
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-01-10 |
| First published | 2016-01-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Gabriel Montalvo |
| Maintainers | gamr |
| Keywords | rottentomatoes, api |

## Links

- npm: https://www.npmjs.com/package/the-rotten-api
- Repository: https://github.com/gmontalvoriv/the-rotten-api
- Homepage: https://github.com/gmontalvoriv/the-rotten-api#readme
- Issues: https://github.com/gmontalvoriv/the-rotten-api/issues
- npm.io page: https://npm.io/package/the-rotten-api

## Dependencies (1)

- [xmlhttprequest](https://npm.io/package/xmlhttprequest.md) ^1.8.0

## Recent versions

- 1.1.0 (latest) — 2016-01-10
- 1.0.0 — 2016-01-09

## README

# The Rotten API

`the-rotten-api` is a Node.js wrapper for the [Rotten Tomatoes API v1.0](http://developer.rottentomatoes.com/docs).

## Installation

```
$ npm install --save the-rotten-api
```

## Usage Examples

#### Movie search:

```javascript
var rt = require('the-rotten-api');
rt.apiKey('your-api-key');

rt.movies('in_theaters', function(err, data) {
  if (err) { console.log(err); }
  
  console.log(data);
  
  /*
  { 
       id: '771321699',
       title: 'Star Wars: Episode VII - The Force Awakens',
       year: 2015,
       mpaa_rating: 'PG-13',
       runtime: 136,
       critics_consensus: '',
       release_dates: [Object],
       ratings: [Object],
       synopsis: 'The Star Wars saga continues with this seventh entry -- the first under the Walt Disney Co. umbrella. The film will act as the start of a new trilogy set after the events of Return of the Jedi. J.J. Abrams directs from a script by Michael Arndt. ~ Jeremy Wheeler, Rovi',
       posters: [Object],
       abridged_cast: [Object],
       alternate_ids: [Object],
       links: [Object] 
  },
  ...
  */
}
```

#### Movie info:

```javascript
var rt = require('the-rotten-api');
rt.apiKey('your-api-key');

var movieId = 12897;

rt.info(movieId, function(err, data) {
  console.log('Title: ' + data.title);
  console.log('Year: ' + data.year);
}

/*
    Title: The Matrix
    Year: 1999
*/
```

## Methods

#### `Search`

Search for movies.

`.search(query | [options], callback)`

***Options:***

Name | Description | Type | Required |
-----|------------ |------|----------|
query| The plain text search query to search for a movie.| `String` | Yes |
page | The selected page of movie search results | `Number` | No |
pageLimit | The amount of movie search results to show per page | `Number` | No |


#### `Lists`

Rotten Tomatoes available lists.

`.lists(directory, callback)`

Name | Description | Type | Required |
-----|------------ |------|----------|
movies| Shows the movie lists we have available | `String` | No |
dvds | Shows the DVD lists we have available | `String` | No |
`empty string` | Displays the top level lists available in the API. | `String` | Yes |

#### `info`

Detailed information on a specific movie specified by Id. You can also limit the results to `cast` and `reviews`.

`.info(id | [options], callback)`

Name | Description | Type | Required |
-----|------------ |------|----------|
id | The movie's id | `Number` | Yes |
limitTo | `cast` or `reviews` | `String` | No |

#### `movies`

`.movies(list | [options], callback)`

Search for a specific list of movies.

Name | Description | Type | Required |
-----|------------ |------|----------|
list| `box_office`, `in_theaters`, `opening`, `upcoming`| `String` | Yes |
limit | Limits the number of box office movies returned | `Number` | No |
page | The selected page of in theaters movies | `Number` | No |
country | Provides localized data for the selected country (ISO 3166-1 alpha-2) if available. Otherwise, returns US data. | `String` | No |
## Contribution

Contributions are welcome.

`git clone` the Github repository:

```
$ git clone https://github.com/gmontalvoriv/the-rotten-api.git
```

## License

[MIT](https://github.com/gmontalvoriv/nyt-top/blob/master/LICENSE)

---
_Source: https://npm.io/package/the-rotten-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
