class

IGDB::Client

Inherits Reference < Object

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"})

Constants

URL = "https://api.igdb.com/v4/"

Constructors

new(client_id : String, token : String, endpoint : String = "games")

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

Source

Instance methods

client_id
Source
client_id=(client_id : String)
Source
count(params = {"fields" => "*"})

Get count of entries matching parameters

Source
endpoint
Source
endpoint=(endpoint : String)
Source
get(params = {"fields" => "*"}, suffix = "")

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")

Source
id(id, params = {"fields" => "*"})

Get entry by ID

id of requested entry needs to be passed additional parameters may optionaly be passed

Source
search(title, params = {"fields" => "*"})

Run a search on IGDB

title will be the search string additional parameters may optionaly be passed

Source
token
Source
token=(token : String)
Source

Macros

method_missing(call)
Source