The New York Times web site provides a rich set of APIs, as described here: http://developer.nytimes.com/docs

You’ll need to start by signing up for an API key. Your task is to choose one of the New York Times APIs, construct an interface in R to read in the JSON data, and transform it to an R dataframe.

Load the libraries

library(jsonlite)
library(httr)

Set API Key

apikey <- "N0kJIGXMAFAshBqvy9DQSEHG1IVArmH6"

Get the data

# make the url

url <- paste0("https://api.nytimes.com/svc/books/v3//lists/current/hardcover-fiction.json?api-key=",apikey)

fictionbooks <- GET(url)

Check response status

fictionbooks$status_code
## [1] 200

Convert to data frame

fictiondf <- fromJSON(url, flatten = TRUE)
fictiondf <- fictiondf$results
fictiondf <- fictiondf$books
DT::datatable(fictiondf)

Conclusion