searchbga: Search Boardgame Atlas API

Description Arguments Value Examples

Description

search_bga() provides a wrapper for the search function of the Board Game Atlas (BGA) API. documentation on the API can be found at https://www.boardgameatlas.com/api/docs. Please note that this function only covers the search of the BGA API. Game mechanic ID values can be found at https://www.boardgameatlas.com/api/docs/game/mechanics Game category ID values can be found at https://www.boardgameatlas.com/api/docs/game/categories

Arguments

limit

int - limits the number of results returned. The max limit is 100. The default is 30.

skip

int - Skips the number of results provided. It's generally used for paging results.

ids

string - The exact id(s) of the game(s) you want returned comma separated. If they exist, this will return the associated games.

kickstarter

logical boolean T/F - This returns a list of kickstarters ordered by the created date in descending order. You can use order_by with the 'deadline', parameter to change it to be ordered in ascending order of when the campaign is over. This may override other parameters like limit.

random

logical boolean T/F - This returns a random game. This may override other parameters like limit.

name

string - Name of a board game to search for. This search is based on the start of the strings.

name_exact

logical boolean T/F - Use to make the name field only return games that match the name exactly (TRUE). The API default search is based on the start of the strings.

name_fuzzy

logical boolean T/F - Use to make the name field return fuzzy matches like 'cata' to return 'catan' (TRUE). The API default search is based on the start of the strings.

designer

string - Name of a board game designer to search for. This is an exact match parameter.

publisher

string - Name of the board game publisher to search for. This is an exact match parameter.

artist

string - Name of an artist for a board game to search for. This is an exact match parameter.

mechanics

string - A list of mechanic ids to search for comma separated (e.g. "mechanicID1,mechanicID2").

categories

string - A list of category ids to search for comma separated (e.g. "categoryID1,categoryID2").

order_by

string - Provide the name of another parameter and it will order the results according to it. Default value is 'popularity' - which is calculated by the total number of commends on the Reddit.com /r/boardgames subreddit. The possible values include popularity, price, deadline, discount, average_user_rating, num_user_ratings, reddit_week_count, reddit_day_count, name, year_published, min_age, min_playtime, max_playtime, min_players, max_players

ascending

string - This determines which direction the list is shown in based on the order_by parameter. FALSE by default.

min_players

int - Minimum number of players, for exact number set min_players and max_players equal.

max_players

int - Maximum number of players, for exact number set min_players and max_players equal.

min_playtime

int - Minimum number of minutes, for exact number set min_playtime and max_time equal.

max_playtime

int - Maximum number of minutes, for exact number set min_playtime and max_time equal.

min_age

int - The minimum number of age that will be returned, for exact number set min_age and max_age equal.

max_age

int - the highest value of minimum age that will be returned, for exact number set min_age and max_age equal.

min_year

int - The earliest year that a game was published, for exact number set min_year and max_year equal.

max_year

int - The latest year that a game was published, for exact number set min_year and max_year equal.

min_price

dbl - The minimum price value.

max_price

dbl - The maximum price value.

min_msrp

dbl - The minimum manufacturer recommended sale price

max_msrp

dbl - The maximum manufacturer recommended sale price

min_discount

dbl - The minimum discount in decimal format. While typically between 0 and 1, this can be negative when games become more expensive than the msrp.

max_discount

dbl - the maximum discount in decimal format. While typically between 0 and 1, this can be negative when games become more expensive than the msrp.

min_reddit_total

int - Minimum number of times the game has been mentioned on reddit.com's /r/boardgames since 2018.

max_reddit_total

int - Maximum number of times the game has been mentioned on reddit.com's /r/boardgames since 2018

min_reddit_week

int - Minimum number of times the game has been mentioned on reddit.com's /r/boardgames in the past week.

max_reddit_week

int - Maximum number of times the game has been mentioned on reddit.com's /r/boardgames in the past week.

min_reddit_day

int - Minimum number of times the game has been mentioned on reddit.com's /r/boardgames in the past 24 hours.

max_reddit_day

int - Maximum number of times the game has been mentioned on reddit.com's /r/boardgames in the past 24 hours.

client_id_pat

string - your client_id (Sys.getenv('BOARDGAMEATLAS_PAT'))

Value

search_bga returns the results from the search as a tidy dataframe.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
#Search for the top 30 (the default) most popular variations of Settlers of Catan:
search_bga(name = "Catan", name_fuzzy = TRUE, client_id_pat = Sys.getenv('BOARDGAMEATLAS_PAT'))

#Search for the top 20 games of 2018 for players age 10 or under
search_bga(limit=20, max_age=10, min_year = 2018, max_year=2018)

#Search for the top 5 games for ages between 2 and 5 from 2010 and later for at least 3 players
search_bga(limit=5, min_age=2, max_age=5, min_year=2010, min_players=3)

#Search for the top 10 most heavily discounted games of 2019
search_bga(limit=5, order_by = "discount", min_year = 2019)

## End(Not run)

mdweisner/boardgameatlasR documentation built on July 10, 2020, 12:24 p.m.