get_ghibli | R Documentation |
Retrieve data from the Ghibli API
get_ghibli(type = NULL, id = NULL)
type |
The endpoint type, one of 'films', 'species', 'people', 'vehicles' or 'locations'. Default to NULL if nothing is provided. |
id |
The object index. Default is all unless an id is specified. |
Either a data.frame (if id is NULL) or a list
https://ghibliapi.vercel.app
get_ghibli(type="films")
get_ghibli(type="people",id="986faac6-67e3-4fb8-a9ee-bad077c2e7fe")
## Not run:
require("tidyverse")
get_ghibli("species") %>%
filter(name=="Cat") %>%
select(id) %>%
get_ghibli("species",id=.) %>%
subset(.,str_detect(.,"people")) %>%
str_replace("https://ghibliapi.vercel.app/people/","") %>%
map(~ get_ghibli("people",.)) %>%
{
tibble(
name = map_chr(., "name"),
gender = map_chr(., "gender"),
eye_color = map_chr(., "eye_color"),
hair_color = map_chr(., "hair_color")
)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.