README.md

Rgoodreads - an R package for the Goodreads API

This R package acts as a wrapper for the read-only features of the Goodreads API with the ability to retrieve information on books, authors, users, reviews, etc. so that they can be analyzed in R.

Check out the API documentation for more details.

Dependencies

Installation

You can install the package with devtools as such:

# install.packages("devtools")
devtools::install_github("famguy/rgoodreads")

Getting Started

Before using Goodreads API you must create a new application and get an API key. Visit signup form for details. Once you have your API key, set up an environment variable, by adding the following line to your .Rprofile:

Sys.setenv(GOODREADS_KEY = "YOUR_KEY_HERE")

After that, queries made from your system will use your key.

Examples

Methods for querying objects from the API are implemented in functions of the form [object]. Each of these functions returns a data frame, with one row per object.

Lookup books

You can lookup a book by ISBN, ID or Title:

b <- book('id')
b <- book_by_isbn('ISBN')
b <- book_by_title('Book title')

Authors

Look up an author by their Goodreads Author ID:

a <- author('id')

a$id              # => author id
a$name            # => author's name
a$link            # => link to author's Goodreads page
a$fans_count      # => number of fans author has on Goodreads
a$image_url       # => link to image of the author
a$small_image_url # => link to smaller of the author
a$about           # => description of the author
a$influences      # => list of links to author's influences
a$works_count     # => number of works by the author in Goodreads
a$gender          # => author's gender
a$hometown        # => author's hometown
a$born_at         # => author's birthdate
a$died_at         # => date of author's death
...

Look up an author by name:

a <- author_by_name('Author Name')

Reviews

Pull recent reviews:

r <- recent_reviews()

Get review details:

r <- review('id')

r$id         # => review id
r$user       # => user information
r$book       # => uook information
r$rating     # => user rating

Users

Get user details:

u <- user('user_id')

u$name       # name of the user
u$age        # user age
u$location   # user location
u$gender     # user gender

Groups

Search groups:

g <- group_search('query')

g$id                 # => group id
g$title              # => group title
g$access             # => group's access settings
                     # => (e.g., public or private)
g$users_count        # => number of users in the group

Feedback

Feel free to raise issues here.



Famguy/rgoodreads documentation built on May 6, 2019, 4:09 p.m.