Skip to contents

This function searches books on Goodreads.

Usage

search_goodreads(
  search_term,
  search_in = c("title", "author"),
  num_books = 10,
  sort_by = "ratings"
)

Arguments

search_term

A search term string.

search_in

Where to search (e.g., "title", "author").

num_books

Number of books to return.

sort_by

How to sort the results (e.g., "ratings", "published_year").

Value

A data frame of search results.

Examples

search_goodreads("parenting", search_in = "title", num_books = 2)
#>                                                                                       title
#> 1            Bringing Up Bébé: One American Mother Discovers the Wisdom of French Parenting
#> 2 Cribsheet: A Data-Driven Guide to Better, More Relaxed Parenting, from Birth to Preschool
#>              author  book_id
#> 1 Pamela Druckerman 13152287
#> 2       Emily Oster 40121328
#>                                                                                                                 url
#> 1 https://www.goodreads.com/book/show/13152287-bringing-up-b-b?from_search=true&from_srp=true&qid=znQbDHnrma&rank=3
#> 2       https://www.goodreads.com/book/show/40121328-cribsheet?from_search=true&from_srp=true&qid=znQbDHnrma&rank=7
#>   ratings
#> 1   71232
#> 2   34245