got_api: Retrieves books, characters or houses information from the...

Description Usage Arguments Value Author(s) Examples

Description

A book is a book that are already published or planned for future. A Character is an individual within the Ice And Fire universe. A House is a house branch within the Ice And Fire universe.

Usage

1
2
got_api(type = c("books", "characters", "houses"), id = NULL, url = NULL,
  ...)

Arguments

type

The endpoint type, one of books, characters or houses. Default to books if nothing is provided.

id

The object index. Default is all unless an id is specified.

...

Additional parameters to pass on to GET such as query, path, etc. User can also filter by the parameters of interest like name of a character.

Value

List with all parameters of that endpoint

Author(s)

Mango Solutions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 

# Retrieve books on page 1
books_page1 <- got_api(type = "books")

# Retrieve books on page 1, change page size to 20. Default is 10.
booksAll <- got_api(type = "books", query = list(pageSize="20"))

# Retrieve characters on page 3, change page size to 20.
characters_page_3 <- got_api(type = "characters", query = list(page = "3", pageSize="20"))

# Retrieve character Jon Snow by id
jon_snow <- got_api(type = "characters", id = "583")

# Retrieve character Jon Snow by name
jon_snow_by_name <- got_api(type = "characters", query = list(name = "Jon Snow"))

# Retrieve house id 378
house378 <- got_api(type = "houses", id = 378)

## End(Not run)

MangoTheCat/GoTr documentation built on May 31, 2019, 11:45 p.m.