This R document will demonstrate how to utilize the Web APIs to scrap the data from different websites. I am using The New York Times API to extract the information about top selling books.
library(httr)
library(jsonlite)
library(request)
## Warning: package 'request' was built under R version 4.3.3
library(dplyr)
##
## Attaching package: 'dplyr'
## The following object is masked from 'package:request':
##
## type_sum
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
Load json data from New York Times
url_times <- paste0('https://api.nytimes.com/svc/books/v3/lists/current/hardcover-fiction.json?api-key=',Sys.getenv("TIMES_API_KEY"))
Read json data and assign to jsonDF1
jsonDF1 <- fromJSON(url_times)
head(jsonDF1)
## $status
## [1] "OK"
##
## $copyright
## [1] "Copyright (c) 2024 The New York Times Company. All Rights Reserved."
##
## $num_results
## [1] 15
##
## $last_modified
## [1] "2024-03-20T22:24:50-04:00"
##
## $results
## $results$list_name
## [1] "Hardcover Fiction"
##
## $results$list_name_encoded
## [1] "hardcover-fiction"
##
## $results$bestsellers_date
## [1] "2024-03-16"
##
## $results$published_date
## [1] "2024-03-31"
##
## $results$published_date_description
## [1] "latest"
##
## $results$next_published_date
## [1] ""
##
## $results$previous_published_date
## [1] "2024-03-24"
##
## $results$display_name
## [1] "Hardcover Fiction"
##
## $results$normal_list_ends_at
## [1] 15
##
## $results$updated
## [1] "WEEKLY"
##
## $results$books
## rank rank_last_week weeks_on_list asterisk dagger primary_isbn10
## 1 1 1 6 0 0 1250178630
## 2 2 2 45 0 0 1649374046
## 3 3 3 19 0 0 1649374178
## 4 4 0 1 0 0 None
## 5 5 6 3 0 0 0593599837
## 6 6 8 30 0 0 0593422945
## 7 7 5 2 0 0 0593493435
## 8 8 9 7 0 0 1635574102
## 9 9 7 3 0 0 0593331346
## 10 10 4 2 0 0 0593498402
## 11 11 11 42 0 0 0063204150
## 12 12 10 11 0 0 0593492919
## 13 13 0 1 0 0 1538765063
## 14 14 14 97 0 0 038554734X
## 15 15 0 1 0 0 0593801997
## primary_isbn13 publisher
## 1 9781250178633 St. Martin's
## 2 9781649374042 Red Tower
## 3 9781649374172 Red Tower
## 4 9781250337320 St. Martin’s
## 5 9780593599839 Del Rey
## 6 9780593422946 Riverhead
## 7 9780593493434 Viking
## 8 9781635574104 Bloomsbury
## 9 9780593331347 Putnam
## 10 9780593498408 Delacorte
## 11 9780063204157 Ecco
## 12 9780593492918 Pamela Dorman
## 13 9781538765067 Grand Central
## 14 9780385547345 Doubleday
## 15 9780593801994 Knopf
## description
## 1 In 1965, a nursing student follows her brother to serve during the Vietnam War and returns to a divided America.
## 2 Violet Sorrengail is urged by the commanding general, who also is her mother, to become a candidate for the elite dragon riders.
## 3 The second book in the Empyrean series. Violet Sorrengail’s next round of training might require her to betray the man she loves.
## 4 The second book of the Empire of the Vampire series. Gabriel de León is tasked with taking the Holy Grail to the ancients of the Blood Esani.
## 5 After the secret of her magic to repel attacks is revealed, Freya encounters dangerous tests by the gods.
## 6 Secrets held by the residents of a dilapidated neighborhood come to life when a skeleton is found at the bottom of a well.
## 7 The life that a Chicago P.D. retiree has built in Ireland with a local woman and her daughter comes under threat.
## 8 The third book in the Crescent City series. Bryce wants to return home while Hunt is trapped in Asteri's dungeons.
## 9 The 24th book in the Joe Pickett series. A man released from prison uses grizzly bear attacks to cover his acts of revenge.
## 10 A widow makes a fresh start in New York City and connects with her movie-star neighbor as they help others after a crisis.
## 11 A widow working the night shift at the Sowell Bay Aquarium is aided in solving a mystery by a giant Pacific octopus living there.
## 12 A woman who works for a mysterious boss takes on a new identity to dig up information on someone.
## 13 The third book in the Frankie Elkin series. Frankie must find the sister, who was kidnapped over a decade ago, of a serial killer on death row.
## 14 A scientist and single mother living in California in the 1960s becomes a star on a TV cooking show.
## 15 Every August, Ana Magdalena Bach travels to the island where her mother is buried and takes a lover for one night. Translated by Anne McLean.
## price title author
## 1 0.00 THE WOMEN Kristin Hannah
## 2 0.00 FOURTH WING Rebecca Yarros
## 3 0.00 IRON FLAME Rebecca Yarros
## 4 0.00 EMPIRE OF THE DAMNED Jay Kristoff
## 5 0.00 A FATE INKED IN BLOOD Danielle L. Jensen
## 6 0.00 THE HEAVEN & EARTH GROCERY STORE James McBride
## 7 0.00 THE HUNTER Tana French
## 8 0.00 HOUSE OF FLAME AND SHADOW Sarah J. Maas
## 9 0.00 THREE-INCH TEETH C.J. Box
## 10 0.00 NEVER TOO LATE Danielle Steel
## 11 0.00 REMARKABLY BRIGHT CREATURES Shel Van Pelt
## 12 0.00 FIRST LIE WINS Ashley Elston
## 13 0.00 STILL SEE YOU EVERYWHERE Lisa Gardner
## 14 0.00 LESSONS IN CHEMISTRY Bonnie Garmus
## 15 0.00 UNTIL AUGUST Gabriel García Márquez
## contributor contributor_note
## 1 by Kristin Hannah
## 2 by Rebecca Yarros
## 3 by Rebecca Yarros
## 4 by Jay Kristoff
## 5 by Danielle L. Jensen
## 6 by James McBride
## 7 by Tana French
## 8 by Sarah J. Maas
## 9 by C.J. Box
## 10 by Danielle Steel
## 11 by Shelby Van Pelt
## 12 by Ashley Elston
## 13 by Lisa Gardner
## 14 by Bonnie Garmus
## 15 by Gabriel García Márquez
## book_image
## 1 https://storage.googleapis.com/du-prd/books/images/9781250178633.jpg
## 2 https://storage.googleapis.com/du-prd/books/images/9781649374042.jpg
## 3 https://storage.googleapis.com/du-prd/books/images/9781649374172.jpg
## 4 https://storage.googleapis.com/du-prd/books/images/9781250337320.jpg
## 5 https://storage.googleapis.com/du-prd/books/images/9780593599839.jpg
## 6 https://storage.googleapis.com/du-prd/books/images/9780593422946.jpg
## 7 https://storage.googleapis.com/du-prd/books/images/9780593493434.jpg
## 8 https://storage.googleapis.com/du-prd/books/images/9781635574104.jpg
## 9 https://storage.googleapis.com/du-prd/books/images/9780593331347.jpg
## 10 https://storage.googleapis.com/du-prd/books/images/9780593498408.jpg
## 11 https://storage.googleapis.com/du-prd/books/images/9780063204157.jpg
## 12 https://storage.googleapis.com/du-prd/books/images/9780593492918.jpg
## 13 https://storage.googleapis.com/du-prd/books/images/9781538765098.gif
## 14 https://storage.googleapis.com/du-prd/books/images/9780385547345.jpg
## 15 https://storage.googleapis.com/du-prd/books/images/9780593801994.jpg
## book_image_width book_image_height
## 1 333 500
## 2 309 500
## 3 309 500
## 4 329 500
## 5 331 500
## 6 331 500
## 7 331 500
## 8 325 500
## 9 332 500
## 10 329 500
## 11 329 500
## 12 331 500
## 13 60 40
## 14 328 500
## 15 308 500
## amazon_product_url age_group
## 1 https://www.amazon.com/dp/1250178630?tag=NYTBSREV-20
## 2 https://www.amazon.com/dp/1649374046?tag=NYTBSREV-20
## 3 https://www.amazon.com/dp/1649374178?tag=NYTBSREV-20
## 4 https://www.amazon.com/dp/1250245338?tag=NYTBSREV-20
## 5 https://www.amazon.com/dp/0593599837?tag=NYTBSREV-20
## 6 https://www.amazon.com/dp/0593422945?tag=NYTBSREV-20
## 7 https://www.amazon.com/dp/0593493435?tag=NYTBSREV-20
## 8 https://www.amazon.com/dp/1635574102?tag=NYTBSREV-20
## 9 https://www.amazon.com/dp/0593331346?tag=NYTBSREV-20
## 10 https://www.amazon.com/dp/0593498402?tag=NYTBSREV-20
## 11 https://www.amazon.com/dp/0063204150?tag=NYTBSREV-20
## 12 https://www.amazon.com/dp/0593492919?tag=NYTBSREV-20
## 13 https://www.amazon.com/dp/1538765098?tag=NYTBSREV-20
## 14 https://www.amazon.com/dp/038554734X?tag=NYTBSREV-20
## 15 https://www.amazon.com/dp/0593801997?tag=NYTBSREV-20
## book_review_link first_chapter_link sunday_review_link article_chapter_link
## 1
## 2
## 3
## 4
## 5
## 6
## 7
## 8
## 9
## 10
## 11
## 12
## 13
## 14
## 15
## isbns
## 1 1250178630, 1250178657, 9781250178633, 9781250178657
## 2 1649374046, 1649374089, 1705085059, 1705085032, 1649376162, 9781649374042, 9781649374080, 9781705085059, 9781705085035, 9781649376169
## 3 1649374178, 1705085083, 9781649374172, 9781705085080
## 4 1250245338, 9781250245335
## 5 0593599837, 0593599845, 9780593599839, 9780593599846
## 6 0593422945, 0593422961, 0593684125, 0593684141, 9780593422946, 9780593422960, 9780593684122, 9780593684146
## 7 0593493435, 0593493443, 9780593493434, 9780593493441
## 8 1635574102, 9781635574104
## 9 0593331346, 0593331354, 9780593331347, 9780593331354
## 10 0593498402, 0593498410, 9780593498408, 9780593498415
## 11 0063204150, 0063204185, 0063204169, 0063204177, 9780063204157, 9780063204188, 9780063204164, 9780063204171
## 12 0593492919, 0593492927, 0593789687, 9780593492918, 9780593492925, 9780593789681
## 13 1538765063, 1538768372, 1538766604, 1538765098, 9781538765067, 9781538768372, 9781538766606, 9781538765098
## 14 038554734X, 0593507533, 0385547374, 0593862406, 9780385547345, 9780593507537, 9780385547376, 9780593862407
## 15 0593801997, 9780593801994
## buy_links
## 1 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/1250178630?tag=NYTBSREV-20, https://goto.applebooks.apple/9781250178633?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9781250178633, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FTHE%2BWOMEN%2FKristin%2BHannah%2F9781250178633, https://bookshop.org/a/3546/9781250178633, https://www.indiebound.org/book/9781250178633?aff=NYT
## 2 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/1649374046?tag=NYTBSREV-20, https://goto.applebooks.apple/9781649374042?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9781649374042, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FFOURTH%2BWING%2FRebecca%2BYarros%2F9781649374042, https://bookshop.org/a/3546/9781649374042, https://www.indiebound.org/book/9781649374042?aff=NYT
## 3 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/1649374178?tag=NYTBSREV-20, https://goto.applebooks.apple/9781649374172?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9781649374172, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FIRON%2BFLAME%2FRebecca%2BYarros%2F9781649374172, https://bookshop.org/a/3546/9781649374172, https://www.indiebound.org/book/9781649374172?aff=NYT
## 4 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/1250245338?tag=NYTBSREV-20, https://goto.applebooks.apple/9781250337320?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9781250337320, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FEMPIRE%2BOF%2BTHE%2BDAMNED%2FJay%2BKristoff%2F9781250337320, https://bookshop.org/a/3546/9781250337320, https://www.indiebound.org/book/9781250337320?aff=NYT
## 5 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/0593599837?tag=NYTBSREV-20, https://goto.applebooks.apple/9780593599839?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9780593599839, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FA%2BFATE%2BINKED%2BIN%2BBLOOD%2FDanielle%2BL.%2BJensen%2F9780593599839, https://bookshop.org/a/3546/9780593599839, https://www.indiebound.org/book/9780593599839?aff=NYT
## 6 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/0593422945?tag=NYTBSREV-20, https://goto.applebooks.apple/9780593422946?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9780593422946, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FTHE%2BHEAVEN%2B%2526%2BEARTH%2BGROCERY%2BSTORE%2FJames%2BMcBride%2F9780593422946, https://bookshop.org/a/3546/9780593422946, https://www.indiebound.org/book/9780593422946?aff=NYT
## 7 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/0593493435?tag=NYTBSREV-20, https://goto.applebooks.apple/9780593493434?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9780593493434, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FTHE%2BHUNTER%2FTana%2BFrench%2F9780593493434, https://bookshop.org/a/3546/9780593493434, https://www.indiebound.org/book/9780593493434?aff=NYT
## 8 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/1635574102?tag=NYTBSREV-20, https://goto.applebooks.apple/9781635574104?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9781635574104, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FHOUSE%2BOF%2BFLAME%2BAND%2BSHADOW%2FSarah%2BJ.%2BMaas%2F9781635574104, https://bookshop.org/a/3546/9781635574104, https://www.indiebound.org/book/9781635574104?aff=NYT
## 9 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/0593331346?tag=NYTBSREV-20, https://goto.applebooks.apple/9780593331347?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9780593331347, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FTHREE-INCH%2BTEETH%2FC.J.%2BBox%2F9780593331347, https://bookshop.org/a/3546/9780593331347, https://www.indiebound.org/book/9780593331347?aff=NYT
## 10 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/0593498402?tag=NYTBSREV-20, https://goto.applebooks.apple/9780593498408?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9780593498408, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FNEVER%2BTOO%2BLATE%2FDanielle%2BSteel%2F9780593498408, https://bookshop.org/a/3546/9780593498408, https://www.indiebound.org/book/9780593498408?aff=NYT
## 11 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/0063204150?tag=NYTBSREV-20, https://goto.applebooks.apple/9780063204157?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9780063204157, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FREMARKABLY%2BBRIGHT%2BCREATURES%2FShel%2BVan%2BPelt%2F9780063204157, https://bookshop.org/a/3546/9780063204157, https://www.indiebound.org/book/9780063204157?aff=NYT
## 12 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/0593492919?tag=NYTBSREV-20, https://goto.applebooks.apple/9780593492918?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9780593492918, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FFIRST%2BLIE%2BWINS%2FAshley%2BElston%2F9780593492918, https://bookshop.org/a/3546/9780593492918, https://www.indiebound.org/book/9780593492918?aff=NYT
## 13 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/1538765098?tag=NYTBSREV-20, https://goto.applebooks.apple/9781538765067?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9781538765067, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FSTILL%2BSEE%2BYOU%2BEVERYWHERE%2FLisa%2BGardner%2F9781538765067, https://bookshop.org/a/3546/9781538765067, https://www.indiebound.org/book/9781538765067?aff=NYT
## 14 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/038554734X?tag=NYTBSREV-20, https://goto.applebooks.apple/9780385547345?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9780385547345, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FLESSONS%2BIN%2BCHEMISTRY%2FBonnie%2BGarmus%2F9780385547345, https://bookshop.org/a/3546/9780385547345, https://www.indiebound.org/book/9780385547345?aff=NYT
## 15 Amazon, Apple Books, Barnes and Noble, Books-A-Million, Bookshop, IndieBound, https://www.amazon.com/dp/0593801997?tag=NYTBSREV-20, https://goto.applebooks.apple/9780593801994?at=10lIEQ, https://www.anrdoezrs.net/click-7990613-11819508?url=https%3A%2F%2Fwww.barnesandnoble.com%2Fw%2F%3Fean%3D9780593801994, https://www.anrdoezrs.net/click-7990613-35140?url=https%3A%2F%2Fwww.booksamillion.com%2Fp%2FUNTIL%2BAUGUST%2FGabriel%2BGarc%25C3%25ADa%2BM%25C3%25A1rquez%2F9780593801994, https://bookshop.org/a/3546/9780593801994, https://www.indiebound.org/book/9780593801994?aff=NYT
## book_uri
## 1 nyt://book/9ce735af-71cf-5ff3-a367-43ee07e3fdd7
## 2 nyt://book/106c2cf0-7d20-51b1-bad4-91c3ebcd131a
## 3 nyt://book/d3c570c9-3c3a-5c8b-a740-85ea5e92bfc9
## 4 nyt://book/52ffb399-f4b2-5c0c-a7a0-7bb2f8f41178
## 5 nyt://book/db9be42d-5085-535d-b3a4-529aad09f22b
## 6 nyt://book/7d47b076-7ad7-539c-a051-6664384636b9
## 7 nyt://book/a14900fd-6123-5372-925a-cc2005d387eb
## 8 nyt://book/fd8d95af-3496-5a1b-81d2-d3f7a7a54e90
## 9 nyt://book/653dbf55-a521-5f74-bccb-0c7fc48456bb
## 10 nyt://book/273b657e-70f0-5fb7-8532-f89cc8aa2ee0
## 11 nyt://book/206a5e83-12f4-5ea9-8e63-1da5470a6ef5
## 12 nyt://book/d5aa005c-08a5-5bd9-ba0e-6dcd5e7e31f8
## 13 nyt://book/8ddf8816-3402-5929-b3b4-f272df768016
## 14 nyt://book/717e0ead-9782-567d-af27-d9a6cfb1856f
## 15 nyt://book/f54f471c-b9a4-545a-ab38-e343edb94a94
##
## $results$corrections
## list()
# Extracting relevant fields
df <- jsonDF1$results$books %>%
mutate(
# list_name = jsonDF1$results$list_name,
bestsellers_date = jsonDF1$results$bestsellers_date,
published_date = jsonDF1$results$published_date,
title = as.character(title),
weeks_on_list = as.numeric(weeks_on_list),
author = as.character(author),
description = as.character(description),
publisher = as.character(publisher),
price = as.numeric(price),
book_image = as.character(book_image),
amazon_product_url = as.character(amazon_product_url)
) %>%
select(
#list_name,
bestsellers_date,
published_date,
rank,
title,
weeks_on_list,
author,
description,
publisher,
price,
book_image,
amazon_product_url
)
# View the transformed data frame
head(df)
## bestsellers_date published_date rank title
## 1 2024-03-16 2024-03-31 1 THE WOMEN
## 2 2024-03-16 2024-03-31 2 FOURTH WING
## 3 2024-03-16 2024-03-31 3 IRON FLAME
## 4 2024-03-16 2024-03-31 4 EMPIRE OF THE DAMNED
## 5 2024-03-16 2024-03-31 5 A FATE INKED IN BLOOD
## 6 2024-03-16 2024-03-31 6 THE HEAVEN & EARTH GROCERY STORE
## weeks_on_list author
## 1 6 Kristin Hannah
## 2 45 Rebecca Yarros
## 3 19 Rebecca Yarros
## 4 1 Jay Kristoff
## 5 3 Danielle L. Jensen
## 6 30 James McBride
## description
## 1 In 1965, a nursing student follows her brother to serve during the Vietnam War and returns to a divided America.
## 2 Violet Sorrengail is urged by the commanding general, who also is her mother, to become a candidate for the elite dragon riders.
## 3 The second book in the Empyrean series. Violet Sorrengail’s next round of training might require her to betray the man she loves.
## 4 The second book of the Empire of the Vampire series. Gabriel de León is tasked with taking the Holy Grail to the ancients of the Blood Esani.
## 5 After the secret of her magic to repel attacks is revealed, Freya encounters dangerous tests by the gods.
## 6 Secrets held by the residents of a dilapidated neighborhood come to life when a skeleton is found at the bottom of a well.
## publisher price
## 1 St. Martin's 0
## 2 Red Tower 0
## 3 Red Tower 0
## 4 St. Martin’s 0
## 5 Del Rey 0
## 6 Riverhead 0
## book_image
## 1 https://storage.googleapis.com/du-prd/books/images/9781250178633.jpg
## 2 https://storage.googleapis.com/du-prd/books/images/9781649374042.jpg
## 3 https://storage.googleapis.com/du-prd/books/images/9781649374172.jpg
## 4 https://storage.googleapis.com/du-prd/books/images/9781250337320.jpg
## 5 https://storage.googleapis.com/du-prd/books/images/9780593599839.jpg
## 6 https://storage.googleapis.com/du-prd/books/images/9780593422946.jpg
## amazon_product_url
## 1 https://www.amazon.com/dp/1250178630?tag=NYTBSREV-20
## 2 https://www.amazon.com/dp/1649374046?tag=NYTBSREV-20
## 3 https://www.amazon.com/dp/1649374178?tag=NYTBSREV-20
## 4 https://www.amazon.com/dp/1250245338?tag=NYTBSREV-20
## 5 https://www.amazon.com/dp/0593599837?tag=NYTBSREV-20
## 6 https://www.amazon.com/dp/0593422945?tag=NYTBSREV-20
change into a dataframe
jsonDF <- as.data.frame(df)
head(jsonDF)
## bestsellers_date published_date rank title
## 1 2024-03-16 2024-03-31 1 THE WOMEN
## 2 2024-03-16 2024-03-31 2 FOURTH WING
## 3 2024-03-16 2024-03-31 3 IRON FLAME
## 4 2024-03-16 2024-03-31 4 EMPIRE OF THE DAMNED
## 5 2024-03-16 2024-03-31 5 A FATE INKED IN BLOOD
## 6 2024-03-16 2024-03-31 6 THE HEAVEN & EARTH GROCERY STORE
## weeks_on_list author
## 1 6 Kristin Hannah
## 2 45 Rebecca Yarros
## 3 19 Rebecca Yarros
## 4 1 Jay Kristoff
## 5 3 Danielle L. Jensen
## 6 30 James McBride
## description
## 1 In 1965, a nursing student follows her brother to serve during the Vietnam War and returns to a divided America.
## 2 Violet Sorrengail is urged by the commanding general, who also is her mother, to become a candidate for the elite dragon riders.
## 3 The second book in the Empyrean series. Violet Sorrengail’s next round of training might require her to betray the man she loves.
## 4 The second book of the Empire of the Vampire series. Gabriel de León is tasked with taking the Holy Grail to the ancients of the Blood Esani.
## 5 After the secret of her magic to repel attacks is revealed, Freya encounters dangerous tests by the gods.
## 6 Secrets held by the residents of a dilapidated neighborhood come to life when a skeleton is found at the bottom of a well.
## publisher price
## 1 St. Martin's 0
## 2 Red Tower 0
## 3 Red Tower 0
## 4 St. Martin’s 0
## 5 Del Rey 0
## 6 Riverhead 0
## book_image
## 1 https://storage.googleapis.com/du-prd/books/images/9781250178633.jpg
## 2 https://storage.googleapis.com/du-prd/books/images/9781649374042.jpg
## 3 https://storage.googleapis.com/du-prd/books/images/9781649374172.jpg
## 4 https://storage.googleapis.com/du-prd/books/images/9781250337320.jpg
## 5 https://storage.googleapis.com/du-prd/books/images/9780593599839.jpg
## 6 https://storage.googleapis.com/du-prd/books/images/9780593422946.jpg
## amazon_product_url
## 1 https://www.amazon.com/dp/1250178630?tag=NYTBSREV-20
## 2 https://www.amazon.com/dp/1649374046?tag=NYTBSREV-20
## 3 https://www.amazon.com/dp/1649374178?tag=NYTBSREV-20
## 4 https://www.amazon.com/dp/1250245338?tag=NYTBSREV-20
## 5 https://www.amazon.com/dp/0593599837?tag=NYTBSREV-20
## 6 https://www.amazon.com/dp/0593422945?tag=NYTBSREV-20