I decided to pull the NY Times Bestseller list for Hardcover Fiction. After reviewing the information on the Times API site, I applied for an API Key for my API of interest. I put the rest of the specifics right in the URI.
Using the jsonlite package makes pulling the information nice and easy. I had some trouble at first because I was accidentally using RJSONIO.
library(jsonlite)
##
## Attaching package: 'jsonlite'
##
## The following object is masked from 'package:utils':
##
## View
library(RCurl)
## Loading required package: bitops
feed_url <- "http://api.nytimes.com/svc/books/v3/lists/hardcover-Fiction.json?&"
key <- "api-key=d1974bfb220be7dbc003045f60544bfe:19:73353118"
pull <- fromJSON(paste0(feed_url, key))
I selected the specific columns of interest and then created the data frame
summary <- cbind(pull$results$books$title, pull$results$books$author, pull$results$books$rank, pull$results$books$weeks_on_list)
df <- data.frame(summary, stringsAsFactors = FALSE)
The only thing left to do was some minor cleanup work
colnames(df) <- c("Title", "Author", "Rank", "Weeks on List")
df$Rank <- as.integer(df$Rank)
df$`Weeks on List` <- as.integer(df$`Weeks on List`)
df
## Title Author Rank
## 1 ROGUE LAWYER John Grisham 1
## 2 SEE ME Nicholas Sparks 2
## 3 CAREER OF EVIL Robert Galbraith 3
## 4 WELCOME TO NIGHT VALE Joseph Fink and Jeffrey Cranor 4
## 5 THE SURVIVOR Vince Flynn and Kyle Mills 5
## 6 THE LAKE HOUSE Kate Morton 6
## 7 THE MURDER HOUSE James Patterson and David Ellis 7
## 8 ALL THE LIGHT WE CANNOT SEE Anthony Doerr 8
## 9 THE GIRL IN THE SPIDER'S WEB David Lagercrantz 9
## 10 A KNIGHT OF THE SEVEN KINGDOMS George R R Martin 10
## 11 GO SET A WATCHMAN Harper Lee 11
## 12 THE GIRL ON THE TRAIN Paula Hawkins 12
## 13 CITY ON FIRE Garth Risk Hallberg 13
## 14 MAKE ME Lee Child 14
## 15 AFTER YOU Jojo Moyes 15
## 16 THE NIGHTINGALE Kristin Hannah 16
## 17 COME RAIN OR COME SHINE Jan Karon 17
## 18 THE EXPLORERS GUILD Kevin Costner and Jon Baird 18
## 19 FOREIGN AFFAIRS Stuart Woods 19
## 20 FATES AND FURIES Lauren Groff 20
## Weeks on List
## 1 1
## 2 2
## 3 1
## 4 1
## 5 3
## 6 1
## 7 4
## 8 77
## 9 8
## 10 3
## 11 15
## 12 41
## 13 2
## 14 7
## 15 4
## 16 38
## 17 0
## 18 0
## 19 0
## 20 0