knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" ) library(giantbomb)
The giantbomb package provides access to the GiantBomb API which gives information on video games, reviews, companies, and other related content.
Install the package using devtools.
devtools::install_github("detroyejr/giantbomb")
At the time this package was created, these endpoints are covered:
gb_search
gb_games
gb_companies
gb_characters
gb_reviews
gb_platforms
gb_franchises
Before you can begin to use the giantbomb package, you will need to sign up to receive an api key. Once you login, your key will appead on the main api page.
Once you have your key, you can either pass it as a string to the api_key
function parameters or set the GB_KEY
environoment variable.
Sys.setenv("GB_KEY" = 'YOUR_API_KEY`)
The function gb_key()
will look in the system environment for a variable with that name.
# Get list of games. gb_games(n = 10, field_list = c("date_added", "name")) # Get list of companies. gb_companies(n = 10, field_list = c("date_added", "name"))
# Filter by name and sort by date_added. gb_games( n = 10, filter = "name:bioshock", sort = "date_added:desc", field_list = c("name", "date_added") ) # Filter companies by name and sort by date_added. gb_companies( n = 10, filter = "name:2k", sort = "date_added:asc", field_list = c("name", "date_added") )
For more examples, look in the function documentation.
If you find any bugs, you can file an issue or create a pull request.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.