gb_search: GiantBomb Search

Description Usage Arguments Details Examples

Description

Retrieve search results from the GiantBomb API.

Usage

1
2
3
gb_search(search = NULL, n = 10, field_list = NULL, limit = 10,
  page = 1, resources = NULL, user_agent = NULL, delay = 30,
  api_key = gb_key())

Arguments

search

a keyword or term to search.

n

total number of results returned. Defaults to 10.

field_list

columns to return.

limit

total results per page. Defaults to 10.

page

starting page number.

resources

a list of resources to filter results. Accepts options: game, franchise, character, concept, object, location, person, company, video. Multiple options are allowed.

user_agent

allows you to customize the user agent for your requests. See the Details section for more information.

delay

the wait time between each query.

api_key

a GiantBomb api key. The default searches for GB_KEY in your environment variables.

Details

An api key can be retrieved for the GiantBomb API after signing up at https://giantbomb.com/api.

GiantBomb limits the query rate to 200 requests per resource per hour. Additionally, you may experience issues if too many queries are made every second. Each function attempts to mitigate problems by using a delay after each query (default is 30 seconds). You can set delay to 0 if you want to get the information faster, but GiantBomb may begin to block your requests if you do this too often.

You may also want to use the user_agent parameter to customize how your queries are being received. Doing so can minimize the possibility of getting a captcha challenges.

Each query returns a maximum of 10 results per request. In order to get 100 results with a limit of 10, it would take 10 api requests.

Examples

1
2
3
4
5
6
## Not run: 
# Get 10 companies.
res <- gb_search(search = "bioshock", resources = c("company", "game"))
res <- gb_search(search = "2k", resources = c("company"))

## End(Not run)

detroyejr/giantbomb documentation built on May 29, 2019, 7:13 a.m.