class IGDB::Client
- IGDB::Client
- Reference
- Object
Overview
Crystal Client to interface with IGDB
To create a client
client = IGDB.new("my_id","my_token")
To use the client pass a Hash as a parameter with the required query. So to search for Coming Soon Games for PS4
client.get({"fields" => "*",
"where" => "game.platforms = 48 * date < 1538129354",
"sort" => "date desc"})
Defined in:
igdb.crConstant Summary
-
URL =
"https://api.igdb.com/v4/"
Constructors
-
.new(client_id : String, token : String, endpoint : String = "games")
Initialize an IGDB::Client
Macro Summary
Instance Method Summary
- #client_id : String
- #client_id=(client_id : String)
-
#count(params = {"fields" => "*"})
Get count of entries matching parameters
- #endpoint : String
- #endpoint=(endpoint : String)
-
#get(params = {"fields" => "*"}, suffix = "")
Run a query
-
#id(id, params = {"fields" => "*"})
Get entry by ID
-
#search(title, params = {"fields" => "*"})
Run a search on IGDB
- #token : String
- #token=(token : String)
Constructor Detail
Initialize an IGDB::Client
A Client ID and Token must be provided The endpoint can be chosen (defaults to games) All passed parameters can be changed after initialization by using the associated property
Macro Detail
Instance Method Detail
Run a query
Query is constructed from the passed Hash The query should contain keys and values that correspond to IGDB Apicalypse queries. suffix is used to append a suffix to the endpoint to perform an action (e.g. count by passing "/count")
Get entry by ID
id of requested entry needs to be passed additional parameters may optionaly be passed
Run a search on IGDB
title will be the search string additional parameters may optionaly be passed