Data 607 Assignment Web APIs

Amanda Arce

October 25, 2018

library(tidyverse)
library(httr)
library(jsonlite)
library(knitr)
url <- GET("https://api.nytimes.com/svc/movies/v2/reviews/search.json", query=list(api_key=api_key))

names(url)
##  [1] "url"         "status_code" "headers"     "all_headers" "cookies"    
##  [6] "content"     "date"        "times"       "request"     "handle"
data <- as.data.frame(fromJSON(url$url))

data1 <-data %>%
  select(results.display_title, copyright, results.opening_date) %>%
  head(15)
kable(data1)
results.display_title copyright results.opening_date
Burning Copyright (c) 2018 The New York Times Company. All Rights Reserved. 2018-11-09
A Bread Factory, Part One Copyright (c) 2018 The New York Times Company. All Rights Reserved. 2018-10-26
A Bread Factory, Part Two Copyright (c) 2018 The New York Times Company. All Rights Reserved. 2018-10-26
Monrovia, Indiana Copyright (c) 2018 The New York Times Company. All Rights Reserved. 2018-10-26
Border Copyright (c) 2018 The New York Times Company. All Rights Reserved. 2018-10-26
Shirkers Copyright (c) 2018 The New York Times Company. All Rights Reserved. 2018-10-26
Vaya Copyright (c) 2018 The New York Times Company. All Rights Reserved. NA
1985 Copyright (c) 2018 The New York Times Company. All Rights Reserved. NA
The Dark Copyright (c) 2018 The New York Times Company. All Rights Reserved. 2018-10-26
Viper Club Copyright (c) 2018 The New York Times Company. All Rights Reserved. 2018-10-26
Trust Machine: The Story of Blockchain Copyright (c) 2018 The New York Times Company. All Rights Reserved. NA
Don’t Go Copyright (c) 2018 The New York Times Company. All Rights Reserved. 2018-10-26
Hunter Killer Copyright (c) 2018 The New York Times Company. All Rights Reserved. 2018-10-26
London Fields Copyright (c) 2018 The New York Times Company. All Rights Reserved. 2018-10-26
Foreign Land Copyright (c) 2018 The New York Times Company. All Rights Reserved. NA