Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OMDb API Rotten Tomatoes

Tags:

curl

api

omdbapi

I believe this may just be a bug in the OMDb API. But I am hoping that someone can point out the errors in my ways.

I am trying to include the Rotten Tomatoes Ratings in a output. But no matter what options I try I don't get anything.

curl http://www.omdbapi.com/?t=Iron+Man&y=&plot=short&tomatoes=true&r=json

Output:

   {
             :Title => "Iron Man",
              :Year => "2008",
             :Rated => "PG-13",
          :Released => "02 May 2008",
           :Runtime => "126 min",
             :Genre => "Action, Adventure, Sci-Fi",
          :Director => "Jon Favreau",
            :Writer => "Mark Fergus (screenplay), Hawk Ostby (screenplay), Art Marcum (screenplay), Matt Holloway (screenplay), Stan Lee (characters), Don Heck (characters), Larry Lieber (characters), Jack Kirby (characters)",
            :Actors => "Robert Downey Jr., Terrence Howard, Jeff Bridges, Gwyneth Paltrow",
              :Plot => "After being held captive in an Afghan cave, an industrialist creates a unique weaponized suit of armor to fight evil.",
          :Language => "English, Persian, Urdu, Arabic, Hungarian",
           :Country => "USA",
            :Awards => "Nominated for 2 Oscars. Another 17 wins & 52 nominations.",
            :Poster => "http://ia.media-imdb.com/images/M/MV5BMTczNTI2ODUwOF5BMl5BanBnXkFtZTcwMTU0NTIzMw@@._V1_SX300.jpg",
         :Metascore => "79",
        :imdbRating => "7.9",
         :imdbVotes => "629,489",
            :imdbID => "tt0371746",
              :Type => "movie",
          :Response => "True"
    }

Reference: http://www.omdbapi.com/

Update

In case anyone runs across this (me) again. Here's the expected output with tomatoes:

{
                :Title => "Iron Man",
                 :Year => "2008",
                :Rated => "PG-13",
             :Released => "02 May 2008",
              :Runtime => "126 min",
                :Genre => "Action, Adventure, Sci-Fi",
             :Director => "Jon Favreau",
               :Writer => "Mark Fergus (screenplay), Hawk Ostby (screenplay), Art Marcum (screenplay), Matt Holloway (screenplay), Stan Lee (characters), Don Heck (characters), Larry Lieber (characters), Jack Kirby (characters)",
               :Actors => "Robert Downey Jr., Terrence Howard, Jeff Bridges, Gwyneth Paltrow",
                 :Plot => "After being held captive in an Afghan cave, an industrialist creates a unique weaponized suit of armor to fight evil.",
             :Language => "English, Persian, Urdu, Arabic, Hungarian",
              :Country => "USA",
               :Awards => "Nominated for 2 Oscars. Another 19 wins & 58 nominations.",
               :Poster => "http://ia.media-imdb.com/images/M/MV5BMTczNTI2ODUwOF5BMl5BanBnXkFtZTcwMTU0NTIzMw@@._V1_SX300.jpg",
            :Metascore => "79",
           :imdbRating => "7.9",
            :imdbVotes => "635,229",
               :imdbID => "tt0371746",
                 :Type => "movie",
          :tomatoMeter => "94",
          :tomatoImage => "certified",
         :tomatoRating => "7.7",
        :tomatoReviews => "266",
          :tomatoFresh => "249",
         :tomatoRotten => "17",
      :tomatoConsensus => "Director Jon Favreau and star Robert Downey Jr. make this smart, high impact superhero movie one that even non-comics fans can enjoy.",
      :tomatoUserMeter => "91",
     :tomatoUserRating => "4.2",
    :tomatoUserReviews => "1072111",
                  :DVD => "30 Sep 2008",
            :BoxOffice => "$318.3M",
           :Production => "Paramount Pictures",
              :Website => "http://www.ironmanmovie.com/",
             :Response => "True"
}
like image 549
Dishcandanty Avatar asked Nov 24 '15 04:11

Dishcandanty


People also ask

Does Rotten Tomatoes have API?

The Rotten Tomatoes API is RESTful web service that was designed to be easy to explore and use. Developers can use the API to access the Rotten Tomatoes' database of movie data by using the Lists, Movies, or DVDs sections of the API.

How do I get OMDb API?

First, get your OMDb API key. For that, You have to sign up from their website. If you haven't already, sign up for an account at http://www.omdbapi.com/apikey.aspx. You'll be sent a verification link containing your API key.

What is OMDb API key?

The OMDb API is a RESTful web service to obtain movie information, all content and images on the site are contributed and maintained by our users. If you find this service useful, please consider making a one-time donation or become a patron.


1 Answers

Well, you have to wrap your url inside the quote. Otherwise the & causing you the problem by breaking the command on that position.

curl "http://www.omdbapi.com/?t=Iron+Man&y=&plot=short&tomatoes=true&r=json"
like image 154
Sabuj Hassan Avatar answered Oct 03 '22 18:10

Sabuj Hassan