Skip to content
Prev 301356 / 398506 Next

Get XML or JSON data from api into data frame

On Thu, Jul 26, 2012 at 4:18 AM, Richard Ohrvall
<richard.ohrvall at gmail.com> wrote:
library(httr)
library(rjson)

fromJSON(text_content(GET("http://www.imdbapi.com/?i=tt0110074&tomatoes=TRUE")))

This will be a bit easier in the next version of httr

content(GET("http://www.imdbapi.com/?i=tt0110074&tomatoes=TRUE")),
  type = "application/json")

See also https://github.com/hadley/data-movies, which I suspect is a
faster approach than using an API.

Hadley