make query http://www.omdbapi.com/?t=moviename
it will return JSON response (default)
example
http://www.omdbapi.com/?t=Fight Club (in browser)
note : while coding space in movie title should be replaced with %20
"Title":"Fight Club",
"Year":"1999",
"Rated":"R",
"Released":"15 Oct 1999",
"Runtime":"2 h 19 min",
"Genre":"Drama",
"Director":"David Fincher",
"Writer":"Chuck Palahniuk, Jim Uhls",
"Actors":"Brad Pitt, Edward Norton, Helena Bonham Carter, Meat Loaf",
"Plot":"An insomniac office worker looking for a way to change his life crosses paths with a devil-may-care soap maker and they form an underground fight club that evolves into something much, much more...",
"Poster":"http://ia.media-imdb.com/images/M/MV5BMjIwNTYzMzE1M15BMl5BanBnXkFtZTcwOTE5Mzg3OA@@._V1_SX300.jpg",
"imdbRating":"8.9",
"imdbVotes":"727,988",
"imdbID":"tt0137523",
"Type":"movie",
"Response":"True"
}
<movie title="Fight Club" year="1999" rated="R" released="15 Oct 1999" runtime="2 h 19 min" genre="Drama" director="David Fincher" writer="Chuck Palahniuk, Jim Uhls" actors="Brad Pitt, Edward Norton, Helena Bonham Carter, Meat Loaf" plot="An insomniac office worker looking for a way to change his life crosses paths with a devil-may-care soap maker and they form an underground fight club that evolves into something much, much more..." poster="http://ia.media-imdb.com/images/M/MV5BMjIwNTYzMzE1M15BMl5BanBnXkFtZTcwOTE5Mzg3OA@@._V1_SX300.jpg" imdbRating="8.9" imdbVotes="727,988" imdbID="tt0137523" type="movie"/>
</root>
it will return JSON response (default)
example
http://www.omdbapi.com/?t=Fight Club (in browser)
note : while coding space in movie title should be replaced with %20
JSON response:
{"Title":"Fight Club",
"Year":"1999",
"Rated":"R",
"Released":"15 Oct 1999",
"Runtime":"2 h 19 min",
"Genre":"Drama",
"Director":"David Fincher",
"Writer":"Chuck Palahniuk, Jim Uhls",
"Actors":"Brad Pitt, Edward Norton, Helena Bonham Carter, Meat Loaf",
"Plot":"An insomniac office worker looking for a way to change his life crosses paths with a devil-may-care soap maker and they form an underground fight club that evolves into something much, much more...",
"Poster":"http://ia.media-imdb.com/images/M/MV5BMjIwNTYzMzE1M15BMl5BanBnXkFtZTcwOTE5Mzg3OA@@._V1_SX300.jpg",
"imdbRating":"8.9",
"imdbVotes":"727,988",
"imdbID":"tt0137523",
"Type":"movie",
"Response":"True"
}
To get the XML response add &r=XML at end of request.
http://www.omdbapi.com/?t=Fight%20Club&r=XMLXML response:
<root response="True"><movie title="Fight Club" year="1999" rated="R" released="15 Oct 1999" runtime="2 h 19 min" genre="Drama" director="David Fincher" writer="Chuck Palahniuk, Jim Uhls" actors="Brad Pitt, Edward Norton, Helena Bonham Carter, Meat Loaf" plot="An insomniac office worker looking for a way to change his life crosses paths with a devil-may-care soap maker and they form an underground fight club that evolves into something much, much more..." poster="http://ia.media-imdb.com/images/M/MV5BMjIwNTYzMzE1M15BMl5BanBnXkFtZTcwOTE5Mzg3OA@@._V1_SX300.jpg" imdbRating="8.9" imdbVotes="727,988" imdbID="tt0137523" type="movie"/>
</root>
No comments:
Post a Comment