diff --git a/docs/database.json b/docs/database.json index e9912c4..2f34d35 100644 --- a/docs/database.json +++ b/docs/database.json @@ -1 +1 @@ -{"filename":"DocumentationDB","collections":[{"name":"templates","data":[{"id":"647454e","slug":"getting-started","level":1,"parent":null,"parents":[],"title":"Getting Started","date":null,"timestamp":1669925801000,"body":{"stripped":"Welcome to the IGDB Wrapper documentation! This documentation will cover all of the functionalities of this wrapper with lots of example codes. To personalise these codes you can add your own tokens to this documentation on the main page (click on the logo in the top left corner to go back). This way every code example where the tokens are required will contain your own tokens.\n\nThe wrapper's main purpose is to provide a simple solution to fetch data from IGDB's database using PHP. The wrapper contains endpoint methods for every IGDB API endpoints and even more!\n\nTo have access to IGDB's database you have to register a Twitch Account and have your own client_id and access_token. Refer to the Account Creation and Authentication sections of the IGDB API Documentation for details.","markdown":"Welcome to the IGDB Wrapper documentation! This documentation will cover all of the functionalities of this wrapper with lots of example codes. To personalise these codes you can add your own tokens to this documentation on the main page (click on the logo in the top left corner to go back). This way every code example where the tokens are required will contain your own tokens.\n\nThe wrapper's main purpose is to provide a simple solution to fetch data from IGDB's database using PHP. The wrapper contains endpoint methods for every IGDB API endpoints and even more!\n\nTo have access to IGDB's database you have to register a Twitch Account and have your own `client_id` and `access_token`. Refer to the [Account Creation](https://api-docs.igdb.com/#account-creation) and [Authentication](https://api-docs.igdb.com/#authentication) sections of the [IGDB API Documentation](https://api-docs.igdb.com/) for details.","html":"
Welcome to the IGDB Wrapper documentation! This documentation will cover all of the functionalities of this wrapper with lots of example codes. To personalise these codes you can add your own tokens to this documentation on the main page (click on the logo in the top left corner to go back). This way every code example where the tokens are required will contain your own tokens.
\nThe wrapper's main purpose is to provide a simple solution to fetch data from IGDB's database using PHP. The wrapper contains endpoint methods for every IGDB API endpoints and even more!
\nTo have access to IGDB's database you have to register a Twitch Account and have your own client_id
and access_token
. Refer to the Account Creation and Authentication sections of the IGDB API Documentation for details.
The documentation contains a lot of copy-paste example codes. In most cases, the code snippets contains the instantiation of the IGDB
class. The constructor of this class will require you to pass your client_id
and access_token
. If you would like to have example codes with your personal tokens you can provide these on the front page of the documentation. To get back to the main page, just click the logo on the top left corner.
Clicking the link will open the window where you can see additional information about this feature and two fields where you can store your tokens.
\n\n\n\nIf you chose to save the tokens these will be stored only in your browser locally! If the tokens are not saved the data will be erased when your browser is closed.
\n
After your tokens are set the example codes will contain your tokens which are ready to copy.
\n\nIf you want to delete your tokens you can click the Delete the tokens button anytime.
"},"meta":{"revision":0,"created":1670105056938,"version":0},"$loki":2},{"id":"2ec46b5","slug":"setting-up-your-project","level":2,"parent":"647454e","parents":["647454e"],"title":"Setting up your project","date":null,"timestamp":null,"body":{"stripped":"The project has multiple PHP files which are in the src folder of the repository:\n\nIGDB.php: the IGDB wrapper itself\n\nIGDBEndpointException.php: an exception thrown by the IGDB wrapper endpoint methods\n\nIGDBInvalidParameterException.php: an exception thrown by the Query Builder configuring methods\n\nIGDBQueryBuilder.php: the Query Builder\n\nIGDBUtil.php: utility and helper methods\n\nThese files can be imported one-by-one but it is highly recommended to import the class.igdb.php file which handles all the imports for you.\n\n\n\nAfter the import, you are ready to use the wrapper.\n\n:warning If you decide to import the files separately, make sure to check the source code since the exception classes are imported in the respective files where they are needed with hardcoded paths. The files has to be in the same folder to make it work!","markdown":"The project has multiple PHP files which are in the `src` folder of the repository:\n - **IGDB.php**: the IGDB wrapper itself\n - **IGDBEndpointException.php**: an exception thrown by the IGDB wrapper endpoint methods\n - **IGDBInvalidParameterException.php**: an exception thrown by the Query Builder configuring methods\n - **IGDBQueryBuilder.php**: the Query Builder\n - **IGDBUtil.php**: utility and helper methods\n\nThese files can be imported one-by-one but it is highly recommended to import the `class.igdb.php` file which handles all the imports for you.\n\n```php\n\n```\n\nAfter the import, you are ready to use the wrapper.\n\n>:warning If you decide to import the files separately, make sure to check the source code since the exception classes are imported in the respective files where they are needed with hardcoded paths. The files has to be in the same folder to make it work!","html":"The project has multiple PHP files which are in the src
folder of the repository:
These files can be imported one-by-one but it is highly recommended to import the class.igdb.php
file which handles all the imports for you.
<?php\n\n require_once \"class.igdb.php\";\n\n?>\n
\nAfter the import, you are ready to use the wrapper.
\n\n"},"meta":{"revision":0,"created":1670105056938,"version":0},"$loki":3},{"id":"a1abe44","slug":"instantiating-the-wrapper","level":2,"parent":"647454e","parents":["647454e"],"title":"Instantiating the wrapper","date":null,"timestamp":null,"body":{"stripped":"The wrapper will need your client_id and generated access_token.\n\n\n\nThe wrapper itself does not validate your tokens. If your credentials are invalid you will get an IGDBEndpointException from the endpoint methods when you are sending your queries.","markdown":"The wrapper will need your `client_id` and [generated](https://api-docs.igdb.com/#authentication) `access_token`.\n\n```php\n\n```\n\n> The wrapper itself does not validate your tokens. If your credentials are invalid you will get an `IGDBEndpointException` from the [endpoint methods](#endpoints) when you are sending your queries.","html":":warning If you decide to import the files separately, make sure to check the source code since the exception classes are imported in the respective files where they are needed with hardcoded paths. The files has to be in the same folder to make it work!
\n
The wrapper will need your client_id
and generated access_token
.
<?php\n\n require_once \"class.igdb.php\";\n\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n?>\n
\n\n"},"meta":{"revision":0,"created":1670105056939,"version":0},"$loki":4},{"id":"0e8132a","slug":"building-queries","level":2,"parent":"647454e","parents":["647454e"],"title":"Building Queries","date":null,"timestamp":null,"body":{"stripped":"There is a helper class to build apicalypse queries called IGDBQueryBuilder. With this class you can easily build parameterized queries.\n\n\n\nThe parameters in the above example are valid, so the $query variable will hold the valid apicalypse string.\n\n\n\nFor more details on the Query Builder refer to the IGDB Query Builder section of this documentation.","markdown":"There is a helper class to build apicalypse queries called [`IGDBQueryBuilder`](#igdb-query-builder). With this class you can easily build parameterized queries.\n\n```php\nsearch(\"uncharted 4\")\n ->fields(\"id, name\")\n ->limit(1)\n ->build();\n } catch (IGDBInvalidParameterException $e) {\n // Invalid argument passed to one of the methods\n echo $e->getMessage();\n }\n?>\n```\n\nThe parameters in the above example are valid, so the `$query` variable will hold the valid apicalypse string.\n\n```text\nfields id,name; search \"uncharted 4\"; limit 1;\n```\n\n> For more details on the Query Builder refer to the [IGDB Query Builder section](#igdb-query-builder) of this documentation.","html":"The wrapper itself does not validate your tokens. If your credentials are invalid you will get an
\nIGDBEndpointException
from the endpoint methods when you are sending your queries.
There is a helper class to build apicalypse queries called IGDBQueryBuilder
. With this class you can easily build parameterized queries.
<?php\n\n require_once \"class.igdb.php\";\n\n $builder = new IGDBQueryBuilder();\n\n try {\n $query = $builder\n ->search(\"uncharted 4\")\n ->fields(\"id, name\")\n ->limit(1)\n ->build();\n } catch (IGDBInvalidParameterException $e) {\n // Invalid argument passed to one of the methods\n echo $e->getMessage();\n }\n?>\n
\nThe parameters in the above example are valid, so the $query
variable will hold the valid apicalypse string.
fields id,name; search \"uncharted 4\"; limit 1;\n
\n\n"},"meta":{"revision":0,"created":1670105056939,"version":0},"$loki":5},{"id":"5842ca1","slug":"sending-queries-to-igdb","level":2,"parent":"647454e","parents":["647454e"],"title":"Sending Queries to IGDB","date":null,"timestamp":null,"body":{"stripped":"When your $igdb object is created you can send your queries to the IGDB database right away. There are multiple endpoint methods which will allow you to fetch data from the respective IGDB Endpoint. These endpoint methods in the wrapper will accept apicalypse formatted query strings.\n\n\n\nSince the query is valid we have the $result array containing our matched records.\n\n\n\nFor more details on the IGDB Wrapper refer to the IGDB Wrapper section of this documentation.","markdown":"When your `$igdb` object is created you can send your queries to the IGDB database right away. There are multiple [endpoint methods](#endpoints) which will allow you to fetch data from the respective [IGDB Endpoint](https://api-docs.igdb.com/#endpoints). These endpoint methods in the wrapper will accept [apicalypse](https://api-docs.igdb.com/#apicalypse-1) formatted query strings.\n\n```php\ngame('search \"uncharted 4\"; fields id,name; limit 1;');\n } catch (IGDBEndpointException $e) {\n // Something went wrong, we have an error\n echo $e->getMessage();\n }\n\n?>\n```\n\nSince the query is valid we have the `$result` array containing our matched records.\n\n```text\narray (size=1)\n 0 =>\n object(stdClass)[2]\n public 'id' => int 7331\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n```\n\n> For more details on the IGDB Wrapper refer to the [IGDB Wrapper section](#igdb-wrapper) of this documentation.","html":"For more details on the Query Builder refer to the IGDB Query Builder section of this documentation.
\n
When your $igdb
object is created you can send your queries to the IGDB database right away. There are multiple endpoint methods which will allow you to fetch data from the respective IGDB Endpoint. These endpoint methods in the wrapper will accept apicalypse formatted query strings.
<?php\n\n require_once \"class.igdb.php\";\n\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n try {\n $result = $igdb->game('search \"uncharted 4\"; fields id,name; limit 1;');\n } catch (IGDBEndpointException $e) {\n // Something went wrong, we have an error\n echo $e->getMessage();\n }\n\n?>\n
\nSince the query is valid we have the $result
array containing our matched records.
array (size=1)\n 0 =>\n object(stdClass)[2]\n public 'id' => int 7331\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n
\n\n"},"meta":{"revision":0,"created":1670105056940,"version":0},"$loki":6},{"id":"bf08719","slug":"handling-errors","level":2,"parent":"647454e","parents":["647454e"],"title":"Handling errors","date":null,"timestamp":null,"body":{"stripped":"There are two main type of errors which could occur when using the wrapper:\n\n\"local\" errors: when using the Query Builder to build your queries you may pass invalid parameters to the configuring methods. These methods could throw IGDBInvalidParameterException if an invalid parameter or invalid type of parameter is passed. Head to the Handling Builder Errors section to find out more.\n\n\"remote\" errors: when a query is sent to the IGDB API, but for some reason the query fails. This happens only, when a non-successful response code is recieved from the API. In this case the endpoint methods will throw an IGDBEndpointException. Head to the Handling Request Errors section to find out more.","markdown":"There are two main type of errors which could occur when using the wrapper:\n - **\"local\" errors**: when using the [Query Builder](#igdb-query-builder) to build your queries you may pass invalid parameters to the [configuring methods](#configuring-methods). These methods could throw `IGDBInvalidParameterException` if an invalid parameter or invalid type of parameter is passed. Head to the [Handling Builder Errors](#handling-builder-errors) section to find out more.\n\n - **\"remote\" errors**: when a query is sent to the IGDB API, but for some reason the query fails. This happens only, when a non-successful response code is recieved from the API. In this case the [endpoint methods](#endpoints) will throw an `IGDBEndpointException`. Head to the [Handling Request Errors](#handling-request-errors) section to find out more.","html":"For more details on the IGDB Wrapper refer to the IGDB Wrapper section of this documentation.
\n
There are two main type of errors which could occur when using the wrapper:
\n\"local\" errors: when using the Query Builder to build your queries you may pass invalid parameters to the configuring methods. These methods could throw IGDBInvalidParameterException
if an invalid parameter or invalid type of parameter is passed. Head to the Handling Builder Errors section to find out more.
\"remote\" errors: when a query is sent to the IGDB API, but for some reason the query fails. This happens only, when a non-successful response code is recieved from the API. In this case the endpoint methods will throw an IGDBEndpointException
. Head to the Handling Request Errors section to find out more.
This class is a helper class to help you construct your queries. If you have used this wrapper's eariler versions you were able to send queries by passing an $options
array directly to the endpoint methods. This possibility got removed and these endpoint methods are accepting only apicalypse formatted query strings.
\n"},"icon":"fa-hammer","overview":"Everything about the Query Builder. Configuring and building your queries.","meta":{"revision":0,"created":1670105056940,"version":0},"$loki":8},{"id":"b249413","slug":"instantiating-the-builder","level":2,"parent":"1bc2dc4","parents":["1bc2dc4"],"title":"Instantiating the Builder","date":null,"timestamp":null,"body":{"stripped":"To instantiate the Builder simply use the new keyword.\n\n\n\nNow the $builder object will expose every configuring methods to set up your query before building it.","markdown":"To instantiate the Builder simply use the `new` keyword.\n\n```php\n\n```\n\nNow the `$builder` object will expose every configuring methods to set up your query before [building it](#building-the-query).","html":":tip Using the Builder class is optional as you can pass your own queries to the endpoint methods.
\n
To instantiate the Builder simply use the new
keyword.
<?php\n\n require_once \"class.igdb.php\";\n\n $builer = new IGDBQueryBuiler();\n\n?>\n
\nNow the $builder
object will expose every configuring methods to set up your query before building it.
There are two ways to configure the builder.
"},"meta":{"revision":0,"created":1670105056941,"version":0},"$loki":10},{"id":"6488c7b","slug":"builder-approach","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","3da3bbd"],"title":"Builder approach","date":null,"timestamp":null,"body":{"stripped":"The Builder is using a builder pattern to configure itself with the configuring methods before parsing the properties to a query string. When every parameter is set, calling the build() method will start processing the parameters and will return the query string itself.\n\n:warning When using the builder approach, you must enclose your configuring methods in try...catch blocks. Read more on this in the Handling Builder Errors section.","markdown":"The Builder is using a builder pattern to configure itself with the [configuring methods](#configuring-methods) before parsing the properties to a query string. When every parameter is set, calling the [`build()`](#building-the-query) method will start processing the parameters and will return the query string itself.\n\n>:warning When using the builder approach, you must enclose your configuring methods in try...catch blocks. Read more on this in the [Handling Builder Errors](#handling-builder-errors) section.\n\n```php\nsearch(\"uncharted 4\")\n ->fields(\"id, name\")\n ->limit(1)\n // make sure to call the build method to parse the query string\n ->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid value passed to a method\n echo $e->getMessage();\n }\n\n?>\n```","html":"The Builder is using a builder pattern to configure itself with the configuring methods before parsing the properties to a query string. When every parameter is set, calling the build()
method will start processing the parameters and will return the query string itself.
\n\n:warning When using the builder approach, you must enclose your configuring methods in try...catch blocks. Read more on this in the Handling Builder Errors section.
\n
<?php\n\n require_once \"class.igdb.php\";\n\n $builder = new IGDBQueryBuilder();\n\n try {\n $query = $builder\n ->search(\"uncharted 4\")\n ->fields(\"id, name\")\n ->limit(1)\n // make sure to call the build method to parse the query string\n ->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid value passed to a method\n echo $e->getMessage();\n }\n\n?>\n
"},"meta":{"revision":0,"created":1670105056941,"version":0},"$loki":11},{"id":"0364192","slug":"traditional-approach","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","3da3bbd"],"title":"Traditional approach","date":null,"timestamp":null,"body":{"stripped":"To support the traditional approach of configuring the queries - the $options array - there is a method called options(). Passing your $options array to this method will process your parameters and will set up the builder.\n\n:warning Using the Builder this way is not recommended as this functionality may will be removed in future versions. Use the builder approach instead.","markdown":"To support the traditional approach of configuring the queries - the `$options` array - there is a method called [`options()`](#options). Passing your `$options` array to this method will process your parameters and will set up the builder.\n\n>:warning Using the Builder this way is not recommended as this functionality may will be removed in future versions. Use the [builder approach](#builder-approach) instead.\n\n```php\n \"uncharted 4\",\n \"fields\" => \"id,name\",\n \"limit\" => 1\n );\n\n try {\n // pass your $options to the options method\n // then build the query\n $query = $builder->options($options)->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```","html":"To support the traditional approach of configuring the queries - the $options
array - there is a method called options()
. Passing your $options
array to this method will process your parameters and will set up the builder.
\n\n:warning Using the Builder this way is not recommended as this functionality may will be removed in future versions. Use the builder approach instead.
\n
<?php\n\n require_once \"class.igdb.php\";\n\n $builder = new IGDBQueryBuilder();\n\n $options = array(\n \"search\" => \"uncharted 4\",\n \"fields\" => \"id,name\",\n \"limit\" => 1\n );\n\n try {\n // pass your $options to the options method\n // then build the query\n $query = $builder->options($options)->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
"},"meta":{"revision":0,"created":1670105056942,"version":0},"$loki":12},{"id":"36c9e8f","slug":"handling-builder-errors","level":2,"parent":"1bc2dc4","parents":["1bc2dc4"],"title":"Handling Builder Errors","date":null,"timestamp":null,"body":{"stripped":"When an invalid parameter is passed to any of the configuring methods, an IGDBInvaliParameterException is thrown. To properly handle these errors, at least the configuring methods should be enclosed in a try...catch block. Calling the getMessage() method of the exception object will return the error message.\n\n\n\nThe script above will produce this output:\n\n\n\nIt is important to keep in mind, that this validation is happening \"locally\" on your server. The query builder can only validate the type of variables you pass, or it can validate against a list of predefined values that the API expects. For example, if the example above is altered like this:\n\n\n\nThe builder will not throw an exception as the method got a string, which is valid. The output of the script will be:\n\n\n\nThe field nonexistingfield does not exist on the game endpoint which will cause an error on the IGDB API. These errors has to be handled separately. Read more on this in the Handling Request Errors section.","markdown":"When an invalid parameter is passed to any of the [configuring methods](#configuring-methods), an `IGDBInvaliParameterException` is thrown. To properly handle these errors, at least the configuring methods should be enclosed in a try...catch block. Calling the `getMessage()` method of the exception object will return the error message.\n\n```php\nsearch(\"uncharted\")\n // passing an integer to the fields parameter is invalid\n // as this methods expects a string or an array of strings\n ->fields(1)\n ->build();\n\n echo $query;\n } catch (IGDBInvalidParameterException $e) {\n // catching the exception, printing the error message\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe script above will produce this output:\n\n```text\nInvalid type of parameter for fields! String or array of strings are expected, integer passed!\n```\n\nIt is important to keep in mind, that this validation is happening \"locally\" on your server. The query builder can only validate the type of variables you pass, or it can validate against a list of predefined values that the API expects. For example, if the example above is altered like this:\n\n```php\nsearch(\"uncharted\")\n // passing a field name that doesnt exist on the game endpoint\n ->fields(\"nonexistingfield\")\n ->build();\n\n // no exception thrown, printing the query string\n echo $query;\n } catch (IGDBInvalidParameterException $e) {\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe builder will not throw an exception as the method got a string, which is valid. The output of the script will be:\n\n```text\nfields nonexistingfield; search \"uncharted\";\n```\n\nThe field `nonexistingfield` does not exist on the `game` endpoint which will cause an error on the IGDB API. These errors has to be handled separately. Read more on this in the [Handling Request Errors](#handling-request-errors) section.","html":"When an invalid parameter is passed to any of the configuring methods, an IGDBInvaliParameterException
is thrown. To properly handle these errors, at least the configuring methods should be enclosed in a try...catch block. Calling the getMessage()
method of the exception object will return the error message.
<?php\n\n $builder = new IGDBQueryBuilder();\n\n try {\n $query = $builder\n ->search(\"uncharted\")\n // passing an integer to the fields parameter is invalid\n // as this methods expects a string or an array of strings\n ->fields(1)\n ->build();\n\n echo $query;\n } catch (IGDBInvalidParameterException $e) {\n // catching the exception, printing the error message\n echo $e->getMessage();\n }\n\n?>\n
\nThe script above will produce this output:
\nInvalid type of parameter for fields! String or array of strings are expected, integer passed!\n
\nIt is important to keep in mind, that this validation is happening \"locally\" on your server. The query builder can only validate the type of variables you pass, or it can validate against a list of predefined values that the API expects. For example, if the example above is altered like this:
\n<?php\n\n $builder = new IGDBQueryBuilder();\n\n try {\n $query = $builder\n ->search(\"uncharted\")\n // passing a field name that doesnt exist on the game endpoint\n ->fields(\"nonexistingfield\")\n ->build();\n\n // no exception thrown, printing the query string\n echo $query;\n } catch (IGDBInvalidParameterException $e) {\n echo $e->getMessage();\n }\n\n?>\n
\nThe builder will not throw an exception as the method got a string, which is valid. The output of the script will be:
\nfields nonexistingfield; search \"uncharted\";\n
\nThe field nonexistingfield
does not exist on the game
endpoint which will cause an error on the IGDB API. These errors has to be handled separately. Read more on this in the Handling Request Errors section.
The Builder class has its own configuring methods to set the parameters before building the query string. If any of these methods recieves an invalid argument they will throw an IGDBInvalidArgumentException
. Make sure to set these parameters in a try...catch block.
public function count(boolean $count = true) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nThis method will accept a boolean value. This parameter is processed in case of a multiquery build only. If this value is true
the response from IGDB will contain the number of records matching the filters. If false
the records will be returned.
\n\nIf the method is called without parameters, the value will be set to
\ntrue
.
Default value: by default this value is false
, the queries will return the records instead of their count.
Parameters:
\n$count
: true
if a record count is required, false
otherwise.Returns: IGDBQueryBuilder
instance
<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // Configuring the query\n $builder\n ->name(\"Number of games\")\n ->endpoint(\"game\")\n // the default value of count is false\n // to retrieve the count of the matched records, set it to true\n // ->count(true) has the same result\n ->count();\n\n // if you wish to remove the count parameter for any reason later on\n // you can call the count method with a false parameter\n // ->count(false)\n\n // building the query\n $query = $builder->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\nThe value of $query
:
query games/count \"Number of games\" {\n fields *;\n};\n
"},"meta":{"revision":0,"created":1670105056943,"version":0},"$loki":15},{"id":"81d2aed","slug":"custom-where","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Custom Where","date":null,"timestamp":null,"body":{"stripped":"This method will add a where statement to your query, but will not validate your input or throw any exceptions.\n\nParameters:\n\n$custom_where: an apicalypse string with a custom where statement\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function custom_where(string $custom_where): IGDBQueryBuilder\n```\n\nThis method will add a [where statement](#where) to your query, but will not validate your input or throw any exceptions.\n\n**Parameters**:\n - `$custom_where`: an apicalypse string with a custom where statement\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"(platforms = [6,48] & genres = 13) | (platforms = [130,48] & genres = 12)\"\n );\n\n // builder approach\n $builder->custom_where(\"(platforms = [6,48] & genres = 13) | (platforms = [130,48] & genres = 12)\");\n\n?>\n```","html":"public function custom_where(string $custom_where): IGDBQueryBuilder\n
\nThis method will add a where statement to your query, but will not validate your input or throw any exceptions.
\nParameters:
\n$custom_where
: an apicalypse string with a custom where statementReturns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach\n $options = array(\n \"custom_where\" => \"(platforms = [6,48] & genres = 13) | (platforms = [130,48] & genres = 12)\"\n );\n\n // builder approach\n $builder->custom_where(\"(platforms = [6,48] & genres = 13) | (platforms = [130,48] & genres = 12)\");\n\n?>\n
"},"meta":{"revision":0,"created":1670105056943,"version":0},"$loki":16},{"id":"8bff07a","slug":"endpoint","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Endpoint","date":null,"timestamp":null,"body":{"stripped":"This method will set the endpoint to send your multiquery against. This parameter is processed in case of a multiquery build only. When setting this value make sure to use the name of the endpoint instead of it's request path. (for example game instead of games and so on).\n\n:warning In case of a multiquery build this parameter is mandatory! If this is missing from the configuration the build will throw an IGDBInvalidParameterException! Refer to the build method for details.\n\nParameters:\n\n$endpoint: the name of the endpoint to send the query against. Make sure to use the name of the endpoint instead of it's request path! The list of endpoints for this parameter:\n\nage_rating\n\nalternative_name\n\nartwork\n\ncharacter_mug_shot\n\ncharacter\n\ncollection\n\ncompany_logo\n\ncompany_website\n\ncompany\n\ncover\n\nexternal_game\n\nfranchise\n\ngame_engine_logo\n\ngame_engine\n\ngame_mode\n\ngame_version_feature_value\n\ngame_version_feature\n\ngame_version\n\ngame_video\n\ngame\n\ngenre\n\ninvolved_company\n\nkeyword\n\nmultiplayer_mode\n\nmultiquery\n\nplatform_family\n\nplatform_logo\n\nplatform_version_company\n\nplatform_version_release_date\n\nplatform_version\n\nplatform_website\n\nplatform\n\nplayer_perspective\n\nrelease_date\n\nscreenshot\n\nsearch\n\ntheme\n\nwebsite\n\nReturns: IGDBQueryBuilder instance\n\n\n\nThe value of $query:","markdown":"```php\npublic function endpoint(string $endpoint) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nThis method will set the endpoint to send your **multiquery** against. This parameter is processed **in case of a multiquery build only**. When setting this value make sure to use the name of the endpoint instead of it's request path. (for example `game` instead of `games` and so on).\n\n>:warning In case of a multiquery build this parameter is mandatory! If this is missing from the configuration the build will throw an `IGDBInvalidParameterException`! Refer to the [build method](#building-the-query) for details.\n\n**Parameters**:\n - `$endpoint`: the name of the endpoint to send the query against. Make sure to use the name of the endpoint instead of it's request path! The list of endpoints for this parameter:\n - age_rating\n - alternative_name\n - artwork\n - character_mug_shot\n - character\n - collection\n - company_logo\n - company_website\n - company\n - cover\n - external_game\n - franchise\n - game_engine_logo\n - game_engine\n - game_mode\n - game_version_feature_value\n - game_version_feature\n - game_version\n - game_video\n - game\n - genre\n - involved_company\n - keyword\n - multiplayer_mode\n - multiquery\n - platform_family\n - platform_logo\n - platform_version_company\n - platform_version_release_date\n - platform_version\n - platform_website\n - platform\n - player_perspective\n - release_date\n - screenshot\n - search\n - theme\n - website\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\nname(\"Game with ID of 25076\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\");\n\n // building the query\n $query = $builder->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe value of `$query`:\n\n```text\nquery games \"Game with ID 25076\" {\n fields id,name;\n where id = 25076;\n};\n```","html":"public function endpoint(string $endpoint) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nThis method will set the endpoint to send your multiquery against. This parameter is processed in case of a multiquery build only. When setting this value make sure to use the name of the endpoint instead of it's request path. (for example game
instead of games
and so on).
\n\n:warning In case of a multiquery build this parameter is mandatory! If this is missing from the configuration the build will throw an
\nIGDBInvalidParameterException
! Refer to the build method for details.
Parameters:
\n$endpoint
: the name of the endpoint to send the query against. Make sure to use the name of the endpoint instead of it's request path! The list of endpoints for this parameter:\nReturns: IGDBQueryBuilder
instance
<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // configuring the query\n $builder\n ->name(\"Game with ID of 25076\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\");\n\n // building the query\n $query = $builder->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\nThe value of $query
:
query games \"Game with ID 25076\" {\n fields id,name;\n where id = 25076;\n};\n
"},"meta":{"revision":0,"created":1670105056944,"version":0},"$loki":17},{"id":"140e5d5","slug":"exclude","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Exclude","date":null,"timestamp":null,"body":{"stripped":"Exclude is a complement to the regular fields which allows you to request all fields with the exception of any numbers of fields specified with exclude.\n\nParameters:\n\n$exclude: the list of the fields to exclude. This can be either a comma separated list of field names or an array of field names.\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function exclude(string | array $exclude) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nExclude is a complement to the regular fields which allows you to request all fields with the exception of any numbers of fields specified with exclude.\n\n**Parameters**:\n - `$exclude`: the list of the fields to exclude. This can be either a comma separated list of field names or an array of field names.\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"name,slug\"\n );\n\n // traditional approach, as an array\n $options = array(\n \"exclude\" => array(\"name\", \"slug\")\n );\n\n // builder approach, as a string\n $builder->exclude(\"name,slug\");\n\n // builder approach, as an array\n $builder->exclude(array(\"name\", \"slug\"));\n\n?>\n```","html":"public function exclude(string | array $exclude) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nExclude is a complement to the regular fields which allows you to request all fields with the exception of any numbers of fields specified with exclude.
\nParameters:
\n$exclude
: the list of the fields to exclude. This can be either a comma separated list of field names or an array of field names.Returns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach, as a string\n $options = array(\n \"exclude\" => \"name,slug\"\n );\n\n // traditional approach, as an array\n $options = array(\n \"exclude\" => array(\"name\", \"slug\")\n );\n\n // builder approach, as a string\n $builder->exclude(\"name,slug\");\n\n // builder approach, as an array\n $builder->exclude(array(\"name\", \"slug\"));\n\n?>\n
"},"meta":{"revision":0,"created":1670105056944,"version":0},"$loki":18},{"id":"3045e49","slug":"fields","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Fields","date":null,"timestamp":null,"body":{"stripped":"You can tell which fields you want to get in the result with this parameter.\n\nFields are properties of an entity. For example, a Game field would be genres or release_dates. Some fields have properties of their own, for example, the genres field has the property name.\n\nDefault value: by default every field (\\*) will be requested from the endpoint.\n\nParameters:\n\n$fields: the list of the required fields. This can be either a comma separated list of field names, or an array of field names.\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function fields(string | array $fields) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nYou can tell which fields you want to get in the result with this parameter.\n\nFields are properties of an entity. For example, a Game field would be genres or release_dates. Some fields have properties of their own, for example, the genres field has the property name.\n\n**Default value**: by default every field (`*`) will be requested from the endpoint.\n\n**Parameters**:\n - `$fields`: the list of the required fields. This can be either a comma separated list of field names, or an array of field names.\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"id,name\"\n );\n\n // traditional approach, as an array\n $options = array(\n \"fields\" => array(\"id\", \"name\")\n );\n\n // builder approach, as a string\n $builder->fields(\"id,name\");\n\n // builder approach, as an array\n $builder->fields(array(\"id\", \"name\"));\n\n?>\n```","html":"public function fields(string | array $fields) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nYou can tell which fields you want to get in the result with this parameter.
\nFields are properties of an entity. For example, a Game field would be genres or release_dates. Some fields have properties of their own, for example, the genres field has the property name.
\nDefault value: by default every field (*
) will be requested from the endpoint.
Parameters:
\n$fields
: the list of the required fields. This can be either a comma separated list of field names, or an array of field names.Returns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach, as a string\n $options = array(\n \"fields\" => \"id,name\"\n );\n\n // traditional approach, as an array\n $options = array(\n \"fields\" => array(\"id\", \"name\")\n );\n\n // builder approach, as a string\n $builder->fields(\"id,name\");\n\n // builder approach, as an array\n $builder->fields(array(\"id\", \"name\"));\n\n?>\n
"},"meta":{"revision":0,"created":1670105056944,"version":0},"$loki":19},{"id":"4188856","slug":"id","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"ID","date":null,"timestamp":null,"body":{"stripped":"This is kind of a traditional thing. Since the IGDB team introduced the apicalypse query there is no separate ID field. This method simply adds a where statement to your query.\n\n\n\nParameters:\n\n$id: one (integer) or more (array of integers) record ID's.\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function id(array | int $id) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nThis is kind of a traditional thing. Since the IGDB team introduced the apicalypse query there is no separate ID field. This method simply adds a [where](#where) statement to your query.\n\n```php\nid(1);\n // where id = 1;\n\n $builder->id(array(1,2,3));\n // where id = (1,2,3);\n\n?>\n```\n\n**Parameters**:\n - `$id`: one (integer) or more (array of integers) record ID's.\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n 1\n );\n\n // traditional approach, multiple id's\n $options = array(\n \"id\" => array(1,2,3)\n );\n\n // builder approach, single id\n $builder->id(1);\n\n // builder approach, multiple id's\n $builder->id(array(1,2,3));\n\n?>\n```","html":"public function id(array | int $id) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nThis is kind of a traditional thing. Since the IGDB team introduced the apicalypse query there is no separate ID field. This method simply adds a where statement to your query.
\n<?php\n\n $builder->id(1);\n // where id = 1;\n\n $builder->id(array(1,2,3));\n // where id = (1,2,3);\n\n?>\n
\nParameters:
\n$id
: one (integer) or more (array of integers) record ID's.Returns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach, single id\n $options = array(\n \"id\" => 1\n );\n\n // traditional approach, multiple id's\n $options = array(\n \"id\" => array(1,2,3)\n );\n\n // builder approach, single id\n $builder->id(1);\n\n // builder approach, multiple id's\n $builder->id(array(1,2,3));\n\n?>\n
"},"meta":{"revision":0,"created":1670105056945,"version":0},"$loki":20},{"id":"16826a6","slug":"limit","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Limit","date":null,"timestamp":null,"body":{"stripped":"The maximum number of results in a single query. This value must be a number between 1 and 500.\n\nDefault value: by default the IGDB API will return 10 results.\n\nParameters:\n\n$limit: a number between 1 and 500\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function limit(int $limit) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nThe maximum number of results in a single query. This value must be a number between `1` and `500`.\n\n**Default value**: by default the IGDB API will return `10` results.\n\n**Parameters**:\n - `$limit`: a number between 1 and 500\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n array(\n \"limit\" => 20\n );\n\n // builder approach\n $builder->limit(20);\n\n?>\n```","html":"public function limit(int $limit) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nThe maximum number of results in a single query. This value must be a number between 1
and 500
.
Default value: by default the IGDB API will return 10
results.
Parameters:
\n$limit
: a number between 1 and 500Returns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach\n $options => array(\n \"limit\" => 20\n );\n\n // builder approach\n $builder->limit(20);\n\n?>\n
"},"meta":{"revision":0,"created":1670105056945,"version":0},"$loki":21},{"id":"d3a8245","slug":"name","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Name","date":null,"timestamp":null,"body":{"stripped":"This method will set a name for the query. This parameter is processed in case of a multiquery build only.\n\n:warning In case of a multiquery build this parameter is mandatory! If this is missing from the configuration the build will throw an IGDBInvalidParameterException! Refer to the build method for details.\n\nParameters:\n\n$name: the name of the query\n\nReturns: IGDBQueryBuilder instance\n\n\n\nThe value of $query:","markdown":"```php\npublic function name(string $name) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nThis method will set a name for the query. This parameter is processed **in case of a multiquery build only**.\n\n>:warning In case of a multiquery build this parameter is **mandatory**! If this is missing from the configuration the build will throw an `IGDBInvalidParameterException`! Refer to the [build method](#building-the-query) for details.\n\n**Parameters**:\n - `$name`: the name of the query\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\nname(\"Game with ID of 25076\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\");\n\n // building the query\n $query = $builder->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe value of `$query`:\n\n```text\nquery games \"Game with ID 25076\" {\n fields id,name;\n where id = 25076;\n};\n```","html":"public function name(string $name) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nThis method will set a name for the query. This parameter is processed in case of a multiquery build only.
\n\n\n:warning In case of a multiquery build this parameter is mandatory! If this is missing from the configuration the build will throw an
\nIGDBInvalidParameterException
! Refer to the build method for details.
Parameters:
\n$name
: the name of the queryReturns: IGDBQueryBuilder
instance
<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // configuring the query\n $builder\n ->name(\"Game with ID of 25076\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\");\n\n // building the query\n $query = $builder->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\nThe value of $query
:
query games \"Game with ID 25076\" {\n fields id,name;\n where id = 25076;\n};\n
"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":22},{"id":"00cc049","slug":"offset","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Offset","date":null,"timestamp":null,"body":{"stripped":"This will start the result list at the provided value and will give limit number of results. This value must be 0 or greater.\n\nDefault value: the IGDB API will use 0 as a default offset value.\n\nParameters:\n\n$offset: a number which can be 0 or greater.\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function offset(int $offset) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nThis will start the result list at the provided value and will give [`limit`](#limit) number of results. This value must be `0` or greater.\n\n**Default value**: the IGDB API will use `0` as a default offset value.\n\n**Parameters**:\n - `$offset`: a number which can be `0` or greater.\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n 5\n );\n\n // builder approach\n $builder->offset(5);\n\n?>\n```","html":"public function offset(int $offset) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nThis will start the result list at the provided value and will give limit
number of results. This value must be 0
or greater.
Default value: the IGDB API will use 0
as a default offset value.
Parameters:
\n$offset
: a number which can be 0
or greater.Returns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach\n $options = array(\n \"offset\" => 5\n );\n\n // builder approach\n $builder->offset(5);\n\n?>\n
"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":23},{"id":"9c7d4f3","slug":"options","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Options","date":null,"timestamp":null,"body":{"stripped":":warning Using the Builder this way is not recommended as this functionality may be removed in future versions. Use the builder approach instead.\n\nWith this method you can parse your $options array instead of using the builder approach. If a non-valid key or value is in the array, an IGDBInvalidParameterException will be thrown.\n\nPassing your $options array to this method will configure the builder with the parameters in it.\n\nParameters:\n\n$options: the options array with your configuration in it\n\nReturns: IGDBQueryBuilder instance\n\n\n\n:warning Calling this method will not reset the configuration. Stacking the options() calls will add each parameter to the builder, overwriting the old values with the new ones. To clear the previous configuration items use the reset method.\n\n\n\nThe query:","markdown":"```php\npublic function options(array $options) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\n>:warning Using the Builder this way is not recommended as this functionality may be removed in future versions. Use the [builder approach](#builder-approach) instead.\n\nWith this method you can parse your `$options` array instead of using the [builder approach](#builder-approach). If a non-valid key or value is in the array, an `IGDBInvalidParameterException` will be thrown.\n\nPassing your `$options` array to this method will configure the builder with the parameters in it.\n\n**Parameters**:\n - `$options`: the options array with your configuration in it\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"uncharted 4\",\n \"fields\" => \"id,name\",\n \"limit\" => 1\n );\n\n try {\n // configuring the builder with an options array\n $builder->options($options);\n\n // still have to call the build method to building the query\n $query = $builder->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```\n\n>:warning Calling this method **will not reset** the configuration. Stacking the `options()` calls will add each parameter to the builder, overwriting the old values with the new ones. To clear the previous configuration items use the [reset method](#reset).\n\n```php\noptions(array(\"search\" => \"uncharted\"))\n ->options(array(\"fields\" => \"id,name\"))\n // this call will overwrite the search parameter!\n ->options(array(\"search\" => \"overwritten uncharted\"))\n ->options(array(\"limit\" => 1));\n\n // building the query\n $query = $builder->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe query:\n\n```text\nfields id,name; search \"overwritten uncharted\"; limit 1;\n```","html":"public function options(array $options) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\n\n\n:warning Using the Builder this way is not recommended as this functionality may be removed in future versions. Use the builder approach instead.
\n
With this method you can parse your $options
array instead of using the builder approach. If a non-valid key or value is in the array, an IGDBInvalidParameterException
will be thrown.
Passing your $options
array to this method will configure the builder with the parameters in it.
Parameters:
\n$options
: the options array with your configuration in itReturns: IGDBQueryBuilder
instance
<?php\n\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n // setting up the options array\n $options = array(\n \"search\" => \"uncharted 4\",\n \"fields\" => \"id,name\",\n \"limit\" => 1\n );\n\n try {\n // configuring the builder with an options array\n $builder->options($options);\n\n // still have to call the build method to building the query\n $query = $builder->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\n\n\n:warning Calling this method will not reset the configuration. Stacking the
\noptions()
calls will add each parameter to the builder, overwriting the old values with the new ones. To clear the previous configuration items use the reset method.
<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // stacking the options calls will add each parameter as this not resets the configuration\n $builder\n ->options(array(\"search\" => \"uncharted\"))\n ->options(array(\"fields\" => \"id,name\"))\n // this call will overwrite the search parameter!\n ->options(array(\"search\" => \"overwritten uncharted\"))\n ->options(array(\"limit\" => 1));\n\n // building the query\n $query = $builder->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\nThe query:
\nfields id,name; search \"overwritten uncharted\"; limit 1;\n
"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":24},{"id":"5b09832","slug":"reset","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Reset","date":null,"timestamp":null,"body":{"stripped":"This method will reset every configuration to the default values.\n\nParameters: -\n\nReturns: IGDBQueryBuilder instance\n\n\n\nThe code above will return the $options2 array's configuration, as it got reset with the reset() method.","markdown":"```php\npublic function reset(): IGDBQueryBuilder\n```\n\nThis method will reset every configuration to the default values.\n\n**Parameters**: -\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"uncharted 4\",\n \"fields\" => \"id,name\",\n \"limit\" => 2\n );\n\n // setting upt he options2 array\n $options2 = array(\n \"search\" => \"star wars\",\n \"fields\" => \"cover,slug\",\n \"limit\" => 1\n );\n\n try {\n // configuring the builder with options1, reset the values then pass options2\n $builder->options($options1)->reset()->options($options2);\n\n // building the query\n $query = $builder->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe code above will return the `$options2` array's configuration, as it got reset with the `reset()` method.\n\n```text\nfields cover,slug; search \"star wars\"; limit 1;\n```","html":"public function reset(): IGDBQueryBuilder\n
\nThis method will reset every configuration to the default values.
\nParameters: -
\nReturns: IGDBQueryBuilder
instance
<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n // setting up the options1 array\n $options1 = array(\n \"search\" => \"uncharted 4\",\n \"fields\" => \"id,name\",\n \"limit\" => 2\n );\n\n // setting upt he options2 array\n $options2 = array(\n \"search\" => \"star wars\",\n \"fields\" => \"cover,slug\",\n \"limit\" => 1\n );\n\n try {\n // configuring the builder with options1, reset the values then pass options2\n $builder->options($options1)->reset()->options($options2);\n\n // building the query\n $query = $builder->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\nThe code above will return the $options2
array's configuration, as it got reset with the reset()
method.
fields cover,slug; search \"star wars\"; limit 1;\n
"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":25},{"id":"9b526d4","slug":"search","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Search","date":null,"timestamp":null,"body":{"stripped":"Search based on name, results are sorted by similarity to the given search string.\n\nParameters:\n\n$search: the search string\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function search(string $search) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nSearch based on name, results are sorted by similarity to the given search string.\n\n**Parameters**:\n - `$search`: the search string\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"uncharted 4\"\n );\n\n // builder approach\n $builder->search(\"uncharted 4\");\n\n?>\n```","html":"public function search(string $search) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nSearch based on name, results are sorted by similarity to the given search string.
\nParameters:
\n$search
: the search stringReturns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach\n $options = array(\n \"search\" => \"uncharted 4\"\n );\n\n // builder approach\n $builder->search(\"uncharted 4\");\n\n?>\n
"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":26},{"id":"71fc60c","slug":"sort","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Sort","date":null,"timestamp":null,"body":{"stripped":"Sorting (ordering) is used to order results by a specific field. The parameter can be either an apicalypse formatted sort string or an array with specific key-value pairs. If you provide the Order parameter as an array, you must have two values in it with the following keys:\n\nfield: The field you want to do the ordering by\n\ndirection: The direction of the ordering. It must be either asc for ascending or desc for descending ordering.\n\nParameters:\n\n$sort: either an apicalypse sort string or an array with specific key-value pairs.\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function sort(string | array $sort) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nSorting (ordering) is used to order results by a specific field. The parameter can be either an apicalypse formatted sort string or an array with specific key-value pairs. If you provide the Order parameter as an array, you must have two values in it with the following keys:\n - `field`: The field you want to do the ordering by\n - `direction`: The direction of the ordering. It must be either `asc` for ascending or `desc` for descending ordering.\n\n**Parameters**:\n - `$sort`: either an apicalypse sort string or an array with specific key-value pairs.\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"release_dates.date desc\",\n );\n\n // traditional approach as an array\n $options = array(\n \"sort\" => array(\n \"field\" => \"release_dates.date\",\n \"direction\" => \"desc\"\n )\n );\n\n // builder approach as a string\n $builder->sort(\"release_dates.date desc\");\n\n // builder approach as an array\n $builder->sort(\n array(\n \"field\" => \"release_dates.date\",\n \"direction\" => \"desc\"\n )\n );\n\n?>\n```","html":"public function sort(string | array $sort) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nSorting (ordering) is used to order results by a specific field. The parameter can be either an apicalypse formatted sort string or an array with specific key-value pairs. If you provide the Order parameter as an array, you must have two values in it with the following keys:
\nfield
: The field you want to do the ordering bydirection
: The direction of the ordering. It must be either asc
for ascending or desc
for descending ordering.Parameters:
\n$sort
: either an apicalypse sort string or an array with specific key-value pairs.Returns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach as a string\n $options = array(\n \"sort\" => \"release_dates.date desc\",\n );\n\n // traditional approach as an array\n $options = array(\n \"sort\" => array(\n \"field\" => \"release_dates.date\",\n \"direction\" => \"desc\"\n )\n );\n\n // builder approach as a string\n $builder->sort(\"release_dates.date desc\");\n\n // builder approach as an array\n $builder->sort(\n array(\n \"field\" => \"release_dates.date\",\n \"direction\" => \"desc\"\n )\n );\n\n?>\n
"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":27},{"id":"97f826b","slug":"where","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Where","date":null,"timestamp":null,"body":{"stripped":"Filters are used to swift through results to get what you want. You can exclude and include results based on their properties. For example you could remove all Games where the rating was below 80 (where rating >= 80).\n\nThe where parameter can be either an apicalypse formatted string or an array with specific key-value pairs. If you provide the where parameters as an array, you must have three fix keys in it:\n\nfield: The name of the field you want to apply the filter to.\n\npostfix: The postfix you want to use with the filter. Refer to the Available Postfixes section of the IGDB Filters Documentation for available postfixes.\n\nvalue: The value of the filter.\n\nThe where filters will be concatenated with AND operators (&).\n\n:tip Multiple filter parameters can be applied to the same query. Check the examples below.\n\nParameters:\n\n$where: either an apicalypse formatted string or an array with specific keys\n\nReturns: IGDBQueryBuilder instance\n\n\n\nThis method is trying to validate your input against some rules and will throw an IGDBInvalidArgumentException in case of any issues. If you need more flexibility or custom where statements with complex conditions in you queries use the Custom Where method instead.","markdown":"```php\npublic function where(string | array $where) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nFilters are used to swift through results to get what you want. You can exclude and include results based on their properties. For example you could remove all Games where the rating was below 80 `(where rating >= 80)`.\n\nThe where parameter can be either an apicalypse formatted string or an array with specific key-value pairs. If you provide the where parameters as an array, you must have three fix keys in it:\n - `field`: The name of the field you want to apply the filter to.\n - `postfix`: The postfix you want to use with the filter. Refer to the [Available Postfixes](https://api-docs.igdb.com/#filters) section of the IGDB Filters Documentation for available postfixes.\n - `value`: The value of the filter.\n\nThe where filters will be concatenated with **AND** operators (`&`).\n\n>:tip Multiple filter parameters can be applied to the same query. Check the examples below.\n\n**Parameters**:\n - `$where`: either an apicalypse formatted string or an array with specific keys\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"release_dates.platform = 8\"\n );\n\n // traditional approach, single criteria as an array\n $options = array(\n \"where\" => array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n )\n );\n\n // traditional approach, multiple criteria as a string\n $options = array(\n \"where\" => array(\n \"release_dates.platform = 8\",\n \"total_rating >= 70\"\n );\n );\n\n // traditional approach, multiple criteria as an array\n $options = array(\n \"where\" => array(\n array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n ),\n array(\n \"field\" => \"total_rating\",\n \"postfix\" => \">=\",\n \"value\" => 70\n )\n )\n );\n\n // builder approach, single criteria as a string\n $builder->where(\"release_dates.platform = 8\");\n\n // builder approach, single criteria as an array\n $builder->where(\n array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n )\n );\n\n // builder approach, multiple criteria as a string\n $builder\n ->where(\"release_dates.platform = 8\")\n ->where(\"total_rating >= 70\");\n\n // builder approach, multiple criteria as an array\n $builder\n ->where(\n array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n )\n )\n ->where(\n array(\n \"field\" => \"total_rating\",\n \"postfix\" => \">=\",\n \"value\" => 70\n )\n );\n?>\n```\n\n> This method is trying to validate your input against some rules and will throw an `IGDBInvalidArgumentException` in case of any issues. If you need more flexibility or custom where statements with complex conditions in you queries use the [Custom Where](#custom-where) method instead.","html":"public function where(string | array $where) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nFilters are used to swift through results to get what you want. You can exclude and include results based on their properties. For example you could remove all Games where the rating was below 80 (where rating >= 80)
.
The where parameter can be either an apicalypse formatted string or an array with specific key-value pairs. If you provide the where parameters as an array, you must have three fix keys in it:
\nfield
: The name of the field you want to apply the filter to.postfix
: The postfix you want to use with the filter. Refer to the Available Postfixes section of the IGDB Filters Documentation for available postfixes.value
: The value of the filter.The where filters will be concatenated with AND operators (&
).
\n\n:tip Multiple filter parameters can be applied to the same query. Check the examples below.
\n
Parameters:
\n$where
: either an apicalypse formatted string or an array with specific keysReturns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach, single criteria as a string\n $options = array(\n \"where\" => \"release_dates.platform = 8\"\n );\n\n // traditional approach, single criteria as an array\n $options = array(\n \"where\" => array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n )\n );\n\n // traditional approach, multiple criteria as a string\n $options = array(\n \"where\" => array(\n \"release_dates.platform = 8\",\n \"total_rating >= 70\"\n );\n );\n\n // traditional approach, multiple criteria as an array\n $options = array(\n \"where\" => array(\n array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n ),\n array(\n \"field\" => \"total_rating\",\n \"postfix\" => \">=\",\n \"value\" => 70\n )\n )\n );\n\n // builder approach, single criteria as a string\n $builder->where(\"release_dates.platform = 8\");\n\n // builder approach, single criteria as an array\n $builder->where(\n array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n )\n );\n\n // builder approach, multiple criteria as a string\n $builder\n ->where(\"release_dates.platform = 8\")\n ->where(\"total_rating >= 70\");\n\n // builder approach, multiple criteria as an array\n $builder\n ->where(\n array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n )\n )\n ->where(\n array(\n \"field\" => \"total_rating\",\n \"postfix\" => \">=\",\n \"value\" => 70\n )\n );\n?>\n
\n\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":28},{"id":"ee45e35","slug":"building-the-query","level":2,"parent":"1bc2dc4","parents":["1bc2dc4"],"title":"Building the Query","date":null,"timestamp":null,"body":{"stripped":"When the Builder object is configured properly the final step is to build the query to an apicalypse query string. The syntax of the query depends on which endpoint the query is executed against. The multiquery endpoint requires a few additional information and a slightly different syntax.\n\nA game endpoint query:\n\n\n\nA multiquery to the game game endpoint:\n\n\n\nThe build method accepts one boolean parameter. Using this parameter the build method decides which syntax to return. If a multiquery is required, a few extra fields has to be set for the builder:\n\nname: the name of the query choosen by the user\n\nendpoint: the endpoint to send the query against\n\ncount \\[optional]: whether the records or their count is required. By default the value of this parameter is false.\n\n:warning In case of a multiquery request the properties name and endpoint are mandatory! If any of these are missing from the configuration, an IGDBInvalidParameterException will be thrown.\n\nParameters:\n\n$multiquery: if true, a multiquery will be returned, an endpoint query otherwise. The default value of this parameter is false.\n\n:warning If a non-boolean parameter is passed to the build method, an IGDBInavlidParameterException is thrown!\n\nReturns: the apicalypse query string\n\nAn endpoint query example:\n\n\n\nThe value of $query:\n\n\n\nA multiquery example:\n\n\n\nThe value of $query:","markdown":"```php\npublic function build(boolean $multiquery = false) throws IGDBInvalidParameterException: mixed\n```\n\nWhen the Builder object is configured properly the final step is to build the query to an apicalypse query string. The syntax of the query depends on which endpoint the query is executed against. The multiquery endpoint requires a few additional information and a slightly different syntax.\n\nA [`game`](#game) endpoint query:\n```text\nfields id,name;\nwhere id = 25076;\n```\n\nA [`multiquery`](#multiquery) to the game [`game`](#game) endpoint:\n```text\nquery games \"Main Game\" {\n fields id,name;\n where id = 25076;\n};\n```\n\nThe build method accepts one `boolean` parameter. Using this parameter the build method decides which syntax to return. If a multiquery is required, a few extra fields has to be set for the builder:\n - [`name`](#name): the name of the query choosen by the user\n - [`endpoint`](#endpoint): the endpoint to send the query against\n - [`count`](#count) [optional]: whether the records or their count is required. By default the value of this parameter is `false`.\n\n>:warning In case of a multiquery request the properties [name](#name) and [endpoint](#endpoint) are **mandatory**! If any of these are missing from the configuration, an `IGDBInvalidParameterException` will be thrown.\n\n**Parameters**:\n - `$multiquery`: if `true`, a multiquery will be returned, an endpoint query otherwise. The default value of this parameter is `false`.\n\n >:warning If a non-boolean parameter is passed to the build method, an `IGDBInavlidParameterException` is thrown!\n\n**Returns**: the apicalypse query string\n\nAn endpoint query example:\n```php\nsearch(\"uncharted 4\")\n ->fields(\"id, name\")\n ->limit(1)\n ->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid value passed to a method\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe value of `$query`:\n\n```text\nfields id,name;\nsearch \"uncharted 4\";\nlimit 1;\n```\n\nA multiquery example:\n\n```php\nname(\"Game with ID of 25076\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\")\n // note the true parameter\n ->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe value of `$query`:\n\n```text\nquery games \"Game with ID of 25076\" {\n fields id,name;\n where id = 25076;\n};\n```","html":"This method is trying to validate your input against some rules and will throw an
\nIGDBInvalidArgumentException
in case of any issues. If you need more flexibility or custom where statements with complex conditions in you queries use the Custom Where method instead.
public function build(boolean $multiquery = false) throws IGDBInvalidParameterException: mixed\n
\nWhen the Builder object is configured properly the final step is to build the query to an apicalypse query string. The syntax of the query depends on which endpoint the query is executed against. The multiquery endpoint requires a few additional information and a slightly different syntax.
\nA game
endpoint query:
fields id,name;\nwhere id = 25076;\n
\nA multiquery
to the game game
endpoint:
query games \"Main Game\" {\n fields id,name;\n where id = 25076;\n};\n
\nThe build method accepts one boolean
parameter. Using this parameter the build method decides which syntax to return. If a multiquery is required, a few extra fields has to be set for the builder:
name
: the name of the query choosen by the userendpoint
: the endpoint to send the query againstcount
[optional]: whether the records or their count is required. By default the value of this parameter is false
.\n\n:warning In case of a multiquery request the properties name and endpoint are mandatory! If any of these are missing from the configuration, an
\nIGDBInvalidParameterException
will be thrown.
Parameters:
\n$multiquery
: if true
, a multiquery will be returned, an endpoint query otherwise. The default value of this parameter is false
.\n\n:warning If a non-boolean parameter is passed to the build method, an
\nIGDBInavlidParameterException
is thrown!
Returns: the apicalypse query string
\nAn endpoint query example:
\n<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // configuring the query\n $query = $builder\n ->search(\"uncharted 4\")\n ->fields(\"id, name\")\n ->limit(1)\n ->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid value passed to a method\n echo $e->getMessage();\n }\n\n?>\n
\nThe value of $query
:
fields id,name;\nsearch \"uncharted 4\";\nlimit 1;\n
\nA multiquery example:
\n<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // configuring the query\n $builder\n ->name(\"Game with ID of 25076\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\")\n // note the true parameter\n ->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\nThe value of $query
:
query games \"Game with ID of 25076\" {\n fields id,name;\n where id = 25076;\n};\n
"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":29},{"id":"cbf8ecb","slug":"igdb-wrapper","level":1,"parent":null,"parents":[],"title":"IGDB Wrapper","date":null,"timestamp":1670102858000,"body":{"stripped":"This is the most important part of the wrapper, the IGDB class which does the heavy lifting: communicating with the IGDB API.\n\nAs mentioned in the Introduction, to have access to IGDB's database you have to register a Twitch Account and have your own client_id and access_token.\n\n:tip You can add your tokens to the documentation to replace them in the exmple codes. Click the logo in the top left corner to get back to the main page and save your tokens.","markdown":"This is the most important part of the wrapper, the `IGDB` class which does the heavy lifting: communicating with the IGDB API.\n\nAs mentioned in the [Introduction](#getting-started), to have access to IGDB's database you have to register a Twitch Account and have your own `client_id` and `access_token`.\n\n>:tip You can add your tokens to the documentation to replace them in the exmple codes. Click the logo in the top left corner to get back to the main page and save your tokens.","html":"This is the most important part of the wrapper, the IGDB
class which does the heavy lifting: communicating with the IGDB API.
As mentioned in the Introduction, to have access to IGDB's database you have to register a Twitch Account and have your own client_id
and access_token
.
\n"},"icon":"fa-gift","overview":"The main wrapper. Methods, endpoints, properties, configurations. Sending your queries to the IGDB API.","meta":{"revision":0,"created":1670105056946,"version":0},"$loki":30},{"id":"554c02d","slug":"instantiating-the-wrapper-ii","level":2,"parent":"cbf8ecb","parents":["cbf8ecb"],"title":"Instantiating the wrapper","date":null,"timestamp":null,"body":{"stripped":"After importing the dependencies you can instantiate the class with the new keyword by passing your tokens to the constructor.\n\n\n\n:info The wrapper itself does not validate your tokens. If your credentials are invalid, you will get an error from the IGDB API after executing a query.","markdown":"After importing the dependencies you can instantiate the class with the `new` keyword by passing your tokens to the constructor.\n\n```php\n\n```\n\n>:info The wrapper itself does not validate your tokens. If your credentials are invalid, you will get an error from the IGDB API after executing a query.","html":":tip You can add your tokens to the documentation to replace them in the exmple codes. Click the logo in the top left corner to get back to the main page and save your tokens.
\n
After importing the dependencies you can instantiate the class with the new
keyword by passing your tokens to the constructor.
<?php\n\n require_once \"class.igdb.php\";\n\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n?>\n
\n\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":31},{"id":"884a161","slug":"public-methods","level":2,"parent":"cbf8ecb","parents":["cbf8ecb"],"title":"Public Methods","date":null,"timestamp":null,"body":{"stripped":"These methods are exposed from the IGDB object.","markdown":"These methods are exposed from the `IGDB` object.","html":":info The wrapper itself does not validate your tokens. If your credentials are invalid, you will get an error from the IGDB API after executing a query.
\n
These methods are exposed from the IGDB
object.
public function get_request_info()\n
\nAfter a query is executed, the latest request information will be stored and can be retrieved using this method.
\n\n\nThe new version of the IGDB API (v4) will return a http response code
\n429
when you exceed the limit of requests on the database (4 requests per second at the time of writing this documentation).
<?php\n\n require_once \"class.igdb.php\";\n\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n try {\n $igdb->game('fields id,name; search \"uncharted 4\"; limit 1;');\n\n // getting the details of the latest query\n $request_info = $igdb->get_request_info();\n\n // showing the details\n var_dump($request_info);\n } catch (IGDBEndpointException $e) {\n echo $e->getMessage();\n }\n\n?>\n
\nDetails of the query can be fetched from the output of the get_request_info()
method (for example, the HTTP Response code from http_code
).
array (size=37)\n 'url' => string 'https://api.igdb.com/v4/games' (length=29)\n 'content_type' => string 'application/json;charset=utf-8' (length=30)\n 'http_code' => int 200\n 'header_size' => int 870\n 'request_size' => int 224\n 'filetime' => int -1\n 'ssl_verify_result' => int 20\n 'redirect_count' => int 0\n 'total_time' => float 0.748895\n 'namelookup_time' => float 0.000705\n 'connect_time' => float 0.048049\n 'pretransfer_time' => float 0.088656\n 'size_upload' => float 46\n 'size_download' => float 73\n 'speed_download' => float 97\n 'speed_upload' => float 61\n 'download_content_length' => float 73\n 'upload_content_length' => float 46\n 'starttransfer_time' => float 0.088661\n 'redirect_time' => float 0\n 'redirect_url' => string '' (length=0)\n 'primary_ip' => string '104.22.65.239' (length=13)\n 'certinfo' =>\n array (size=0)\n empty\n 'primary_port' => int 443\n 'local_ip' => string '192.168.1.99' (length=12)\n 'local_port' => int 58813\n 'http_version' => int 3\n 'protocol' => int 2\n 'ssl_verifyresult' => int 0\n 'scheme' => string 'HTTPS' (length=5)\n 'appconnect_time_us' => int 88535\n 'connect_time_us' => int 48049\n 'namelookup_time_us' => int 705\n 'pretransfer_time_us' => int 88656\n 'redirect_time_us' => int 0\n 'starttransfer_time_us' => int 88661\n 'total_time_us' => int 748895\n
"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":33},{"id":"f00c144","slug":"construct-url","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","884a161"],"title":"Construct URL","date":null,"timestamp":null,"body":{"stripped":"The method will construct the full URL for the request and will return the constructed URL as a string. If an invalid endpoint name passed to $endpoint an IGDBInvalidParameterException will be thrown.\n\nParameters:\n\n$endpoint: the endpoint to use (the name of the endpoint, not the path to it!). Possible values:\n\nage_rating\n\nalternative_name\n\nartwork\n\ncharacter_mug_shot\n\ncharacter\n\ncollection\n\ncompany_logo\n\ncompany_website\n\ncompany\n\ncover\n\nexternal_game\n\nfranchise\n\ngame_engine_logo\n\ngame_engine\n\ngame_mode\n\ngame_version_feature_value\n\ngame_version_feature\n\ngame_version\n\ngame_video\n\ngame\n\ngenre\n\ninvolved_company\n\nkeyword\n\nmultiplayer_mode\n\nmultiquery\n\nplatform_family\n\nplatform_logo\n\nplatform_version_company\n\nplatform_version_release_date\n\nplatform_version\n\nplatform_website\n\nplatform\n\nplayer_perspective\n\nrelease_date\n\nscreenshot\n\nsearch\n\ntheme\n\nwebsite\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: the full constructed URL to the IGDB Endpoint as a string.\n\n\n\nOutput:","markdown":"```php\npublic function construct_url(string $endpoint, boolean $count = false) throws IGDBInvalidParameterException: string\n```\n\nThe method will construct the full URL for the request and will return the constructed URL as a string. If an invalid endpoint name passed to `$endpoint` an `IGDBInvalidParameterException` will be thrown.\n\n**Parameters**:\n - `$endpoint`: the endpoint to use (the name of the endpoint, not the path to it!). Possible values:\n - age_rating\n - alternative_name\n - artwork\n - character_mug_shot\n - character\n - collection\n - company_logo\n - company_website\n - company\n - cover\n - external_game\n - franchise\n - game_engine_logo\n - game_engine\n - game_mode\n - game_version_feature_value\n - game_version_feature\n - game_version\n - game_video\n - game\n - genre\n - involved_company\n - keyword\n - multiplayer_mode\n - multiquery\n - platform_family\n - platform_logo\n - platform_version_company\n - platform_version_release_date\n - platform_version\n - platform_website\n - platform\n - player_perspective\n - release_date\n - screenshot\n - search\n - theme\n - website\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: the full constructed URL to the IGDB Endpoint as a string.\n\n```php\nconstruct_url(\"game\");\n\n // constructing an url to get counts\n $count_url = $igdb->construct_url(\"game\", true);\n\n // showing the results\n echo \"url: \" . $url;\n echo \"count url: \" . $count_url;\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter passed to the construct_url method\n echo $e->getMessage();\n }\n\n?>\n```\n\nOutput:\n\n```text\nurl: https://api.igdb.com/v4/games\ncount url: https://api.igdb.com/v4/games/count\n```","html":"public function construct_url(string $endpoint, boolean $count = false) throws IGDBInvalidParameterException: string\n
\nThe method will construct the full URL for the request and will return the constructed URL as a string. If an invalid endpoint name passed to $endpoint
an IGDBInvalidParameterException
will be thrown.
Parameters:
\n$endpoint
: the endpoint to use (the name of the endpoint, not the path to it!). Possible values:\n$count
: whether the request should return the number of matches instead of the actual resultsetReturns: the full constructed URL to the IGDB Endpoint as a string.
\n<?php\n\n // instantiating the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n try {\n // constructing an url\n $url = $igdb->construct_url(\"game\");\n\n // constructing an url to get counts\n $count_url = $igdb->construct_url(\"game\", true);\n\n // showing the results\n echo \"url: \" . $url;\n echo \"count url: \" . $count_url;\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter passed to the construct_url method\n echo $e->getMessage();\n }\n\n?>\n
\nOutput:
\nurl: https://api.igdb.com/v4/games\ncount url: https://api.igdb.com/v4/games/count\n
"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":34},{"id":"5eb5cf1","slug":"close-curl-session","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","884a161"],"title":"Close CURL Session","date":null,"timestamp":null,"body":{"stripped":"You can close the CURL session handler manually if you need to.\n\nParameters: -\n\nReturns: -\n\nThe curl handler will be reinitialized automatically when a new request is sent to the IGDB API with any of the endpoint methods.","markdown":"```php\npublic function curl_close(): void\n```\n\nYou can close the CURL session handler manually if you need to.\n\n**Parameters**: -\n\n**Returns**: -\n\n> The curl handler will be [reinitialized](#reinitialize-curl-session) automatically when a new request is sent to the IGDB API with any of the endpoint methods.","html":"public function curl_close(): void\n
\nYou can close the CURL session handler manually if you need to.
\nParameters: -
\nReturns: -
\n\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":35},{"id":"e10c0ea","slug":"reinitialize-curl-session","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","884a161"],"title":"Reinitialize CURL Session","date":null,"timestamp":null,"body":{"stripped":"After you closed the CURL session manually with curl_close() you can manually reinitialize the curl handler.\n\nParameters: -\n\nReturns: -\n\nBefore sending a request with an endpoint method, the wrapper will check the status of the curl handler. If it is closed, it will reinitialize it automatically.","markdown":"```php\npublic function curl_reinit() : void\n```\n\nAfter you closed the CURL session manually with [curl_close()](#close-curl-session) you can manually reinitialize the curl handler.\n\n**Parameters**: -\n\n**Returns**: -\n\n> Before sending a request with an endpoint method, the wrapper will check the status of the curl handler. If it is closed, it will reinitialize it automatically.","html":"The curl handler will be reinitialized automatically when a new request is sent to the IGDB API with any of the endpoint methods.
\n
public function curl_reinit() : void\n
\nAfter you closed the CURL session manually with curl_close() you can manually reinitialize the curl handler.
\nParameters: -
\nReturns: -
\n\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":36},{"id":"9652f37","slug":"handling-request-errors","level":2,"parent":"cbf8ecb","parents":["cbf8ecb"],"title":"Handling Request Errors","date":null,"timestamp":null,"body":{"stripped":"Your query may fail on the IGDB side. In this case the API will send back a non-successful response code indicating that something went wrong. When this happens an IGDBEndpointException can be caught to extract information about the issue. To catch these errors you have to enclose your endpoint method calls in a try...catch block.\n\n\n\nSince the query above is not valid, as there is no field called nonexistingfield on the game endpoint, the API will send a response with an error message and a non-successful response code. The result of the script above is:\n\n\n\nYou can also get some additional information about this request using the get_request_info() method.","markdown":"Your query may fail on the IGDB side. In this case the API will send back a non-successful response code indicating that something went wrong. When this happens an `IGDBEndpointException` can be caught to extract information about the issue. To catch these errors you have to enclose your [endpoint](#endpoints) method calls in a try...catch block.\n\n```php\ngame($query);\n } catch (IGDBEndpointException $e) {\n // since the query contains a non-existing field, an error occured\n // printing the response code and the error message\n echo \"Response code: \" . $e->getResponseCode();\n echo \"Message: \" . $e->getMessage();\n }\n\n?>\n```\n\nSince the query above is not valid, as there is no field called `nonexistingfield` on the game endpoint, the API will send a response with an error message and a non-successful response code. The result of the script above is:\n\n```text\nResponse code: 400\nMessage: Invalid Field\n```\n\nYou can also get some additional information about this request using the [`get_request_info()`](#get-request-info) method.","html":"Before sending a request with an endpoint method, the wrapper will check the status of the curl handler. If it is closed, it will reinitialize it automatically.
\n
Your query may fail on the IGDB side. In this case the API will send back a non-successful response code indicating that something went wrong. When this happens an IGDBEndpointException
can be caught to extract information about the issue. To catch these errors you have to enclose your endpoint method calls in a try...catch block.
<?php\n\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // your query string with a field that doesn't exist\n $query = 'search \"uncharted\"; fields nonexistingfield;';\n\n try {\n // executing the query\n $games = $igdb->game($query);\n } catch (IGDBEndpointException $e) {\n // since the query contains a non-existing field, an error occured\n // printing the response code and the error message\n echo \"Response code: \" . $e->getResponseCode();\n echo \"Message: \" . $e->getMessage();\n }\n\n?>\n
\nSince the query above is not valid, as there is no field called nonexistingfield
on the game endpoint, the API will send a response with an error message and a non-successful response code. The result of the script above is:
Response code: 400\nMessage: Invalid Field\n
\nYou can also get some additional information about this request using the get_request_info()
method.
Every endpoint method is named after the IGDB API endpoints using snake-casing naming convention. These methods are expecting at least one parameter, the $query
itself. The second $count
parameter is optional, it is false
by default.
Parameters:
\n$query
: the query itself as an apicalypse string$count
: a boolean
value to whether return the records or the count of the records\n\n:tip To build your queries, give IGDB Query Builder a try!
\n
These methods will return an array of objects decoded from IGDB response JSON when the $count
parameter is false. Otherwise, it will execute a count query against the selected endpoint which will return an object with a count
property holding the sum of the found items. The count queries can be filtered with where parameters.
IGDBEndpointException
is thrown if a non-successful response code is recieved from the IGDB API. To find out how to handle request errors, head to the Handle Request Errors section.
Please refer to the return values section for more details about the return values of these methods.
"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":38},{"id":"df10452","slug":"age-rating-content-description","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Age Rating Content Description","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Age Rating Content Description endpoint.\n\nEndpoint Description: The organisation behind a specific rating\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\ncategory (Category Enum)\n\nchecksum (uuid): Hash of the object\n\ndescription (String)\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function age_rating_content_description(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Age Rating Content Description](https://api-docs.igdb.com/#age-rating-content-description) endpoint.\n\n**Endpoint Description**: The organisation behind a specific rating\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nage_rating_content_description($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `category` ([Category Enum](https://api-docs.igdb.com/#age-rating-content-description-enums))\n - `checksum` (uuid): Hash of the object\n - `description` (String)\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"public function age_rating_content_description(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Age Rating Content Description endpoint.
\nEndpoint Description: The organisation behind a specific rating
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Age Rating Content Description endpoint method\n $igdb->age_rating_content_description($query, $count);\n\n?>\n
\nFields in response
\ncategory
(Category Enum)checksum
(uuid): Hash of the objectdescription
(String)\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":39},{"id":"dec8c3f","slug":"age-rating","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Age Rating","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Age Rating endpoint.\n\nEndpoint Description: Age Rating according to various rating organisations\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\ncategory (Category Enum): The organization that has issued a specific rating\n\nchecksum (uuid): Hash of the object\n\ncontent_descriptions (Reference ID for Age Rating Content Description)\n\nrating (Rating Enum): The title of an age rating\n\nrating_cover_url (String): The url for the image of a age rating\n\nsynopsis (String): A free text motivating a rating\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function age_rating(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Age Rating](https://api-docs.igdb.com/#age-rating) endpoint.\n\n**Endpoint Description**: Age Rating according to various rating organisations\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nage_rating($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `category` ([Category Enum](https://api-docs.igdb.com/#age-rating-enums)): The organization that has issued a specific rating\n - `checksum` (uuid): Hash of the object\n - `content_descriptions` (Reference ID for [ Age Rating Content Description](https://api-docs.igdb.com/#age-rating-content-description))\n - `rating` ([Rating Enum](https://api-docs.igdb.com/#age-rating-enums)): The title of an age rating\n - `rating_cover_url` (String): The url for the image of a age rating\n - `synopsis` (String): A free text motivating a rating\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function age_rating(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Age Rating endpoint.
\nEndpoint Description: Age Rating according to various rating organisations
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Age Rating endpoint method\n $igdb->age_rating($query, $count);\n\n?>\n
\nFields in response
\ncategory
(Category Enum): The organization that has issued a specific ratingchecksum
(uuid): Hash of the objectcontent_descriptions
(Reference ID for Age Rating Content Description)rating
(Rating Enum): The title of an age ratingrating_cover_url
(String): The url for the image of a age ratingsynopsis
(String): A free text motivating a rating\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":40},{"id":"ef28a61","slug":"alternative-name","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Alternative Name","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Alternative Name endpoint.\n\nEndpoint Description: Alternative and international game titles\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncomment (String): A description of what kind of alternative name it is (Acronym, Working title, Japanese title etc)\n\ngame (Reference ID for Game): The game this alternative name is associated with\n\nname (String): An alternative name\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function alternative_name(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Alternative Name](https://api-docs.igdb.com/#alternative-name) endpoint.\n\n**Endpoint Description**: Alternative and international game titles\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nalternative_name($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `comment` (String): A description of what kind of alternative name it is (Acronym, Working title, Japanese title etc)\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game)): The game this alternative name is associated with\n - `name` (String): An alternative name\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function alternative_name(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Alternative Name endpoint.
\nEndpoint Description: Alternative and international game titles
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Alternative Name endpoint method\n $igdb->alternative_name($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcomment
(String): A description of what kind of alternative name it is (Acronym, Working title, Japanese title etc)game
(Reference ID for Game): The game this alternative name is associated withname
(String): An alternative name\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":41},{"id":"bd511a9","slug":"artwork","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Artwork","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Artwork endpoint.\n\nEndpoint Description: official artworks (resolution and aspect ratio may vary)\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nalpha_channel (boolean)\n\nanimated (boolean)\n\nchecksum (uuid): Hash of the object\n\ngame (Reference ID for Game): The game this artwork is associated with\n\nheight (Integer): The height of the image in pixels\n\nimage_id (String): The ID of the image used to construct an IGDB image link\n\nurl (String): The website address (URL) of the item\n\nwidth (Integer): The width of the image in pixels\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function artwork(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Artwork](https://api-docs.igdb.com/#artwork) endpoint.\n\n**Endpoint Description**: official artworks (resolution and aspect ratio may vary)\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nartwork($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `alpha_channel` (boolean)\n - `animated` (boolean)\n - `checksum` (uuid): Hash of the object\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game)): The game this artwork is associated with\n - `height` (Integer): The height of the image in pixels\n - `image_id` (String): The ID of the image used to construct an IGDB image link\n - `url` (String): The website address (URL) of the item\n - `width` (Integer): The width of the image in pixels\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function artwork(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Artwork endpoint.
\nEndpoint Description: official artworks (resolution and aspect ratio may vary)
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Artwork endpoint method\n $igdb->artwork($query, $count);\n\n?>\n
\nFields in response
\nalpha_channel
(boolean)animated
(boolean)checksum
(uuid): Hash of the objectgame
(Reference ID for Game): The game this artwork is associated withheight
(Integer): The height of the image in pixelsimage_id
(String): The ID of the image used to construct an IGDB image linkurl
(String): The website address (URL) of the itemwidth
(Integer): The width of the image in pixels\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":42},{"id":"58e8450","slug":"character-mug-shot","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Character Mug Shot","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Character Mug Shot endpoint.\n\nEndpoint Description: Images depicting game characters\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nalpha_channel (boolean)\n\nanimated (boolean)\n\nchecksum (uuid): Hash of the object\n\nheight (Integer): The height of the image in pixels\n\nimage_id (String): The ID of the image used to construct an IGDB image link\n\nurl (String): The website address (URL) of the item\n\nwidth (Integer): The width of the image in pixels\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function character_mug_shot(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Character Mug Shot](https://api-docs.igdb.com/#character-mug-shot) endpoint.\n\n**Endpoint Description**: Images depicting game characters\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncharacter_mug_shot($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `alpha_channel` (boolean)\n - `animated` (boolean)\n - `checksum` (uuid): Hash of the object\n - `height` (Integer): The height of the image in pixels\n - `image_id` (String): The ID of the image used to construct an IGDB image link\n - `url` (String): The website address (URL) of the item\n - `width` (Integer): The width of the image in pixels\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function character_mug_shot(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Character Mug Shot endpoint.
\nEndpoint Description: Images depicting game characters
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Character Mug Shot endpoint method\n $igdb->character_mug_shot($query, $count);\n\n?>\n
\nFields in response
\nalpha_channel
(boolean)animated
(boolean)checksum
(uuid): Hash of the objectheight
(Integer): The height of the image in pixelsimage_id
(String): The ID of the image used to construct an IGDB image linkurl
(String): The website address (URL) of the itemwidth
(Integer): The width of the image in pixels\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":43},{"id":"80c438e","slug":"character","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Character","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Character endpoint.\n\nEndpoint Description: Video game characters\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nakas (Array of Strings): Alternative names for a character\n\nchecksum (uuid): Hash of the object\n\ncountry_name (String): A characters country of origin\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\ndescription (String): A text describing a character\n\ngames (Array of Game IDs)\n\ngender (Gender Enum)\n\nmug_shot (Reference ID for Character Mug Shot): An image depicting a character\n\nname (String)\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nspecies (Species Enum)\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function character(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Character](https://api-docs.igdb.com/#character) endpoint.\n\n**Endpoint Description**: Video game characters\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncharacter($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `akas` (Array of Strings): Alternative names for a character\n - `checksum` (uuid): Hash of the object\n - `country_name` (String): A characters country of origin\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `description` (String): A text describing a character\n - `games` (Array of [Game](https://api-docs.igdb.com/#game) IDs)\n - `gender` ([Gender Enum](https://api-docs.igdb.com/#character-enums))\n - `mug_shot` (Reference ID for [ Character Mug Shot](https://api-docs.igdb.com/#character-mug-shot)): An image depicting a character\n - `name` (String)\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `species` ([Species Enum](https://api-docs.igdb.com/#character-enums))\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function character(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Character endpoint.
\nEndpoint Description: Video game characters
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Character endpoint method\n $igdb->character($query, $count);\n\n?>\n
\nFields in response
\nakas
(Array of Strings): Alternative names for a characterchecksum
(uuid): Hash of the objectcountry_name
(String): A characters country of origincreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasedescription
(String): A text describing a charactergames
(Array of Game IDs)gender
(Gender Enum)mug_shot
(Reference ID for Character Mug Shot): An image depicting a charactername
(String)slug
(String): A url-safe, unique, lower-case version of the namespecies
(Species Enum)updated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":44},{"id":"7e9aa14","slug":"collection","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Collection","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Collection endpoint.\n\nEndpoint Description: Collection, AKA Series\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\ngames (Array of Game IDs): The games that are associated with this collection\n\nname (String): Umbrella term for a collection of games\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function collection(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Collection](https://api-docs.igdb.com/#collection) endpoint.\n\n**Endpoint Description**: Collection, AKA Series\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncollection($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `games` (Array of [Game](https://api-docs.igdb.com/#game) IDs): The games that are associated with this collection\n - `name` (String): Umbrella term for a collection of games\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function collection(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Collection endpoint.
\nEndpoint Description: Collection, AKA Series
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Collection endpoint method\n $igdb->collection($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasegames
(Array of Game IDs): The games that are associated with this collectionname
(String): Umbrella term for a collection of gamesslug
(String): A url-safe, unique, lower-case version of the nameupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":45},{"id":"4141062","slug":"company-logo","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Company Logo","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Company Logo endpoint.\n\nEndpoint Description: The logos of developers and publishers\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nalpha_channel (boolean)\n\nanimated (boolean)\n\nchecksum (uuid): Hash of the object\n\nheight (Integer): The height of the image in pixels\n\nimage_id (String): The ID of the image used to construct an IGDB image link\n\nurl (String): The website address (URL) of the item\n\nwidth (Integer): The width of the image in pixels\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function company_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Company Logo](https://api-docs.igdb.com/#company-logo) endpoint.\n\n**Endpoint Description**: The logos of developers and publishers\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncompany_logo($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `alpha_channel` (boolean)\n - `animated` (boolean)\n - `checksum` (uuid): Hash of the object\n - `height` (Integer): The height of the image in pixels\n - `image_id` (String): The ID of the image used to construct an IGDB image link\n - `url` (String): The website address (URL) of the item\n - `width` (Integer): The width of the image in pixels\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function company_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Company Logo endpoint.
\nEndpoint Description: The logos of developers and publishers
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Company Logo endpoint method\n $igdb->company_logo($query, $count);\n\n?>\n
\nFields in response
\nalpha_channel
(boolean)animated
(boolean)checksum
(uuid): Hash of the objectheight
(Integer): The height of the image in pixelsimage_id
(String): The ID of the image used to construct an IGDB image linkurl
(String): The website address (URL) of the itemwidth
(Integer): The width of the image in pixels\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":46},{"id":"a2eec3c","slug":"company-website","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Company Website","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Company Website endpoint.\n\nEndpoint Description: Company Website\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\ncategory (Category Enum): The service this website links to\n\nchecksum (uuid): Hash of the object\n\ntrusted (boolean)\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function company_website(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Company Website](https://api-docs.igdb.com/#company-website) endpoint.\n\n**Endpoint Description**: Company Website\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncompany_website($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `category` ([Category Enum](https://api-docs.igdb.com/#company-website-enums)): The service this website links to\n - `checksum` (uuid): Hash of the object\n - `trusted` (boolean)\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function company_website(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Company Website endpoint.
\nEndpoint Description: Company Website
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Company Website endpoint method\n $igdb->company_website($query, $count);\n\n?>\n
\nFields in response
\ncategory
(Category Enum): The service this website links tochecksum
(uuid): Hash of the objecttrusted
(boolean)url
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":47},{"id":"299fb52","slug":"company","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Company","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Company endpoint.\n\nEndpoint Description: Video game companies. Both publishers \\& developers\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchange_date (Unix Time Stamp): The data when a company got a new ID\n\nchange_date_category (Change Date Category Enum)\n\nchanged_company_id (Reference ID for Company): The new ID for a company that has gone through a merger or restructuring\n\nchecksum (uuid): Hash of the object\n\ncountry (Integer): ISO 3166-1 country code\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\ndescription (String): A free text description of a company\n\ndeveloped (Reference ID for Game): An array of games that a company has developed\n\nlogo (Reference ID for Company Logo): The company\\’s logo\n\nname (String)\n\nparent (Reference ID for Company): A company with a controlling interest in a specific company\n\npublished (Reference ID for Game): An array of games that a company has published\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nstart_date (Unix Time Stamp): The date a company was founded\n\nstart_date_category (Start Date Category Enum)\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nwebsites (Reference ID for Company Website): The companies official websites\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function company(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Company](https://api-docs.igdb.com/#company) endpoint.\n\n**Endpoint Description**: Video game companies. Both publishers & developers\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncompany($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `change_date` (Unix Time Stamp): The data when a company got a new ID\n - `change_date_category` ([Change Date Category Enum](https://api-docs.igdb.com/#company-enums))\n - `changed_company_id` (Reference ID for [ Company](https://api-docs.igdb.com/#company)): The new ID for a company that has gone through a merger or restructuring\n - `checksum` (uuid): Hash of the object\n - `country` (Integer): ISO 3166-1 country code\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `description` (String): A free text description of a company\n - `developed` (Reference ID for [ Game](https://api-docs.igdb.com/#game)): An array of games that a company has developed\n - `logo` (Reference ID for [ Company Logo](https://api-docs.igdb.com/#company-logo)): The company’s logo\n - `name` (String)\n - `parent` (Reference ID for [ Company](https://api-docs.igdb.com/#company)): A company with a controlling interest in a specific company\n - `published` (Reference ID for [ Game](https://api-docs.igdb.com/#game)): An array of games that a company has published\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `start_date` (Unix Time Stamp): The date a company was founded\n - `start_date_category` ([Start Date Category Enum](https://api-docs.igdb.com/#company-enums))\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n - `websites` (Reference ID for [ Company Website](https://api-docs.igdb.com/#company-website)): The companies official websites\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function company(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Company endpoint.
\nEndpoint Description: Video game companies. Both publishers & developers
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Company endpoint method\n $igdb->company($query, $count);\n\n?>\n
\nFields in response
\nchange_date
(Unix Time Stamp): The data when a company got a new IDchange_date_category
(Change Date Category Enum)changed_company_id
(Reference ID for Company): The new ID for a company that has gone through a merger or restructuringchecksum
(uuid): Hash of the objectcountry
(Integer): ISO 3166-1 country codecreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasedescription
(String): A free text description of a companydeveloped
(Reference ID for Game): An array of games that a company has developedlogo
(Reference ID for Company Logo): The company’s logoname
(String)parent
(Reference ID for Company): A company with a controlling interest in a specific companypublished
(Reference ID for Game): An array of games that a company has publishedslug
(String): A url-safe, unique, lower-case version of the namestart_date
(Unix Time Stamp): The date a company was foundedstart_date_category
(Start Date Category Enum)updated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the itemwebsites
(Reference ID for Company Website): The companies official websites\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":48},{"id":"6ddfbfb","slug":"cover","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Cover","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Cover endpoint.\n\nEndpoint Description: The cover art of games\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nalpha_channel (boolean)\n\nanimated (boolean)\n\nchecksum (uuid): Hash of the object\n\ngame (Reference ID for Game): The game this cover is associated with\n\nheight (Integer): The height of the image in pixels\n\nimage_id (String): The ID of the image used to construct an IGDB image link\n\nurl (String): The website address (URL) of the item\n\nwidth (Integer): The width of the image in pixels\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function cover(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Cover](https://api-docs.igdb.com/#cover) endpoint.\n\n**Endpoint Description**: The cover art of games\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncover($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `alpha_channel` (boolean)\n - `animated` (boolean)\n - `checksum` (uuid): Hash of the object\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game)): The game this cover is associated with\n - `height` (Integer): The height of the image in pixels\n - `image_id` (String): The ID of the image used to construct an IGDB image link\n - `url` (String): The website address (URL) of the item\n - `width` (Integer): The width of the image in pixels\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function cover(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Cover endpoint.
\nEndpoint Description: The cover art of games
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Cover endpoint method\n $igdb->cover($query, $count);\n\n?>\n
\nFields in response
\nalpha_channel
(boolean)animated
(boolean)checksum
(uuid): Hash of the objectgame
(Reference ID for Game): The game this cover is associated withheight
(Integer): The height of the image in pixelsimage_id
(String): The ID of the image used to construct an IGDB image linkurl
(String): The website address (URL) of the itemwidth
(Integer): The width of the image in pixels\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":49},{"id":"202fadd","slug":"external-game","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"External Game","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the External Game endpoint.\n\nEndpoint Description: Game IDs on other services\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\ncategory (Category Enum): The id of the other service\n\nchecksum (uuid): Hash of the object\n\ncountries (Array of Integers): The ISO country code of the external game product.\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\ngame (Reference ID for Game): The IGDB ID of the game\n\nmedia (Media Enum): The media of the external game.\n\nname (String): The name of the game according to the other service\n\nplatform (Reference ID for Platform): The platform of the external game product.\n\nuid (String): The other services ID for this game\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nyear (Integer): The year in full (2018)\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function external_game(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [External Game](https://api-docs.igdb.com/#external-game) endpoint.\n\n**Endpoint Description**: Game IDs on other services\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nexternal_game($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `category` ([Category Enum](https://api-docs.igdb.com/#external-game-enums)): The id of the other service\n - `checksum` (uuid): Hash of the object\n - `countries` (Array of Integers): The ISO country code of the external game product.\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game)): The IGDB ID of the game\n - `media` ([Media Enum](https://api-docs.igdb.com/#external-game-enums)): The media of the external game.\n - `name` (String): The name of the game according to the other service\n - `platform` (Reference ID for [Platform](https://api-docs.igdb.com/#platform)): The platform of the external game product.\n - `uid` (String): The other services ID for this game\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n - `year` (Integer): The year in full (2018)\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function external_game(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the External Game endpoint.
\nEndpoint Description: Game IDs on other services
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // External Game endpoint method\n $igdb->external_game($query, $count);\n\n?>\n
\nFields in response
\ncategory
(Category Enum): The id of the other servicechecksum
(uuid): Hash of the objectcountries
(Array of Integers): The ISO country code of the external game product.created_at
(Unix Time Stamp): Date this was initially added to the IGDB databasegame
(Reference ID for Game): The IGDB ID of the gamemedia
(Media Enum): The media of the external game.name
(String): The name of the game according to the other serviceplatform
(Reference ID for Platform): The platform of the external game product.uid
(String): The other services ID for this gameupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the itemyear
(Integer): The year in full (2018)\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":50},{"id":"e11e6bd","slug":"franchise","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Franchise","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Franchise endpoint.\n\nEndpoint Description: A list of video game franchises such as Star Wars.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\ngames (Array of Game IDs): The games that are associated with this franchise\n\nname (String): The name of the franchise\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function franchise(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Franchise](https://api-docs.igdb.com/#franchise) endpoint.\n\n**Endpoint Description**: A list of video game franchises such as Star Wars.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nfranchise($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `games` (Array of [Game](https://api-docs.igdb.com/#game) IDs): The games that are associated with this franchise\n - `name` (String): The name of the franchise\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function franchise(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Franchise endpoint.
\nEndpoint Description: A list of video game franchises such as Star Wars.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Franchise endpoint method\n $igdb->franchise($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasegames
(Array of Game IDs): The games that are associated with this franchisename
(String): The name of the franchiseslug
(String): A url-safe, unique, lower-case version of the nameupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":51},{"id":"2b61696","slug":"game-engine-logo","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Engine Logo","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Engine Logo endpoint.\n\nEndpoint Description: The logos of game engines\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nalpha_channel (boolean)\n\nanimated (boolean)\n\nchecksum (uuid): Hash of the object\n\nheight (Integer): The height of the image in pixels\n\nimage_id (String): The ID of the image used to construct an IGDB image link\n\nurl (String): The website address (URL) of the item\n\nwidth (Integer): The width of the image in pixels\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function game_engine_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Engine Logo](https://api-docs.igdb.com/#game-engine-logo) endpoint.\n\n**Endpoint Description**: The logos of game engines\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_engine_logo($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `alpha_channel` (boolean)\n - `animated` (boolean)\n - `checksum` (uuid): Hash of the object\n - `height` (Integer): The height of the image in pixels\n - `image_id` (String): The ID of the image used to construct an IGDB image link\n - `url` (String): The website address (URL) of the item\n - `width` (Integer): The width of the image in pixels\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function game_engine_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Engine Logo endpoint.
\nEndpoint Description: The logos of game engines
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Engine Logo endpoint method\n $igdb->game_engine_logo($query, $count);\n\n?>\n
\nFields in response
\nalpha_channel
(boolean)animated
(boolean)checksum
(uuid): Hash of the objectheight
(Integer): The height of the image in pixelsimage_id
(String): The ID of the image used to construct an IGDB image linkurl
(String): The website address (URL) of the itemwidth
(Integer): The width of the image in pixels\n"},"meta":{"revision":0,"created":1670105056946,"version":0},"$loki":52},{"id":"c5d47de","slug":"game-engine","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Engine","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Engine endpoint.\n\nEndpoint Description: Video game engines such as unreal engine.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncompanies (Array of Company IDs): Companies who used this game engine\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\ndescription (String): Description of the game engine\n\nlogo (Reference ID for Game Engine Logo): Logo of the game engine\n\nname (String): Name of the game engine\n\nplatforms (Array of Platform IDs): Platforms this game engine was deployed on\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function game_engine(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Engine](https://api-docs.igdb.com/#game-engine) endpoint.\n\n**Endpoint Description**: Video game engines such as unreal engine.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_engine($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `companies` (Array of [Company](https://api-docs.igdb.com/#company) IDs): Companies who used this game engine\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `description` (String): Description of the game engine\n - `logo` (Reference ID for [ Game Engine Logo](https://api-docs.igdb.com/#game-engine-logo)): Logo of the game engine\n - `name` (String): Name of the game engine\n - `platforms` (Array of [Platform](https://api-docs.igdb.com/#platform) IDs): Platforms this game engine was deployed on\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function game_engine(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Engine endpoint.
\nEndpoint Description: Video game engines such as unreal engine.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Engine endpoint method\n $igdb->game_engine($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcompanies
(Array of Company IDs): Companies who used this game enginecreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasedescription
(String): Description of the game enginelogo
(Reference ID for Game Engine Logo): Logo of the game enginename
(String): Name of the game engineplatforms
(Array of Platform IDs): Platforms this game engine was deployed onslug
(String): A url-safe, unique, lower-case version of the nameupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":53},{"id":"96984d3","slug":"game-mode","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Mode","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Mode endpoint.\n\nEndpoint Description: Single player, Multiplayer etc\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\nname (String): The name of the game mode\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function game_mode(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Mode](https://api-docs.igdb.com/#game-mode) endpoint.\n\n**Endpoint Description**: Single player, Multiplayer etc\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_mode($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `name` (String): The name of the game mode\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function game_mode(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Mode endpoint.
\nEndpoint Description: Single player, Multiplayer etc
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Mode endpoint method\n $igdb->game_mode($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasename
(String): The name of the game modeslug
(String): A url-safe, unique, lower-case version of the nameupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":54},{"id":"9ac2c22","slug":"game-version-feature-value","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Version Feature Value","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Version Feature Value endpoint.\n\nEndpoint Description: The bool/text value of the feature\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ngame (Reference ID for Game): The version/edition this value refers to\n\ngame_feature (Reference ID for Game Version Feature): The id of the game feature\n\nincluded_feature (Included Feature Enum): The boole value of this feature\n\nnote (String): The text value of this feature\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function game_version_feature_value(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Version Feature Value](https://api-docs.igdb.com/#game-version-feature-value) endpoint.\n\n**Endpoint Description**: The bool/text value of the feature\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_version_feature_value($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game)): The version/edition this value refers to\n - `game_feature` (Reference ID for [ Game Version Feature](https://api-docs.igdb.com/#game-version-feature)): The id of the game feature\n - `included_feature` ([Included Feature Enum](https://api-docs.igdb.com/#game-version-feature-value-enums)): The boole value of this feature\n - `note` (String): The text value of this feature\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function game_version_feature_value(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Version Feature Value endpoint.
\nEndpoint Description: The bool/text value of the feature
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Version Feature Value endpoint method\n $igdb->game_version_feature_value($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectgame
(Reference ID for Game): The version/edition this value refers togame_feature
(Reference ID for Game Version Feature): The id of the game featureincluded_feature
(Included Feature Enum): The boole value of this featurenote
(String): The text value of this feature\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":55},{"id":"4b88c69","slug":"game-version-feature","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Version Feature","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Version Feature endpoint.\n\nEndpoint Description: Features and descriptions of what makes each version/edition different from the main game\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\ncategory (Category Enum): The category of the feature description\n\nchecksum (uuid): Hash of the object\n\ndescription (String): The description of the feature\n\nposition (Integer): Position of this feature in the list of features\n\ntitle (String): The title of the feature\n\nvalues (Reference ID for Game Version Feature Value): The bool/text value of the feature\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function game_version_feature(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Version Feature](https://api-docs.igdb.com/#game-version-feature) endpoint.\n\n**Endpoint Description**: Features and descriptions of what makes each version/edition different from the main game\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_version_feature($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `category` ([Category Enum](https://api-docs.igdb.com/#game-version-feature-enums)): The category of the feature description\n - `checksum` (uuid): Hash of the object\n - `description` (String): The description of the feature\n - `position` (Integer): Position of this feature in the list of features\n - `title` (String): The title of the feature\n - `values` (Reference ID for [ Game Version Feature Value](https://api-docs.igdb.com/#game-version-feature-value)): The bool/text value of the feature\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function game_version_feature(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Version Feature endpoint.
\nEndpoint Description: Features and descriptions of what makes each version/edition different from the main game
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Version Feature endpoint method\n $igdb->game_version_feature($query, $count);\n\n?>\n
\nFields in response
\ncategory
(Category Enum): The category of the feature descriptionchecksum
(uuid): Hash of the objectdescription
(String): The description of the featureposition
(Integer): Position of this feature in the list of featurestitle
(String): The title of the featurevalues
(Reference ID for Game Version Feature Value): The bool/text value of the feature\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":56},{"id":"3cbb2f9","slug":"game-version","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Version","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Version endpoint.\n\nEndpoint Description: Details about game editions and versions.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\nfeatures (Reference ID for Game Version Feature): Features and descriptions of what makes each version/edition different from the main game\n\ngame (Reference ID for Game): The game these versions/editions are of\n\ngames (Array of Game IDs): Game Versions and Editions\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function game_version(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Version](https://api-docs.igdb.com/#game-version) endpoint.\n\n**Endpoint Description**: Details about game editions and versions.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_version($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `features` (Reference ID for [ Game Version Feature](https://api-docs.igdb.com/#game-version-feature)): Features and descriptions of what makes each version/edition different from the main game\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game)): The game these versions/editions are of\n - `games` (Array of [Game](https://api-docs.igdb.com/#game) IDs): Game Versions and Editions\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function game_version(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Version endpoint.
\nEndpoint Description: Details about game editions and versions.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Version endpoint method\n $igdb->game_version($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasefeatures
(Reference ID for Game Version Feature): Features and descriptions of what makes each version/edition different from the main gamegame
(Reference ID for Game): The game these versions/editions are ofgames
(Array of Game IDs): Game Versions and Editionsupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":57},{"id":"59ffba6","slug":"game-video","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Video","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Video endpoint.\n\nEndpoint Description: A video associated with a game\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ngame (Reference ID for Game): The game this video is associated with\n\nname (String): The name of the video\n\nvideo_id (String): The external ID of the video (usually youtube)\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function game_video(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Video](https://api-docs.igdb.com/#game-video) endpoint.\n\n**Endpoint Description**: A video associated with a game\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_video($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game)): The game this video is associated with\n - `name` (String): The name of the video\n - `video_id` (String): The external ID of the video (usually youtube)\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function game_video(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Video endpoint.
\nEndpoint Description: A video associated with a game
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Video endpoint method\n $igdb->game_video($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectgame
(Reference ID for Game): The game this video is associated withname
(String): The name of the videovideo_id
(String): The external ID of the video (usually youtube)\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":58},{"id":"2f3ec6b","slug":"game","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game endpoint.\n\nEndpoint Description: Video Games!\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nage_ratings (Reference ID for Age Rating): The PEGI rating\n\naggregated_rating (Double): Rating based on external critic scores\n\naggregated_rating_count (Integer): Number of external critic scores\n\nalternative_names (Array of Alternative Name IDs): Alternative names for this game\n\nartworks (Array of Artwork IDs): Artworks of this game\n\nbundles (Reference ID for Game): The bundles this game is a part of\n\ncategory (Category Enum): The category of this game\n\nchecksum (uuid): Hash of the object\n\ncollection (Reference ID for Collection): The series the game belongs to\n\ncover (Reference ID for Cover): The cover of this game\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\ndlcs (Reference ID for Game): DLCs for this game\n\nexpansions (Reference ID for Game): Expansions of this game\n\nexternal_games (Array of External Game IDs): External IDs this game has on other services\n\nfirst_release_date (Unix Time Stamp): The first release date for this game\n\nfollows (Integer): Number of people following a game\n\nfranchise (Reference ID for Franchise): The main franchise\n\nfranchises (Array of Franchise IDs): Other franchises the game belongs to\n\ngame_engines (Array of Game Engine IDs): The game engine used in this game\n\ngame_modes (Array of Game Mode IDs): Modes of gameplay\n\ngenres (Array of Genre IDs): Genres of the game\n\nhypes (Integer): Number of follows a game gets before release\n\ninvolved_companies (Array of Involved Company IDs): Companies who developed this game\n\nkeywords (Array of Keyword IDs): Associated keywords\n\nmultiplayer_modes (Array of Multiplayer Mode IDs): Multiplayer modes for this game\n\nname (String)\n\nparent_game (Reference ID for Game): If a DLC, expansion or part of a bundle, this is the main game or bundle\n\nplatforms (Array of Platform IDs): Platforms this game was released on\n\nplayer_perspectives (Array of Player Perspective IDs): The main perspective of the player\n\nrating (Double): Average IGDB user rating\n\nrating_count (Integer): Total number of IGDB user ratings\n\nrelease_dates (Array of Release Date IDs): Release dates of this game\n\nscreenshots (Array of Screenshot IDs): Screenshots of this game\n\nsimilar_games (Reference ID for Game): Similar games\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nstandalone_expansions (Reference ID for Game): Standalone expansions of this game\n\nstatus (Status Enum): The status of the games release\n\nstoryline (String): A short description of a games story\n\nsummary (String): A description of the game\n\ntags (Array of Tag Numbers): Related entities in the IGDB API\n\nthemes (Array of Theme IDs): Themes of the game\n\ntotal_rating (Double): Average rating based on both IGDB user and external critic scores\n\ntotal_rating_count (Integer): Total number of user and external critic scores\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nversion_parent (Reference ID for Game): If a version, this is the main game\n\nversion_title (String): Title of this version (i.e Gold edition)\n\nvideos (Reference ID for Game Video): Videos of this game\n\nwebsites (Reference ID for Website): Websites associated with this game\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function game(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game](https://api-docs.igdb.com/#game) endpoint.\n\n**Endpoint Description**: Video Games!\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `age_ratings` (Reference ID for [ Age Rating](https://api-docs.igdb.com/#age-rating)): The PEGI rating\n - `aggregated_rating` (Double): Rating based on external critic scores\n - `aggregated_rating_count` (Integer): Number of external critic scores\n - `alternative_names` (Array of [Alternative Name](https://api-docs.igdb.com/#alternative-name) IDs): Alternative names for this game\n - `artworks` (Array of [Artwork](https://api-docs.igdb.com/#artwork) IDs): Artworks of this game\n - `bundles` (Reference ID for [ Game](https://api-docs.igdb.com/#game)): The bundles this game is a part of\n - `category` ([Category Enum](https://api-docs.igdb.com/#game-enums)): The category of this game\n - `checksum` (uuid): Hash of the object\n - `collection` (Reference ID for [Collection](https://api-docs.igdb.com/#collection)): The series the game belongs to\n - `cover` (Reference ID for [Cover](https://api-docs.igdb.com/#cover)): The cover of this game\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `dlcs` (Reference ID for [ Game](https://api-docs.igdb.com/#game)): DLCs for this game\n - `expansions` (Reference ID for [ Game](https://api-docs.igdb.com/#game)): Expansions of this game\n - `external_games` (Array of [External Game](https://api-docs.igdb.com/#external-game) IDs): External IDs this game has on other services\n - `first_release_date` (Unix Time Stamp): The first release date for this game\n - `follows` (Integer): Number of people following a game\n - `franchise` (Reference ID for [Franchise](https://api-docs.igdb.com/#franchise)): The main franchise\n - `franchises` (Array of [Franchise](https://api-docs.igdb.com/#franchise) IDs): Other franchises the game belongs to\n - `game_engines` (Array of [Game Engine](https://api-docs.igdb.com/#game-engine) IDs): The game engine used in this game\n - `game_modes` (Array of [Game Mode](https://api-docs.igdb.com/#game-mode) IDs): Modes of gameplay\n - `genres` (Array of [Genre](https://api-docs.igdb.com/#genre) IDs): Genres of the game\n - `hypes` (Integer): Number of follows a game gets before release\n - `involved_companies` (Array of [Involved Company](https://api-docs.igdb.com/#involved-company) IDs): Companies who developed this game\n - `keywords` (Array of [Keyword](https://api-docs.igdb.com/#keyword) IDs): Associated keywords\n - `multiplayer_modes` (Array of [Multiplayer Mode](https://api-docs.igdb.com/#multiplayer-mode) IDs): Multiplayer modes for this game\n - `name` (String)\n - `parent_game` (Reference ID for [ Game](https://api-docs.igdb.com/#game)): If a DLC, expansion or part of a bundle, this is the main game or bundle\n - `platforms` (Array of [Platform](https://api-docs.igdb.com/#platform) IDs): Platforms this game was released on\n - `player_perspectives` (Array of [Player Perspective](https://api-docs.igdb.com/#player-perspective) IDs): The main perspective of the player\n - `rating` (Double): Average IGDB user rating\n - `rating_count` (Integer): Total number of IGDB user ratings\n - `release_dates` (Array of [Release Date](https://api-docs.igdb.com/#release-date) IDs): Release dates of this game\n - `screenshots` (Array of [Screenshot](https://api-docs.igdb.com/#screenshot) IDs): Screenshots of this game\n - `similar_games` (Reference ID for [ Game](https://api-docs.igdb.com/#game)): Similar games\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `standalone_expansions` (Reference ID for [ Game](https://api-docs.igdb.com/#game)): Standalone expansions of this game\n - `status` ([Status Enum](https://api-docs.igdb.com/#game-enums)): The status of the games release\n - `storyline` (String): A short description of a games story\n - `summary` (String): A description of the game\n - `tags` (Array of [Tag Numbers](https://api-docs.igdb.com/#tag-numbers)): Related entities in the IGDB API\n - `themes` (Array of [Theme](https://api-docs.igdb.com/#theme) IDs): Themes of the game\n - `total_rating` (Double): Average rating based on both IGDB user and external critic scores\n - `total_rating_count` (Integer): Total number of user and external critic scores\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n - `version_parent` (Reference ID for [ Game](https://api-docs.igdb.com/#game)): If a version, this is the main game\n - `version_title` (String): Title of this version (i.e Gold edition)\n - `videos` (Reference ID for [ Game Video](https://api-docs.igdb.com/#game-video)): Videos of this game\n - `websites` (Reference ID for [ Website](https://api-docs.igdb.com/#website)): Websites associated with this game\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function game(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game endpoint.
\nEndpoint Description: Video Games!
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game endpoint method\n $igdb->game($query, $count);\n\n?>\n
\nFields in response
\nage_ratings
(Reference ID for Age Rating): The PEGI ratingaggregated_rating
(Double): Rating based on external critic scoresaggregated_rating_count
(Integer): Number of external critic scoresalternative_names
(Array of Alternative Name IDs): Alternative names for this gameartworks
(Array of Artwork IDs): Artworks of this gamebundles
(Reference ID for Game): The bundles this game is a part ofcategory
(Category Enum): The category of this gamechecksum
(uuid): Hash of the objectcollection
(Reference ID for Collection): The series the game belongs tocover
(Reference ID for Cover): The cover of this gamecreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasedlcs
(Reference ID for Game): DLCs for this gameexpansions
(Reference ID for Game): Expansions of this gameexternal_games
(Array of External Game IDs): External IDs this game has on other servicesfirst_release_date
(Unix Time Stamp): The first release date for this gamefollows
(Integer): Number of people following a gamefranchise
(Reference ID for Franchise): The main franchisefranchises
(Array of Franchise IDs): Other franchises the game belongs togame_engines
(Array of Game Engine IDs): The game engine used in this gamegame_modes
(Array of Game Mode IDs): Modes of gameplaygenres
(Array of Genre IDs): Genres of the gamehypes
(Integer): Number of follows a game gets before releaseinvolved_companies
(Array of Involved Company IDs): Companies who developed this gamekeywords
(Array of Keyword IDs): Associated keywordsmultiplayer_modes
(Array of Multiplayer Mode IDs): Multiplayer modes for this gamename
(String)parent_game
(Reference ID for Game): If a DLC, expansion or part of a bundle, this is the main game or bundleplatforms
(Array of Platform IDs): Platforms this game was released onplayer_perspectives
(Array of Player Perspective IDs): The main perspective of the playerrating
(Double): Average IGDB user ratingrating_count
(Integer): Total number of IGDB user ratingsrelease_dates
(Array of Release Date IDs): Release dates of this gamescreenshots
(Array of Screenshot IDs): Screenshots of this gamesimilar_games
(Reference ID for Game): Similar gamesslug
(String): A url-safe, unique, lower-case version of the namestandalone_expansions
(Reference ID for Game): Standalone expansions of this gamestatus
(Status Enum): The status of the games releasestoryline
(String): A short description of a games storysummary
(String): A description of the gametags
(Array of Tag Numbers): Related entities in the IGDB APIthemes
(Array of Theme IDs): Themes of the gametotal_rating
(Double): Average rating based on both IGDB user and external critic scorestotal_rating_count
(Integer): Total number of user and external critic scoresupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the itemversion_parent
(Reference ID for Game): If a version, this is the main gameversion_title
(String): Title of this version (i.e Gold edition)videos
(Reference ID for Game Video): Videos of this gamewebsites
(Reference ID for Website): Websites associated with this game\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":59},{"id":"182baa8","slug":"genre","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Genre","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Genre endpoint.\n\nEndpoint Description: Genres of video game\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\nname (String)\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function genre(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Genre](https://api-docs.igdb.com/#genre) endpoint.\n\n**Endpoint Description**: Genres of video game\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngenre($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `name` (String)\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function genre(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Genre endpoint.
\nEndpoint Description: Genres of video game
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Genre endpoint method\n $igdb->genre($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasename
(String)slug
(String): A url-safe, unique, lower-case version of the nameupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":60},{"id":"ab92e48","slug":"involved-company","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Involved Company","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Involved Company endpoint.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncompany (Reference ID for Company)\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\ndeveloper (boolean)\n\ngame (Reference ID for Game)\n\nporting (boolean)\n\npublisher (boolean)\n\nsupporting (boolean)\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function involved_company(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Involved Company](https://api-docs.igdb.com/#involved-company) endpoint.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ninvolved_company($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `company` (Reference ID for [Company](https://api-docs.igdb.com/#company))\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `developer` (boolean)\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game))\n - `porting` (boolean)\n - `publisher` (boolean)\n - `supporting` (boolean)\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function involved_company(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Involved Company endpoint.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Involved Company endpoint method\n $igdb->involved_company($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcompany
(Reference ID for Company)created_at
(Unix Time Stamp): Date this was initially added to the IGDB databasedeveloper
(boolean)game
(Reference ID for Game)porting
(boolean)publisher
(boolean)supporting
(boolean)updated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB database\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":61},{"id":"f09333f","slug":"keyword","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Keyword","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Keyword endpoint.\n\nEndpoint Description: Keywords are words or phrases that get tagged to a game such as “world war 2” or “steampunk”.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\nname (String)\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function keyword(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Keyword](https://api-docs.igdb.com/#keyword) endpoint.\n\n**Endpoint Description**: Keywords are words or phrases that get tagged to a game such as “world war 2” or “steampunk”.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nkeyword($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `name` (String)\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function keyword(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Keyword endpoint.
\nEndpoint Description: Keywords are words or phrases that get tagged to a game such as “world war 2” or “steampunk”.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Keyword endpoint method\n $igdb->keyword($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasename
(String)slug
(String): A url-safe, unique, lower-case version of the nameupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":62},{"id":"4bd0a18","slug":"multiplayer-mode","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Multiplayer Mode","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Multiplayer Mode endpoint.\n\nEndpoint Description: Data about the supported multiplayer types\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\ncampaigncoop (boolean): True if the game supports campaign coop\n\nchecksum (uuid): Hash of the object\n\ndropin (boolean): True if the game supports drop in/out multiplayer\n\ngame (Reference ID for Game): The game this multiplayer mode is associated with\n\nlancoop (boolean): True if the game supports LAN coop\n\nofflinecoop (boolean): True if the game supports offline coop\n\nofflinecoopmax (Integer): Maximum number of offline players in offline coop\n\nofflinemax (Integer): Maximum number of players in offline multiplayer\n\nonlinecoop (boolean): True if the game supports online coop\n\nonlinecoopmax (Integer): Maximum number of online players in online coop\n\nonlinemax (Integer): Maximum number of players in online multiplayer\n\nplatform (Reference ID for Platform): The platform this multiplayer mode refers to\n\nsplitscreen (boolean): True if the game supports split screen, offline multiplayer\n\nsplitscreenonline (boolean): True if the game supports split screen, online multiplayer\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function multiplayer_mode(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Multiplayer Mode](https://api-docs.igdb.com/#multiplayer-mode) endpoint.\n\n**Endpoint Description**: Data about the supported multiplayer types\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nmultiplayer_mode($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `campaigncoop` (boolean): True if the game supports campaign coop\n - `checksum` (uuid): Hash of the object\n - `dropin` (boolean): True if the game supports drop in/out multiplayer\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game)): The game this multiplayer mode is associated with\n - `lancoop` (boolean): True if the game supports LAN coop\n - `offlinecoop` (boolean): True if the game supports offline coop\n - `offlinecoopmax` (Integer): Maximum number of offline players in offline coop\n - `offlinemax` (Integer): Maximum number of players in offline multiplayer\n - `onlinecoop` (boolean): True if the game supports online coop\n - `onlinecoopmax` (Integer): Maximum number of online players in online coop\n - `onlinemax` (Integer): Maximum number of players in online multiplayer\n - `platform` (Reference ID for [Platform](https://api-docs.igdb.com/#platform)): The platform this multiplayer mode refers to\n - `splitscreen` (boolean): True if the game supports split screen, offline multiplayer\n - `splitscreenonline` (boolean): True if the game supports split screen, online multiplayer\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function multiplayer_mode(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Multiplayer Mode endpoint.
\nEndpoint Description: Data about the supported multiplayer types
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Multiplayer Mode endpoint method\n $igdb->multiplayer_mode($query, $count);\n\n?>\n
\nFields in response
\ncampaigncoop
(boolean): True if the game supports campaign coopchecksum
(uuid): Hash of the objectdropin
(boolean): True if the game supports drop in/out multiplayergame
(Reference ID for Game): The game this multiplayer mode is associated withlancoop
(boolean): True if the game supports LAN coopofflinecoop
(boolean): True if the game supports offline coopofflinecoopmax
(Integer): Maximum number of offline players in offline coopofflinemax
(Integer): Maximum number of players in offline multiplayeronlinecoop
(boolean): True if the game supports online cooponlinecoopmax
(Integer): Maximum number of online players in online cooponlinemax
(Integer): Maximum number of players in online multiplayerplatform
(Reference ID for Platform): The platform this multiplayer mode refers tosplitscreen
(boolean): True if the game supports split screen, offline multiplayersplitscreenonline
(boolean): True if the game supports split screen, online multiplayer\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":63},{"id":"21558e9","slug":"platform-family","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform Family","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform Family endpoint.\n\nEndpoint Description: A collection of closely related platforms\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\nname (String): The name of the platform family\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function platform_family(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform Family](https://api-docs.igdb.com/#platform-family) endpoint.\n\n**Endpoint Description**: A collection of closely related platforms\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform_family($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `name` (String): The name of the platform family\n - `slug` (String): A url-safe, unique, lower-case version of the name\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function platform_family(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform Family endpoint.
\nEndpoint Description: A collection of closely related platforms
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform Family endpoint method\n $igdb->platform_family($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectname
(String): The name of the platform familyslug
(String): A url-safe, unique, lower-case version of the name\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":64},{"id":"7448df9","slug":"platform-logo","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform Logo","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform Logo endpoint.\n\nEndpoint Description: Logo for a platform\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nalpha_channel (boolean)\n\nanimated (boolean)\n\nchecksum (uuid): Hash of the object\n\nheight (Integer): The height of the image in pixels\n\nimage_id (String): The ID of the image used to construct an IGDB image link\n\nurl (String): The website address (URL) of the item\n\nwidth (Integer): The width of the image in pixels\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function platform_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform Logo](https://api-docs.igdb.com/#platform-logo) endpoint.\n\n**Endpoint Description**: Logo for a platform\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform_logo($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `alpha_channel` (boolean)\n - `animated` (boolean)\n - `checksum` (uuid): Hash of the object\n - `height` (Integer): The height of the image in pixels\n - `image_id` (String): The ID of the image used to construct an IGDB image link\n - `url` (String): The website address (URL) of the item\n - `width` (Integer): The width of the image in pixels\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function platform_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform Logo endpoint.
\nEndpoint Description: Logo for a platform
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform Logo endpoint method\n $igdb->platform_logo($query, $count);\n\n?>\n
\nFields in response
\nalpha_channel
(boolean)animated
(boolean)checksum
(uuid): Hash of the objectheight
(Integer): The height of the image in pixelsimage_id
(String): The ID of the image used to construct an IGDB image linkurl
(String): The website address (URL) of the itemwidth
(Integer): The width of the image in pixels\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":65},{"id":"26c0c2f","slug":"platform-version-company","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform Version Company","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform Version Company endpoint.\n\nEndpoint Description: A platform developer\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncomment (String): Any notable comments about the developer\n\ncompany (Reference ID for Company): The company responsible for developing this platform version\n\ndeveloper (boolean)\n\nmanufacturer (boolean)\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function platform_version_company(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform Version Company](https://api-docs.igdb.com/#platform-version-company) endpoint.\n\n**Endpoint Description**: A platform developer\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform_version_company($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `comment` (String): Any notable comments about the developer\n - `company` (Reference ID for [Company](https://api-docs.igdb.com/#company)): The company responsible for developing this platform version\n - `developer` (boolean)\n - `manufacturer` (boolean)\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function platform_version_company(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform Version Company endpoint.
\nEndpoint Description: A platform developer
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform Version Company endpoint method\n $igdb->platform_version_company($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcomment
(String): Any notable comments about the developercompany
(Reference ID for Company): The company responsible for developing this platform versiondeveloper
(boolean)manufacturer
(boolean)\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":66},{"id":"0fc5bf3","slug":"platform-version-release-date","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform Version Release Date","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform Version Release Date endpoint.\n\nEndpoint Description: A handy endpoint that extends platform release dates. Used to dig deeper into release dates, platforms and versions.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\ncategory (Category Enum): The format of the release date\n\nchecksum (uuid): Hash of the object\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\ndate (Unix Time Stamp): The release date\n\nhuman (String): A human readable version of the release date\n\nm (Integer): The month as an integer starting at 1 (January)\n\nplatform_version (Reference ID for Platform Version): The platform this release date is for\n\nregion (Region Enum): The region of the release\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\ny (Integer): The year in full (2018)\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function platform_version_release_date(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform Version Release Date](https://api-docs.igdb.com/#platform-version-release-date) endpoint.\n\n**Endpoint Description**: A handy endpoint that extends platform release dates. Used to dig deeper into release dates, platforms and versions.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform_version_release_date($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `category` ([Category Enum](https://api-docs.igdb.com/#platform-version-release-date-enums)): The format of the release date\n - `checksum` (uuid): Hash of the object\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `date` (Unix Time Stamp): The release date\n - `human` (String): A human readable version of the release date\n - `m` (Integer): The month as an integer starting at 1 (January)\n - `platform_version` (Reference ID for [Platform Version](https://api-docs.igdb.com/#platform-version)): The platform this release date is for\n - `region` ([Region Enum](https://api-docs.igdb.com/#platform-version-release-date-enums)): The region of the release\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `y` (Integer): The year in full (2018)\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function platform_version_release_date(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform Version Release Date endpoint.
\nEndpoint Description: A handy endpoint that extends platform release dates. Used to dig deeper into release dates, platforms and versions.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform Version Release Date endpoint method\n $igdb->platform_version_release_date($query, $count);\n\n?>\n
\nFields in response
\ncategory
(Category Enum): The format of the release datechecksum
(uuid): Hash of the objectcreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasedate
(Unix Time Stamp): The release datehuman
(String): A human readable version of the release datem
(Integer): The month as an integer starting at 1 (January)platform_version
(Reference ID for Platform Version): The platform this release date is forregion
(Region Enum): The region of the releaseupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databasey
(Integer): The year in full (2018)\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":67},{"id":"fd4b00d","slug":"platform-version","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform Version","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform Version endpoint.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncompanies (Reference ID for Platform Version Company): Who developed this platform version\n\nconnectivity (String): The network capabilities\n\ncpu (String): The integrated control processing unit\n\ngraphics (String): The graphics chipset\n\nmain_manufacturer (Reference ID for Platform Version Company): Who manufactured this version of the platform\n\nmedia (String): The type of media this version accepted\n\nmemory (String): How much memory there is\n\nname (String): The name of the platform version\n\nos (String): The operating system installed on the platform version\n\noutput (String): The output video rate\n\nplatform_logo (Reference ID for Platform Logo): The logo of this platform version\n\nplatform_version_release_dates (Array of Platform Version Release Date IDs): When this platform was released\n\nresolutions (String): The maximum resolution\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nsound (String): The sound chipset\n\nstorage (String): How much storage there is\n\nsummary (String): A short summary\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function platform_version(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform Version](https://api-docs.igdb.com/#platform-version) endpoint.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform_version($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `companies` (Reference ID for [ Platform Version Company](https://api-docs.igdb.com/#platform-version-company)): Who developed this platform version\n - `connectivity` (String): The network capabilities\n - `cpu` (String): The integrated control processing unit\n - `graphics` (String): The graphics chipset\n - `main_manufacturer` (Reference ID for [ Platform Version Company](https://api-docs.igdb.com/#platform-version-company)): Who manufactured this version of the platform\n - `media` (String): The type of media this version accepted\n - `memory` (String): How much memory there is\n - `name` (String): The name of the platform version\n - `os` (String): The operating system installed on the platform version\n - `output` (String): The output video rate\n - `platform_logo` (Reference ID for [Platform Logo](https://api-docs.igdb.com/#platform-logo)): The logo of this platform version\n - `platform_version_release_dates` (Array of [Platform Version Release Date](https://api-docs.igdb.com/#platform-version-release-date) IDs): When this platform was released\n - `resolutions` (String): The maximum resolution\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `sound` (String): The sound chipset\n - `storage` (String): How much storage there is\n - `summary` (String): A short summary\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function platform_version(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform Version endpoint.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform Version endpoint method\n $igdb->platform_version($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcompanies
(Reference ID for Platform Version Company): Who developed this platform versionconnectivity
(String): The network capabilitiescpu
(String): The integrated control processing unitgraphics
(String): The graphics chipsetmain_manufacturer
(Reference ID for Platform Version Company): Who manufactured this version of the platformmedia
(String): The type of media this version acceptedmemory
(String): How much memory there isname
(String): The name of the platform versionos
(String): The operating system installed on the platform versionoutput
(String): The output video rateplatform_logo
(Reference ID for Platform Logo): The logo of this platform versionplatform_version_release_dates
(Array of Platform Version Release Date IDs): When this platform was releasedresolutions
(String): The maximum resolutionslug
(String): A url-safe, unique, lower-case version of the namesound
(String): The sound chipsetstorage
(String): How much storage there issummary
(String): A short summaryurl
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":68},{"id":"2a0f2e3","slug":"platform-website","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform Website","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform Website endpoint.\n\nEndpoint Description: The main website for the platform\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\ncategory (Category Enum): The service this website links to\n\nchecksum (uuid): Hash of the object\n\ntrusted (boolean)\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function platform_website(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform Website](https://api-docs.igdb.com/#platform-website) endpoint.\n\n**Endpoint Description**: The main website for the platform\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform_website($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `category` ([Category Enum](https://api-docs.igdb.com/#platform-website-enums)): The service this website links to\n - `checksum` (uuid): Hash of the object\n - `trusted` (boolean)\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function platform_website(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform Website endpoint.
\nEndpoint Description: The main website for the platform
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform Website endpoint method\n $igdb->platform_website($query, $count);\n\n?>\n
\nFields in response
\ncategory
(Category Enum): The service this website links tochecksum
(uuid): Hash of the objecttrusted
(boolean)url
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":69},{"id":"6a55946","slug":"platform","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform endpoint.\n\nEndpoint Description: The hardware used to run the game or game delivery network\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nabbreviation (String): An abbreviation of the platform name\n\nalternative_name (String): An alternative name for the platform\n\ncategory (Category Enum): A physical or virtual category of the platform\n\nchecksum (uuid): Hash of the object\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\ngeneration (Integer): The generation of the platform\n\nname (String): The name of the platform\n\nplatform_family (Reference ID for Platform Family): The family of platforms this one belongs to\n\nplatform_logo (Reference ID for Platform Logo): The logo of the first Version of this platform\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nsummary (String): The summary of the first Version of this platform\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nversions (Reference ID for Platform Version): Associated versions of this platform\n\nwebsites (Reference ID for Platform Website): The main website\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function platform(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform](https://api-docs.igdb.com/#platform) endpoint.\n\n**Endpoint Description**: The hardware used to run the game or game delivery network\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `abbreviation` (String): An abbreviation of the platform name\n - `alternative_name` (String): An alternative name for the platform\n - `category` ([Category Enum](https://api-docs.igdb.com/#platform-enums)): A physical or virtual category of the platform\n - `checksum` (uuid): Hash of the object\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `generation` (Integer): The generation of the platform\n - `name` (String): The name of the platform\n - `platform_family` (Reference ID for [Platform Family](https://api-docs.igdb.com/#platform-family)): The family of platforms this one belongs to\n - `platform_logo` (Reference ID for [Platform Logo](https://api-docs.igdb.com/#platform-logo)): The logo of the first Version of this platform\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `summary` (String): The summary of the first Version of this platform\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n - `versions` (Reference ID for [ Platform Version](https://api-docs.igdb.com/#platform-version)): Associated versions of this platform\n - `websites` (Reference ID for [ Platform Website](https://api-docs.igdb.com/#platform-website)): The main website\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function platform(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform endpoint.
\nEndpoint Description: The hardware used to run the game or game delivery network
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform endpoint method\n $igdb->platform($query, $count);\n\n?>\n
\nFields in response
\nabbreviation
(String): An abbreviation of the platform namealternative_name
(String): An alternative name for the platformcategory
(Category Enum): A physical or virtual category of the platformchecksum
(uuid): Hash of the objectcreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasegeneration
(Integer): The generation of the platformname
(String): The name of the platformplatform_family
(Reference ID for Platform Family): The family of platforms this one belongs toplatform_logo
(Reference ID for Platform Logo): The logo of the first Version of this platformslug
(String): A url-safe, unique, lower-case version of the namesummary
(String): The summary of the first Version of this platformupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the itemversions
(Reference ID for Platform Version): Associated versions of this platformwebsites
(Reference ID for Platform Website): The main website\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":70},{"id":"946855e","slug":"player-perspective","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Player Perspective","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Player Perspective endpoint.\n\nEndpoint Description: Player perspectives describe the view/perspective of the player in a video game.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\nname (String)\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function player_perspective(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Player Perspective](https://api-docs.igdb.com/#player-perspective) endpoint.\n\n**Endpoint Description**: Player perspectives describe the view/perspective of the player in a video game.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplayer_perspective($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `name` (String)\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function player_perspective(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Player Perspective endpoint.
\nEndpoint Description: Player perspectives describe the view/perspective of the player in a video game.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Player Perspective endpoint method\n $igdb->player_perspective($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasename
(String)slug
(String): A url-safe, unique, lower-case version of the nameupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":71},{"id":"204b21c","slug":"release-date","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Release Date","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Release Date endpoint.\n\nEndpoint Description: A handy endpoint that extends game release dates. Used to dig deeper into release dates, platforms and versions.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\ncategory (Category Enum): The format category of the release date\n\nchecksum (uuid): Hash of the object\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\ndate (Unix Time Stamp): The date of the release\n\ngame (Reference ID for Game)\n\nhuman (String): A human readable representation of the date\n\nm (Integer): The month as an integer starting at 1 (January)\n\nplatform (Reference ID for Platform): The platform of the release\n\nregion (Region Enum): The region of the release\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\ny (Integer): The year in full (2018)\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function release_date(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Release Date](https://api-docs.igdb.com/#release-date) endpoint.\n\n**Endpoint Description**: A handy endpoint that extends game release dates. Used to dig deeper into release dates, platforms and versions.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nrelease_date($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `category` ([Category Enum](https://api-docs.igdb.com/#release-date-enums)): The format category of the release date\n - `checksum` (uuid): Hash of the object\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `date` (Unix Time Stamp): The date of the release\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game))\n - `human` (String): A human readable representation of the date\n - `m` (Integer): The month as an integer starting at 1 (January)\n - `platform` (Reference ID for [Platform](https://api-docs.igdb.com/#platform)): The platform of the release\n - `region` ([Region Enum](https://api-docs.igdb.com/#release-date-enums)): The region of the release\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `y` (Integer): The year in full (2018)\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function release_date(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Release Date endpoint.
\nEndpoint Description: A handy endpoint that extends game release dates. Used to dig deeper into release dates, platforms and versions.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Release Date endpoint method\n $igdb->release_date($query, $count);\n\n?>\n
\nFields in response
\ncategory
(Category Enum): The format category of the release datechecksum
(uuid): Hash of the objectcreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasedate
(Unix Time Stamp): The date of the releasegame
(Reference ID for Game)human
(String): A human readable representation of the datem
(Integer): The month as an integer starting at 1 (January)platform
(Reference ID for Platform): The platform of the releaseregion
(Region Enum): The region of the releaseupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databasey
(Integer): The year in full (2018)\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":72},{"id":"f67ed58","slug":"screenshot","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Screenshot","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Screenshot endpoint.\n\nEndpoint Description: Screenshots of games\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nalpha_channel (boolean)\n\nanimated (boolean)\n\nchecksum (uuid): Hash of the object\n\ngame (Reference ID for Game): The game this video is associated with\n\nheight (Integer): The height of the image in pixels\n\nimage_id (String): The ID of the image used to construct an IGDB image link\n\nurl (String): The website address (URL) of the item\n\nwidth (Integer): The width of the image in pixels\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function screenshot(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Screenshot](https://api-docs.igdb.com/#screenshot) endpoint.\n\n**Endpoint Description**: Screenshots of games\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nscreenshot($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `alpha_channel` (boolean)\n - `animated` (boolean)\n - `checksum` (uuid): Hash of the object\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game)): The game this video is associated with\n - `height` (Integer): The height of the image in pixels\n - `image_id` (String): The ID of the image used to construct an IGDB image link\n - `url` (String): The website address (URL) of the item\n - `width` (Integer): The width of the image in pixels\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function screenshot(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Screenshot endpoint.
\nEndpoint Description: Screenshots of games
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Screenshot endpoint method\n $igdb->screenshot($query, $count);\n\n?>\n
\nFields in response
\nalpha_channel
(boolean)animated
(boolean)checksum
(uuid): Hash of the objectgame
(Reference ID for Game): The game this video is associated withheight
(Integer): The height of the image in pixelsimage_id
(String): The ID of the image used to construct an IGDB image linkurl
(String): The website address (URL) of the itemwidth
(Integer): The width of the image in pixels\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":73},{"id":"67b3635","slug":"search-ii","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Search","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Search endpoint.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nalternative_name (String)\n\ncharacter (Reference ID for Character)\n\nchecksum (uuid): Hash of the object\n\ncollection (Reference ID for Collection)\n\ncompany (Reference ID for Company)\n\ndescription (String)\n\ngame (Reference ID for Game)\n\nname (String)\n\nplatform (Reference ID for Platform)\n\npublished_at (Unix Time Stamp): The date this item was initially published by the third party\n\ntest_dummy (Reference ID for Test Dummy)\n\ntheme (Reference ID for Theme)\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function search(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Search](https://api-docs.igdb.com/#search) endpoint.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nsearch($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `alternative_name` (String)\n - `character` (Reference ID for [Character](https://api-docs.igdb.com/#character))\n - `checksum` (uuid): Hash of the object\n - `collection` (Reference ID for [Collection](https://api-docs.igdb.com/#collection))\n - `company` (Reference ID for [Company](https://api-docs.igdb.com/#company))\n - `description` (String)\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game))\n - `name` (String)\n - `platform` (Reference ID for [Platform](https://api-docs.igdb.com/#platform))\n - `published_at` (Unix Time Stamp): The date this item was initially published by the third party\n - `test_dummy` (Reference ID for [Test Dummy](https://api-docs.igdb.com/#test-dummy))\n - `theme` (Reference ID for [Theme](https://api-docs.igdb.com/#theme))\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function search(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Search endpoint.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Search endpoint method\n $igdb->search($query, $count);\n\n?>\n
\nFields in response
\nalternative_name
(String)character
(Reference ID for Character)checksum
(uuid): Hash of the objectcollection
(Reference ID for Collection)company
(Reference ID for Company)description
(String)game
(Reference ID for Game)name
(String)platform
(Reference ID for Platform)published_at
(Unix Time Stamp): The date this item was initially published by the third partytest_dummy
(Reference ID for Test Dummy)theme
(Reference ID for Theme)\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":74},{"id":"20792d4","slug":"theme","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Theme","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Theme endpoint.\n\nEndpoint Description: Video game themes\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\nchecksum (uuid): Hash of the object\n\ncreated_at (Unix Time Stamp): Date this was initially added to the IGDB database\n\nname (String)\n\nslug (String): A url-safe, unique, lower-case version of the name\n\nupdated_at (Unix Time Stamp): The last date this entry was updated in the IGDB database\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function theme(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Theme](https://api-docs.igdb.com/#theme) endpoint.\n\n**Endpoint Description**: Video game themes\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ntheme($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `checksum` (uuid): Hash of the object\n - `created_at` (Unix Time Stamp): Date this was initially added to the IGDB database\n - `name` (String)\n - `slug` (String): A url-safe, unique, lower-case version of the name\n - `updated_at` (Unix Time Stamp): The last date this entry was updated in the IGDB database\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function theme(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Theme endpoint.
\nEndpoint Description: Video game themes
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Theme endpoint method\n $igdb->theme($query, $count);\n\n?>\n
\nFields in response
\nchecksum
(uuid): Hash of the objectcreated_at
(Unix Time Stamp): Date this was initially added to the IGDB databasename
(String)slug
(String): A url-safe, unique, lower-case version of the nameupdated_at
(Unix Time Stamp): The last date this entry was updated in the IGDB databaseurl
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":75},{"id":"f8262e8","slug":"website","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Website","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Website endpoint.\n\nEndpoint Description: A website url, usually associated with a game\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.\n\n\n\nFields in response\n\ncategory (Category Enum): The service this website links to\n\nchecksum (uuid): Hash of the object\n\ngame (Reference ID for Game): The game this website is associated with\n\ntrusted (boolean)\n\nurl (String): The website address (URL) of the item\n\nFor more information on return values, refer to the return values section!","markdown":"```php\npublic function website(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Website](https://api-docs.igdb.com/#website) endpoint.\n\n**Endpoint Description**: A website url, usually associated with a game\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nwebsite($query, $count);\n\n?>\n```\n\n**Fields in response**\n - `category` ([Category Enum](https://api-docs.igdb.com/#website-enums)): The service this website links to\n - `checksum` (uuid): Hash of the object\n - `game` (Reference ID for [Game](https://api-docs.igdb.com/#game)): The game this website is associated with\n - `trusted` (boolean)\n - `url` (String): The website address (URL) of the item\n\n> For more information on return values, refer to the [return values section](#return-values)!","html":"For more information on return values, refer to the return values section!
\n
public function website(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Website endpoint.
\nEndpoint Description: A website url, usually associated with a game
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Website endpoint method\n $igdb->website($query, $count);\n\n?>\n
\nFields in response
\ncategory
(Category Enum): The service this website links tochecksum
(uuid): Hash of the objectgame
(Reference ID for Game): The game this website is associated withtrusted
(boolean)url
(String): The website address (URL) of the item\n"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":76},{"id":"cf8a7d3","slug":"multiquery","level":2,"parent":"cbf8ecb","parents":["cbf8ecb"],"title":"MultiQuery","date":null,"timestamp":null,"body":{"stripped":"This method executes a query against the multiquery endpoint. With this functionality one is able to execute multiple queries in a single request.\n\n:warning If you are using the Query Builder to construct your queries, the parameters name and endpoint are mandatory! There is also a third optional parameter count. If any of the mandatory parameters are missing for the multiquery, an IGDBInvalidParameterException is thrown! Please refer to the build method for more information!\n\nParameters\n\n$queries: an array of apicalypse formatted multiquery query strings.\n\nReturns: the response from the IGDB endpoint. The result object can vary depending on your query.\n\n\n\nThe result of the query:","markdown":"```php\npublic function multiquery(array $queries) throws IGDBEndpointException, IGDBInvalidParameterException: mixed\n```\n\nThis method executes a query against the `multiquery` endpoint. With this functionality one is able to execute multiple queries in a single request.\n\n> :warning If you are using the [Query Builder](#igdb-query-builder) to construct your queries, the parameters [`name`](#name) and [`endpoint`](#endpoint) are **mandatory**! There is also a third optional parameter [`count`](#count). If any of the mandatory parameters are missing for the multiquery, an `IGDBInvalidParameterException` is thrown! Please refer to the [`build`](#building-the-query) method for more information!\n\n**Parameters**\n - `$queries`: an array of apicalypse formatted multiquery query strings.\n\n**Returns**: the response from the IGDB endpoint. The result object can vary depending on your query.\n\n```php\nname(\"Main Game\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\")\n ->build(true);\n\n // building the bundle query\n $bundle = $bundle_builder\n ->name(\"Bundles\")\n ->endpoint(\"game\")\n ->fields(\"id,name,version_parent,category\")\n ->where(\"version_parent = 25076\")\n ->where(\"category = 0\")\n ->build(true);\n\n // the query can be passed as a string too\n\n // $main = \"query games \\\"Main Game\\\" {\n // fields id,name;\n // where id = 25076;\n // };\";\n\n // $bundle = \"query games \\\"Bundles\\\" {\n // fields id,name,version_parent,category;\n // where version_parent = 25076 & category = 0;\n // };\";\n\n // passing the queries to the multiquery method as an array of strings\n var_dump(\n $igdb->multiquery(\n array($main, $bundle)\n )\n );\n } catch (IGDBInvaliParameterException $e) {\n // a builder property is invalid\n echo $e->getMessage();\n } catch (IGDBEndpointException $e) {\n // something went wront with the query\n echo $e->getMessage();\n }\n?>\n```\nThe result of the query:\n\n```text\narray (size=2)\n 0 =>\n object(stdClass)[4]\n public 'name' => string 'Main Game' (length=9)\n public 'result' =>\n array (size=1)\n 0 =>\n object(stdClass)[5]\n public 'id' => int 25076\n public 'name' => string 'Red Dead Redemption 2' (length=21)\n 1 =>\n object(stdClass)[6]\n public 'name' => string 'Bundles' (length=7)\n public 'result' =>\n array (size=3)\n 0 =>\n object(stdClass)[7]\n public 'id' => int 103207\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Collector's Box' (length=38)\n public 'version_parent' => int 25076\n 1 =>\n object(stdClass)[8]\n public 'id' => int 103206\n public 'category' => int 0\n public 'name' => string 'Red dead Redemption 2: Ultimate Edition' (length=39)\n public 'version_parent' => int 25076\n 2 =>\n object(stdClass)[9]\n public 'id' => int 103205\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Special Edition' (length=38)\n public 'version_parent' => int 25076\n```","html":"For more information on return values, refer to the return values section!
\n
public function multiquery(array $queries) throws IGDBEndpointException, IGDBInvalidParameterException: mixed\n
\nThis method executes a query against the multiquery
endpoint. With this functionality one is able to execute multiple queries in a single request.
\n\n:warning If you are using the Query Builder to construct your queries, the parameters
\nname
andendpoint
are mandatory! There is also a third optional parametercount
. If any of the mandatory parameters are missing for the multiquery, anIGDBInvalidParameterException
is thrown! Please refer to thebuild
method for more information!
Parameters
\n$queries
: an array of apicalypse formatted multiquery query strings.Returns: the response from the IGDB endpoint. The result object can vary depending on your query.
\n<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // query builder for the main game\n $main_builder = new IGDBQueryBuilder();\n\n // query builder for the bundles\n $bundle_builder = new IGDBQueryBuilder();\n\n try {\n // building the main game query\n $main = $main_builder\n ->name(\"Main Game\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\")\n ->build(true);\n\n // building the bundle query\n $bundle = $bundle_builder\n ->name(\"Bundles\")\n ->endpoint(\"game\")\n ->fields(\"id,name,version_parent,category\")\n ->where(\"version_parent = 25076\")\n ->where(\"category = 0\")\n ->build(true);\n\n // the query can be passed as a string too\n\n // $main = \"query games \\\"Main Game\\\" {\n // fields id,name;\n // where id = 25076;\n // };\";\n\n // $bundle = \"query games \\\"Bundles\\\" {\n // fields id,name,version_parent,category;\n // where version_parent = 25076 & category = 0;\n // };\";\n\n // passing the queries to the multiquery method as an array of strings\n var_dump(\n $igdb->multiquery(\n array($main, $bundle)\n )\n );\n } catch (IGDBInvaliParameterException $e) {\n // a builder property is invalid\n echo $e->getMessage();\n } catch (IGDBEndpointException $e) {\n // something went wront with the query\n echo $e->getMessage();\n }\n?>\n
\nThe result of the query:
\narray (size=2)\n 0 =>\n object(stdClass)[4]\n public 'name' => string 'Main Game' (length=9)\n public 'result' =>\n array (size=1)\n 0 =>\n object(stdClass)[5]\n public 'id' => int 25076\n public 'name' => string 'Red Dead Redemption 2' (length=21)\n 1 =>\n object(stdClass)[6]\n public 'name' => string 'Bundles' (length=7)\n public 'result' =>\n array (size=3)\n 0 =>\n object(stdClass)[7]\n public 'id' => int 103207\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Collector's Box' (length=38)\n public 'version_parent' => int 25076\n 1 =>\n object(stdClass)[8]\n public 'id' => int 103206\n public 'category' => int 0\n public 'name' => string 'Red dead Redemption 2: Ultimate Edition' (length=39)\n public 'version_parent' => int 25076\n 2 =>\n object(stdClass)[9]\n public 'id' => int 103205\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Special Edition' (length=38)\n public 'version_parent' => int 25076\n
"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":77},{"id":"a68dee9","slug":"return-values","level":2,"parent":"cbf8ecb","parents":["cbf8ecb"],"title":"Return Values","date":null,"timestamp":null,"body":{"stripped":"Every endpoint method can return two different type of results, depending on the second parameter passed to them.\n\nBy default the second $count parameter is a boolean false. this means, that the query will be executed against the IGDB, returning a $result array of objects.\n\n\n\nThe result of the query above:\n\n\n\nIf you pass a boolean true as a second parameter, then you will get an object with a count property containing the item count from the selected endpoint filtered by the $query filters.\n\n\n\nThe result of the query above:\n\n\n\nThe result object's properties will vary depending on the provided field list in the $query. From the example result above you can see, the result holds an array, containing two elements. Every element of the result array is an object, containing properties with name of the fields from the fields parameter.","markdown":"Every endpoint method can return two different type of results, depending on the second parameter passed to them.\n\nBy default the second `$count` parameter is a boolean `false`. this means, that the query will be executed against the IGDB, returning a `$result` **array of objects**.\n\n```php\ngame(\"fields id,name; where id = (1,2);\");\n\n?>\n```\n\nThe result of the query above:\n\n```text\narray (size=2)\n 0 =>\n object(stdClass)[2]\n public 'id' => int 1\n public 'name' => string 'Thief II: The Metal Age' (length=23)\n 1 =>\n object(stdClass)[3]\n public 'id' => int 2\n public 'name' => string 'Thief: The Dark Project' (length=23)\n```\n\nIf you pass a boolean `true` as a second parameter, then you will get an object with a `count` property containing the item count from the selected endpoint filtered by the `$query` filters.\n\n```php\ngame(\"fields id,name; where id = (1,2);\", true);\n\n?>\n```\n\nThe result of the query above:\n```text\nobject(stdClass)[3]\n public 'count' => int 2\n```\n\nThe result object's properties will vary depending on the provided field list in the `$query`. From the example result above you can see, the result holds an array, containing two elements. Every element of the result array is an object, containing properties with name of the fields from the `fields` parameter.","html":"Every endpoint method can return two different type of results, depending on the second parameter passed to them.
\nBy default the second $count
parameter is a boolean false
. this means, that the query will be executed against the IGDB, returning a $result
array of objects.
<?php\n\n // a query against the game endpoint without a $count parameter\n $igdb->game(\"fields id,name; where id = (1,2);\");\n\n?>\n
\nThe result of the query above:
\narray (size=2)\n 0 =>\n object(stdClass)[2]\n public 'id' => int 1\n public 'name' => string 'Thief II: The Metal Age' (length=23)\n 1 =>\n object(stdClass)[3]\n public 'id' => int 2\n public 'name' => string 'Thief: The Dark Project' (length=23)\n
\nIf you pass a boolean true
as a second parameter, then you will get an object with a count
property containing the item count from the selected endpoint filtered by the $query
filters.
<?php\n // a query against the game endpoint with a second true parameter\n // note the second boolean true parameter\n $igdb->game(\"fields id,name; where id = (1,2);\", true);\n\n?>\n
\nThe result of the query above:
\nobject(stdClass)[3]\n public 'count' => int 2\n
\nThe result object's properties will vary depending on the provided field list in the $query
. From the example result above you can see, the result holds an array, containing two elements. Every element of the result array is an object, containing properties with name of the fields from the fields
parameter.
A utility class to help with some tasks.
\n\n"},"icon":"fa-tools","overview":"Utility tools for making the job easier with the IGDB API","meta":{"revision":0,"created":1670105056947,"version":0},"$loki":79},{"id":"ed871fa","slug":"authenticate","level":2,"parent":"120f8ce","parents":["120f8ce"],"title":"Authenticate","date":null,"timestamp":null,"body":{"stripped":"A helper method to generate your access_token. This method will send a post request to the Twitch API with your client_id and client_secret.\n\nParameters:\n\n$client_id: your client id\n\n$client_secret: the client secret generated by twitch\n\nRetunrs: an object decoded from the response from the Twitch API containing three keys: access_token, expires_in and token_type.\n\nIf a non-successful response is recieved from Twitch, an Exception is thrown.\n\n\n\nThe output of the method will contain your new access_token:","markdown":"```php\npublic static function authenticate(string $client_id, string $client_secret) throws Exception: object\n```\n\nA helper method to generate your `access_token`. This method will send a post request to the Twitch API with your `client_id` and `client_secret`.\n\n**Parameters**:\n - `$client_id`: your client id\n - `$client_secret`: the client secret generated by twitch\n\n**Retunrs**: an object decoded from the response from the Twitch API containing three keys: `access_token`, `expires_in` and `token_type`.\n\nIf a non-successful response is recieved from Twitch, an `Exception` is thrown.\n\n```php\ngetMessage();\n }\n\n?>\n```\n\nThe output of the method will contain your new `access_token`:\n\n```text\nobject(stdClass)[1]\n public 'access_token' => string 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' (length=30)\n public 'expires_in' => int 5269900\n public 'token_type' => string 'bearer' (length=6)\n```","html":"The methods in this class are static, therefore you can use them with the double colon syntax.
\n
public static function authenticate(string $client_id, string $client_secret) throws Exception: object\n
\nA helper method to generate your access_token
. This method will send a post request to the Twitch API with your client_id
and client_secret
.
Parameters:
\n$client_id
: your client id$client_secret
: the client secret generated by twitchRetunrs: an object decoded from the response from the Twitch API containing three keys: access_token
, expires_in
and token_type
.
If a non-successful response is recieved from Twitch, an Exception
is thrown.
<?php\n\n require_once \"class.igdb.php\";\n\n try {\n var_dump(IGDBUtils::authenticate(\"{client_id}\", \"{client_secret}\"));\n } catch (Exception $e) {\n // something went wrong\n echo $e->getMessage();\n }\n\n?>\n
\nThe output of the method will contain your new access_token
:
object(stdClass)[1]\n public 'access_token' => string 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' (length=30)\n public 'expires_in' => int 5269900\n public 'token_type' => string 'bearer' (length=6)\n
"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":80},{"id":"38a7e63","slug":"image-url","level":2,"parent":"120f8ce","parents":["120f8ce"],"title":"Image URL","date":null,"timestamp":null,"body":{"stripped":"Get the URL of a specific sized image for a record.\n\nParameters:\n\n$image_id: the image_id of the image. Each image in the database has it's own id and image_id fields. You must use the image_id field!\n\n$size: the required size. Possible sizes:\n\ncover_small\n\ncover_small\\_2x\n\nscreenshot_med\n\nscreenshot_med\\_2x\n\ncover_big\n\ncover_big\\_2x\n\nlogo_med\n\nlogo_med\\_2x\n\nscreenshot_big\n\nscreenshot_big\\_2x\n\nscreenshot_huge\n\nscreenshot_huge\\_2x\n\nthumb\n\nthumb\\_2x\n\nmicro\n\nmicro\\_2x\n\n720p\n\n720p\\_2x\n\n1080p\n\n1080p\\_2x\n\nIf an invalid second parameter is passed, an IGDBInvalidParameterException will be thrown.\n\n\n\nThe script above will produce the output below:\n\n\n\nOn the last line you can see the 720p version of the image which is a valid url.","markdown":"```php\npublic static function image_url(string $image_id, string $size) throws IGDBInvalidParameterException: string\n```\n\nGet the URL of a specific sized image for a record.\n\n**Parameters**:\n - `$image_id`: the `image_id` of the image. Each image in the database has it's own `id` and `image_id` fields. You **must** use the `image_id` field!\n - `$size`: the required size. Possible sizes:\n - cover_small\n - cover_small_2x\n - screenshot_med\n - screenshot_med_2x\n - cover_big\n - cover_big_2x\n - logo_med\n - logo_med_2x\n - screenshot_big\n - screenshot_big_2x\n - screenshot_huge\n - screenshot_huge_2x\n - thumb\n - thumb_2x\n - micro\n - micro_2x\n - 720p\n - 720p_2x\n - 1080p\n - 1080p_2x\n\nIf an invalid second parameter is passed, an `IGDBInvalidParameterException` will be thrown.\n\n```php\ngame(\n $builder\n ->fields(\"id, name, artworks.*\")\n ->search(\"uncharted 4\")\n ->limit(1)\n ->build()\n );\n\n var_dump($result);\n\n // processing the first result's first artwork\n echo \"720p version: \" . IGDBUtils::image_url($result[0]->artworks[0]->image_id, \"720p\");\n } catch (IGDBInvalidParameterException $e) {\n // invalid parameter passed to the builder\n echo $e->getMessage();\n } catch (IGDBEndpointException $e) {\n // failed query\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe script above will produce the output below:\n\n```text\narray (size=1)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 7331\n public 'artworks' =>\n array (size=5)\n 0 =>\n object(stdClass)[4]\n public 'id' => int 6303\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1059\n public 'image_id' => string 'ar4v3' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v3.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string 'ded76617-94df-a813-28cb-feffebeb9d36' (length=36)\n 1 =>\n object(stdClass)[5]\n public 'id' => int 6304\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1059\n public 'image_id' => string 'ar4v4' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v4.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string '5655acde-a94d-8aa5-8c35-2ef4bc2e965d' (length=36)\n 2 =>\n object(stdClass)[6]\n public 'id' => int 6305\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1060\n public 'image_id' => string 'ar4v5' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v5.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string '30441489-b264-70d7-2d26-86b7c1eb3d3a' (length=36)\n 3 =>\n object(stdClass)[7]\n public 'id' => int 6306\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1060\n public 'image_id' => string 'ar4v6' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v6.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string 'e8629a83-2452-ec8c-2388-f42c6ec21de5' (length=36)\n 4 =>\n object(stdClass)[8]\n public 'id' => int 6307\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1060\n public 'image_id' => string 'ar4v7' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v7.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string 'e0b49da1-76dd-a863-b499-30b7f0ae0c78' (length=36)\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n720p version: https://images.igdb.com/igdb/image/upload/t_720p/ar4v3.jpg\n```\n\nOn the last line you can see the 720p version of the image which is a valid url.","html":"public static function image_url(string $image_id, string $size) throws IGDBInvalidParameterException: string\n
\nGet the URL of a specific sized image for a record.
\nParameters:
\n$image_id
: the image_id
of the image. Each image in the database has it's own id
and image_id
fields. You must use the image_id
field!$size
: the required size. Possible sizes:\nIf an invalid second parameter is passed, an IGDBInvalidParameterException
will be thrown.
<?php\n\n require_once \"class.igdb.php\";\n\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n $builder = new IGDBQueryBuilder();\n\n try {\n $result = $igdb->game(\n $builder\n ->fields(\"id, name, artworks.*\")\n ->search(\"uncharted 4\")\n ->limit(1)\n ->build()\n );\n\n var_dump($result);\n\n // processing the first result's first artwork\n echo \"720p version: \" . IGDBUtils::image_url($result[0]->artworks[0]->image_id, \"720p\");\n } catch (IGDBInvalidParameterException $e) {\n // invalid parameter passed to the builder\n echo $e->getMessage();\n } catch (IGDBEndpointException $e) {\n // failed query\n echo $e->getMessage();\n }\n\n?>\n
\nThe script above will produce the output below:
\narray (size=1)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 7331\n public 'artworks' =>\n array (size=5)\n 0 =>\n object(stdClass)[4]\n public 'id' => int 6303\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1059\n public 'image_id' => string 'ar4v3' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v3.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string 'ded76617-94df-a813-28cb-feffebeb9d36' (length=36)\n 1 =>\n object(stdClass)[5]\n public 'id' => int 6304\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1059\n public 'image_id' => string 'ar4v4' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v4.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string '5655acde-a94d-8aa5-8c35-2ef4bc2e965d' (length=36)\n 2 =>\n object(stdClass)[6]\n public 'id' => int 6305\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1060\n public 'image_id' => string 'ar4v5' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v5.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string '30441489-b264-70d7-2d26-86b7c1eb3d3a' (length=36)\n 3 =>\n object(stdClass)[7]\n public 'id' => int 6306\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1060\n public 'image_id' => string 'ar4v6' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v6.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string 'e8629a83-2452-ec8c-2388-f42c6ec21de5' (length=36)\n 4 =>\n object(stdClass)[8]\n public 'id' => int 6307\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1060\n public 'image_id' => string 'ar4v7' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v7.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string 'e0b49da1-76dd-a863-b499-30b7f0ae0c78' (length=36)\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n720p version: https://images.igdb.com/igdb/image/upload/t_720p/ar4v3.jpg\n
\nOn the last line you can see the 720p version of the image which is a valid url.
"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":81},{"id":"7c0fcd6","slug":"examples","level":1,"parent":null,"parents":[],"title":"Examples","date":null,"timestamp":1669925801000,"body":{"stripped":"The examples in this section will try to cover most of the use cases of the wrapper.\n\n:tip To see your own tokens in the example codes set them up on the home page as described in Using the documentation section!","markdown":"The examples in this section will try to cover most of the use cases of the wrapper.\n\n>:tip To see your own tokens in the example codes set them up on the home page as described in [Using the documentation section](#using-the-documentation)!","html":"The examples in this section will try to cover most of the use cases of the wrapper.
\n\n"},"icon":"fa-code","overview":"Working examples, covering most of the functionalities of the wrapper","meta":{"revision":0,"created":1670105056947,"version":0},"$loki":82},{"id":"c892c4b","slug":"basic-example","level":2,"parent":"7c0fcd6","parents":["7c0fcd6"],"title":"Basic Example","date":null,"timestamp":null,"body":{"stripped":"A basic example to send your apicalypse query to the IGDB API.\n\nMake sure to place your endpoint method calls in a try...catch block to be able to catch errors!\n\nCode\n\n\n\nResult","markdown":"A basic example to send your apicalypse query to the IGDB API.\n\n> Make sure to place your [endpoint method](#endpoints) calls in a try...catch block to be able to catch errors!\n\n**Code**\n\n```php\ngame($query);\n\n // showing the results\n var_dump($games);\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n```\n\n**Result**\n\n```text\narray (size=5)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 125062\n public 'cover' => int 83686\n public 'name' => string 'Uncharted Ocean: Set Sail' (length=25)\n 1 =>\n object(stdClass)[4]\n public 'id' => int 19583\n public 'cover' => int 15883\n public 'name' => string 'Uncharted: Fight for Fortune' (length=28)\n 2 =>\n object(stdClass)[5]\n public 'id' => int 26193\n public 'cover' => int 85149\n public 'name' => string 'Uncharted: The Lost Legacy' (length=26)\n 3 =>\n object(stdClass)[6]\n public 'id' => int 19609\n public 'cover' => int 85164\n public 'name' => string 'Uncharted: Fortune Hunter' (length=25)\n 4 =>\n object(stdClass)[7]\n public 'id' => int 7331\n public 'cover' => int 81917\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n```","html":":tip To see your own tokens in the example codes set them up on the home page as described in Using the documentation section!
\n
A basic example to send your apicalypse query to the IGDB API.
\n\n\nMake sure to place your endpoint method calls in a try...catch block to be able to catch errors!
\n
Code
\n<?php\n\n // importing the wrapper\n require 'class.igdb.php';\n\n // instantiating the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // your query string\n $query = 'search \"uncharted\"; fields id,name,cover; limit 5; offset 10;';\n\n try {\n // executing the query\n $games = $igdb->game($query);\n\n // showing the results\n var_dump($games);\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n
\nResult
\narray (size=5)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 125062\n public 'cover' => int 83686\n public 'name' => string 'Uncharted Ocean: Set Sail' (length=25)\n 1 =>\n object(stdClass)[4]\n public 'id' => int 19583\n public 'cover' => int 15883\n public 'name' => string 'Uncharted: Fight for Fortune' (length=28)\n 2 =>\n object(stdClass)[5]\n public 'id' => int 26193\n public 'cover' => int 85149\n public 'name' => string 'Uncharted: The Lost Legacy' (length=26)\n 3 =>\n object(stdClass)[6]\n public 'id' => int 19609\n public 'cover' => int 85164\n public 'name' => string 'Uncharted: Fortune Hunter' (length=25)\n 4 =>\n object(stdClass)[7]\n public 'id' => int 7331\n public 'cover' => int 81917\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n
"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":83},{"id":"e6c295d","slug":"using-the-query-builder","level":2,"parent":"7c0fcd6","parents":["7c0fcd6"],"title":"Using the Query Builder","date":null,"timestamp":null,"body":{"stripped":"An example to see how to use the IGDB Query Builder to build the query strings.\n\nMake sure to place your query builder configuration and endpoint method calls in a try...catch block to be able to catch errors!\n\nCode\n\n\n\nResult","markdown":"An example to see how to use the [IGDB Query Builder](#igdb-query-builder) to build the query strings.\n\n> Make sure to place your [query builder configuration](#configuring-methods) and [endpoint method](#endpoints) calls in a try...catch block to be able to catch errors!\n\n**Code**\n\n```php\nsearch(\"uncharted\")\n // we want to see these fields in the results\n ->fields(\"id, name, cover\")\n // we only need maximum 5 results per query (pagination)\n ->limit(5)\n // we would like to show the third page; fetch the results from the tenth element (pagination)\n ->offset(10)\n // process the configuration and return a string\n ->build();\n\n // executing the query\n $games = $igdb->game($query);\n\n // showing the results\n var_dump($games);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n```\n\n**Result**\n\n```text\narray (size=5)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 125062\n public 'cover' => int 83686\n public 'name' => string 'Uncharted Ocean: Set Sail' (length=25)\n 1 =>\n object(stdClass)[4]\n public 'id' => int 19583\n public 'cover' => int 15883\n public 'name' => string 'Uncharted: Fight for Fortune' (length=28)\n 2 =>\n object(stdClass)[5]\n public 'id' => int 26193\n public 'cover' => int 85149\n public 'name' => string 'Uncharted: The Lost Legacy' (length=26)\n 3 =>\n object(stdClass)[6]\n public 'id' => int 19609\n public 'cover' => int 85164\n public 'name' => string 'Uncharted: Fortune Hunter' (length=25)\n 4 =>\n object(stdClass)[7]\n public 'id' => int 7331\n public 'cover' => int 81917\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n```","html":"An example to see how to use the IGDB Query Builder to build the query strings.
\n\n\nMake sure to place your query builder configuration and endpoint method calls in a try...catch block to be able to catch errors!
\n
Code
\n<?php\n\n // importing the wrapper\n require 'class.igdb.php';\n\n // instantiating the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // building the query\n $query = $builder\n // searching for games LIKE uncharted\n ->search(\"uncharted\")\n // we want to see these fields in the results\n ->fields(\"id, name, cover\")\n // we only need maximum 5 results per query (pagination)\n ->limit(5)\n // we would like to show the third page; fetch the results from the tenth element (pagination)\n ->offset(10)\n // process the configuration and return a string\n ->build();\n\n // executing the query\n $games = $igdb->game($query);\n\n // showing the results\n var_dump($games);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n
\nResult
\narray (size=5)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 125062\n public 'cover' => int 83686\n public 'name' => string 'Uncharted Ocean: Set Sail' (length=25)\n 1 =>\n object(stdClass)[4]\n public 'id' => int 19583\n public 'cover' => int 15883\n public 'name' => string 'Uncharted: Fight for Fortune' (length=28)\n 2 =>\n object(stdClass)[5]\n public 'id' => int 26193\n public 'cover' => int 85149\n public 'name' => string 'Uncharted: The Lost Legacy' (length=26)\n 3 =>\n object(stdClass)[6]\n public 'id' => int 19609\n public 'cover' => int 85164\n public 'name' => string 'Uncharted: Fortune Hunter' (length=25)\n 4 =>\n object(stdClass)[7]\n public 'id' => int 7331\n public 'cover' => int 81917\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n
"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":84},{"id":"4dc1f8f","slug":"query-builder-with-options","level":2,"parent":"7c0fcd6","parents":["7c0fcd6"],"title":"Query Builder with Options","date":null,"timestamp":null,"body":{"stripped":"The IGDB Query Builder still supports the legacy $options array to parameterize the query.\n\n:warning Using the Builder this way is not recommended as this functionality may be removed in future versions. Use the builder approach instead.\n\nCode\n\n\n\nResult","markdown":"The [IGDB Query Builder](#igdb-query-builder) still supports the legacy `$options` array to parameterize the query.\n\n>:warning Using the Builder this way is not recommended as this functionality may be removed in future versions. Use the [builder approach](#builder-approach) instead.\n\n**Code**\n\n```php\n \"uncharted\",\n // we want to see these fields in the results\n \"fields\" => array(\"id\", \"name\", \"cover\"),\n // we only need maximum 5 results per query (pagination)\n \"limit\" => 5,\n // we would like to show the third page; fetch the results from the tenth element (pagination)\n \"offset\" => 10\n );\n\n try {\n // adding your $options array with the options method\n $builder->options($options);\n\n // building the query\n $query = $builder->build();\n\n // executing the query\n $games = $igdb->game($query);\n\n // showing the results\n var_dump($games);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n```\n\n**Result**\n\n```text\narray (size=5)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 125062\n public 'cover' => int 83686\n public 'name' => string 'Uncharted Ocean: Set Sail' (length=25)\n 1 =>\n object(stdClass)[4]\n public 'id' => int 19583\n public 'cover' => int 15883\n public 'name' => string 'Uncharted: Fight for Fortune' (length=28)\n 2 =>\n object(stdClass)[5]\n public 'id' => int 26193\n public 'cover' => int 85149\n public 'name' => string 'Uncharted: The Lost Legacy' (length=26)\n 3 =>\n object(stdClass)[6]\n public 'id' => int 19609\n public 'cover' => int 85164\n public 'name' => string 'Uncharted: Fortune Hunter' (length=25)\n 4 =>\n object(stdClass)[7]\n public 'id' => int 7331\n public 'cover' => int 81917\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n```","html":"The IGDB Query Builder still supports the legacy $options
array to parameterize the query.
\n\n:warning Using the Builder this way is not recommended as this functionality may be removed in future versions. Use the builder approach instead.
\n
Code
\n<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiating the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // instantiating the builder\n $builder = new IGDBQueryBuilder();\n\n // creating the options array\n $options = array(\n // searching for games LIKE uncharted\n \"search\" => \"uncharted\",\n // we want to see these fields in the results\n \"fields\" => array(\"id\", \"name\", \"cover\"),\n // we only need maximum 5 results per query (pagination)\n \"limit\" => 5,\n // we would like to show the third page; fetch the results from the tenth element (pagination)\n \"offset\" => 10\n );\n\n try {\n // adding your $options array with the options method\n $builder->options($options);\n\n // building the query\n $query = $builder->build();\n\n // executing the query\n $games = $igdb->game($query);\n\n // showing the results\n var_dump($games);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n
\nResult
\narray (size=5)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 125062\n public 'cover' => int 83686\n public 'name' => string 'Uncharted Ocean: Set Sail' (length=25)\n 1 =>\n object(stdClass)[4]\n public 'id' => int 19583\n public 'cover' => int 15883\n public 'name' => string 'Uncharted: Fight for Fortune' (length=28)\n 2 =>\n object(stdClass)[5]\n public 'id' => int 26193\n public 'cover' => int 85149\n public 'name' => string 'Uncharted: The Lost Legacy' (length=26)\n 3 =>\n object(stdClass)[6]\n public 'id' => int 19609\n public 'cover' => int 85164\n public 'name' => string 'Uncharted: Fortune Hunter' (length=25)\n 4 =>\n object(stdClass)[7]\n public 'id' => int 7331\n public 'cover' => int 81917\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n
"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":85},{"id":"a423327","slug":"counting-results","level":2,"parent":"7c0fcd6","parents":["7c0fcd6"],"title":"Counting Results","date":null,"timestamp":null,"body":{"stripped":"An example to count the matched records.\n\nWhen true is passed as the second parameter, the return value will be an object with a single property called count. For more details on the return values of the endpoint methods please refer to the return values section.\n\nCode\n\n\n\nResult","markdown":"An example to count the matched records.\n\n> When `true` is passed as the second parameter, the return value will be an object with a single property called `count`. For more details on the return values of the endpoint methods please refer to the [return values section](#return-values).\n\n**Code**\n\n```php\nwhere(\n array(\n 'field' => 'rating',\n 'postfix' => '>',\n 'value' => 75\n )\n )\n // process the configuration and return a string\n ->build();\n\n // executing the query\n // note the second true parameter\n $game_count = $igdb->game($query, true);\n\n // showing the results\n var_dump($game_count);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n```\n\n**Result**\n\n```text\nobject(stdClass)[3]\n public 'count' => int 8081\n```","html":"An example to count the matched records.
\n\n\nWhen
\ntrue
is passed as the second parameter, the return value will be an object with a single property calledcount
. For more details on the return values of the endpoint methods please refer to the return values section.
Code
\n<?php\n\n // importing the wrapper\n require 'class.igdb.php';\n\n // instantiating the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // building the query\n $query = $builder\n // setting a filter to fetch games with rating greater than 75\n ->where(\n array(\n 'field' => 'rating',\n 'postfix' => '>',\n 'value' => 75\n )\n )\n // process the configuration and return a string\n ->build();\n\n // executing the query\n // note the second true parameter\n $game_count = $igdb->game($query, true);\n\n // showing the results\n var_dump($game_count);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n
\nResult
\nobject(stdClass)[3]\n public 'count' => int 8081\n
"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":86},{"id":"cca5fdc","slug":"expander","level":2,"parent":"7c0fcd6","parents":["7c0fcd6"],"title":"Expander","date":null,"timestamp":null,"body":{"stripped":"Some fields are actually ids pointing to other endpoints. The expander feature is a convenient way to go into these other endpoints and access more information from them in the same query, instead of having to do multiple queries.\n\nCode\n\n\n\nResult","markdown":"Some fields are actually ids pointing to other endpoints. The expander feature is a convenient way to go into these other endpoints and access more information from them in the same query, instead of having to do multiple queries.\n\n**Code**\n\n```php\nid(array(1,2))\n // fields can be expanded with a dot followed by the fields you want to access from a certain endpoint\n ->fields(array(\"name\", \"themes.url\", \"themes.name\"))\n // process the configuration and return a string\n ->build();\n\n // executing the query\n $game_count = $igdb->game($query);\n\n // showing the results\n var_dump($game_count);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n```\n\n**Result**\n\n```text\narray (size=2)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 1\n public 'name' => string 'Thief II: The Metal Age' (length=23)\n public 'themes' =>\n array (size=3)\n 0 =>\n object(stdClass)[4]\n public 'id' => int 1\n public 'name' => string 'Action' (length=6)\n public 'url' => string 'https://www.igdb.com/themes/action' (length=34)\n 1 =>\n object(stdClass)[5]\n public 'id' => int 17\n public 'name' => string 'Fantasy' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/fantasy' (length=35)\n 2 =>\n object(stdClass)[6]\n public 'id' => int 23\n public 'name' => string 'Stealth' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/stealth' (length=35)\n 1 =>\n object(stdClass)[7]\n public 'id' => int 2\n public 'name' => string 'Thief: The Dark Project' (length=23)\n public 'themes' =>\n array (size=3)\n 0 =>\n object(stdClass)[8]\n public 'id' => int 1\n public 'name' => string 'Action' (length=6)\n public 'url' => string 'https://www.igdb.com/themes/action' (length=34)\n 1 =>\n object(stdClass)[9]\n public 'id' => int 17\n public 'name' => string 'Fantasy' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/fantasy' (length=35)\n 2 =>\n object(stdClass)[10]\n public 'id' => int 23\n public 'name' => string 'Stealth' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/stealth' (length=35)\n```","html":"Some fields are actually ids pointing to other endpoints. The expander feature is a convenient way to go into these other endpoints and access more information from them in the same query, instead of having to do multiple queries.
\nCode
\n<?php\n\n // importing the wrapper\n require 'class.igdb.php';\n\n // instantiating the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // building the query\n $query = $builder\n // fetching the first 2 games by id 1 and 2\n ->id(array(1,2))\n // fields can be expanded with a dot followed by the fields you want to access from a certain endpoint\n ->fields(array(\"name\", \"themes.url\", \"themes.name\"))\n // process the configuration and return a string\n ->build();\n\n // executing the query\n $game_count = $igdb->game($query);\n\n // showing the results\n var_dump($game_count);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n
\nResult
\narray (size=2)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 1\n public 'name' => string 'Thief II: The Metal Age' (length=23)\n public 'themes' =>\n array (size=3)\n 0 =>\n object(stdClass)[4]\n public 'id' => int 1\n public 'name' => string 'Action' (length=6)\n public 'url' => string 'https://www.igdb.com/themes/action' (length=34)\n 1 =>\n object(stdClass)[5]\n public 'id' => int 17\n public 'name' => string 'Fantasy' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/fantasy' (length=35)\n 2 =>\n object(stdClass)[6]\n public 'id' => int 23\n public 'name' => string 'Stealth' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/stealth' (length=35)\n 1 =>\n object(stdClass)[7]\n public 'id' => int 2\n public 'name' => string 'Thief: The Dark Project' (length=23)\n public 'themes' =>\n array (size=3)\n 0 =>\n object(stdClass)[8]\n public 'id' => int 1\n public 'name' => string 'Action' (length=6)\n public 'url' => string 'https://www.igdb.com/themes/action' (length=34)\n 1 =>\n object(stdClass)[9]\n public 'id' => int 17\n public 'name' => string 'Fantasy' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/fantasy' (length=35)\n 2 =>\n object(stdClass)[10]\n public 'id' => int 23\n public 'name' => string 'Stealth' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/stealth' (length=35)\n
"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":87},{"id":"25c7cc2","slug":"multiquery-ii","level":2,"parent":"7c0fcd6","parents":["7c0fcd6"],"title":"MultiQuery","date":null,"timestamp":null,"body":{"stripped":"Using multiquery multiple queries can be executed against the IGDB database using a single query. The multiquery method expects an array of multiquery query strings.\n\n:info Using the build method with a boolean true parameter, a query will be returned with a multiquery syntax.\n\nCode\n\n\n\nResult","markdown":"Using multiquery multiple queries can be executed against the IGDB database using a single query. The multiquery method expects an array of multiquery query strings.\n\n>:info Using the [`build`](#building-the-query) method with a boolean `true` parameter, a query will be returned with a multiquery syntax.\n\n**Code**\n\n```php\nname(\"Main Game\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\");\n\n // configuring the bundle query\n $bundle\n ->name(\"Bundles\")\n ->endpoint(\"game\")\n ->fields(\"id,name,version_parent,category\")\n ->where(\"version_parent = 25076\")\n ->where(\"category = 0\");\n\n var_dump(\n $igdb->multiquery(\n array(\n $main->build(true),\n $bundle->build(true)\n )\n )\n );\n } catch (IGDBInvaliParameterException $e) {\n // a builder property is invalid\n echo $e->getMessage();\n } catch (IGDBEndpointException $e) {\n // something went wront with the query\n echo $e->getMessage();\n }\n?>\n```\n\n**Result**\n\n```text\narray (size=2)\n 0 =>\n object(stdClass)[4]\n public 'name' => string 'Main Game' (length=9)\n public 'result' =>\n array (size=1)\n 0 =>\n object(stdClass)[5]\n public 'id' => int 25076\n public 'name' => string 'Red Dead Redemption 2' (length=21)\n 1 =>\n object(stdClass)[6]\n public 'name' => string 'Bundles' (length=7)\n public 'result' =>\n array (size=3)\n 0 =>\n object(stdClass)[7]\n public 'id' => int 103205\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Special Edition' (length=38)\n public 'version_parent' => int 25076\n 1 =>\n object(stdClass)[8]\n public 'id' => int 103207\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Collector's Box' (length=38)\n public 'version_parent' => int 25076\n 2 =>\n object(stdClass)[9]\n public 'id' => int 103206\n public 'category' => int 0\n public 'name' => string 'Red dead Redemption 2: Ultimate Edition' (length=39)\n public 'version_parent' => int 25076\n```","html":"Using multiquery multiple queries can be executed against the IGDB database using a single query. The multiquery method expects an array of multiquery query strings.
\n\n\n:info Using the
\nbuild
method with a booleantrue
parameter, a query will be returned with a multiquery syntax.
Code
\n<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // query builder for the main game\n $main = new IGDBQueryBuilder();\n\n // query builder for the bundles\n $bundle = new IGDBQueryBuilder();\n\n try {\n // configuring the main query\n $main\n ->name(\"Main Game\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\");\n\n // configuring the bundle query\n $bundle\n ->name(\"Bundles\")\n ->endpoint(\"game\")\n ->fields(\"id,name,version_parent,category\")\n ->where(\"version_parent = 25076\")\n ->where(\"category = 0\");\n\n var_dump(\n $igdb->multiquery(\n array(\n $main->build(true),\n $bundle->build(true)\n )\n )\n );\n } catch (IGDBInvaliParameterException $e) {\n // a builder property is invalid\n echo $e->getMessage();\n } catch (IGDBEndpointException $e) {\n // something went wront with the query\n echo $e->getMessage();\n }\n?>\n
\nResult
\narray (size=2)\n 0 =>\n object(stdClass)[4]\n public 'name' => string 'Main Game' (length=9)\n public 'result' =>\n array (size=1)\n 0 =>\n object(stdClass)[5]\n public 'id' => int 25076\n public 'name' => string 'Red Dead Redemption 2' (length=21)\n 1 =>\n object(stdClass)[6]\n public 'name' => string 'Bundles' (length=7)\n public 'result' =>\n array (size=3)\n 0 =>\n object(stdClass)[7]\n public 'id' => int 103205\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Special Edition' (length=38)\n public 'version_parent' => int 25076\n 1 =>\n object(stdClass)[8]\n public 'id' => int 103207\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Collector's Box' (length=38)\n public 'version_parent' => int 25076\n 2 =>\n object(stdClass)[9]\n public 'id' => int 103206\n public 'category' => int 0\n public 'name' => string 'Red dead Redemption 2: Ultimate Edition' (length=39)\n public 'version_parent' => int 25076\n
"},"meta":{"revision":0,"created":1670105056947,"version":0},"$loki":88},{"id":"74d88cc","slug":"change-log","level":1,"parent":null,"parents":[],"title":"Change Log","date":null,"timestamp":1650388071000,"body":{"stripped":"","markdown":"","html":""},"icon":"fa-clipboard-list","overview":"Changes, updates, notes.","meta":{"revision":0,"created":1670105056947,"version":0},"$loki":89},{"id":"797e68c","slug":"v4-3-1---april-19--2022","level":2,"parent":"74d88cc","parents":["74d88cc"],"title":"v4.3.1 - April 19, 2022","date":null,"timestamp":null,"body":{"stripped":"IGDBEndpointException\n\nAdded a getResponseCode() to fetch http response code from IGDB API\n\nAdded sections to the documentation:\n\nHandling Errors\n\nHandling Builder Errors\n\nHandling Request Errors","markdown":"- IGDBEndpointException\n - Added a `getResponseCode()` to fetch http response code from IGDB API\n - Added sections to the documentation:\n - [Handling Errors](#handling-errors)\n - [Handling Builder Errors](#handling-builder-errors)\n - [Handling Request Errors](#handling-request-errors)","html":"getResponseCode()
to fetch http response code from IGDB API$options
array parsing to the options()
methodreset()
method added$options
arrayIGDBEndpointException
and IGDBInvalidParameterException
classes$options
, only apicalypse query stringsIGDB::api_status()
method_init_curl() => _curl_init()
close_curl() => curl_close()
reinit_curl() => curl_reinit()
where
filter (#6 Issues with slug field)_construct_url
expander
parameterfilter
to where
order
to sort
_stringify_options
_construct_url
count
custom_query
apicalypse
api_status
$execute
, added $count
)public IGDB::get_request_info()
public method addedWelcome to the IGDB Wrapper documentation! This documentation will cover all of the functionalities of this wrapper with lots of example codes. To personalise these codes you can add your own tokens to this documentation on the main page (click on the logo in the top left corner to go back). This way every code example where the tokens are required will contain your own tokens.
\nThe wrapper's main purpose is to provide a simple solution to fetch data from IGDB's database using PHP. The wrapper contains endpoint methods for every IGDB API endpoints and even more!
\nTo have access to IGDB's database you have to register a Twitch Account and have your own client_id
and access_token
. Refer to the Account Creation and Authentication sections of the IGDB API Documentation for details.
The documentation contains a lot of copy-paste example codes. In most cases, the code snippets contains the instantiation of the IGDB
class. The constructor of this class will require you to pass your client_id
and access_token
. If you would like to have example codes with your personal tokens you can provide these on the front page of the documentation. To get back to the main page, just click the logo on the top left corner.
Clicking the link will open the window where you can see additional information about this feature and two fields where you can store your tokens.
\n\n\n\nIf you chose to save the tokens these will be stored only in your browser locally! If the tokens are not saved the data will be erased when your browser is closed.
\n
After your tokens are set the example codes will contain your tokens which are ready to copy.
\n\nIf you want to delete your tokens you can click the Delete the tokens button anytime.
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":2},{"id":"2ec46b5","slug":"setting-up-your-project","level":2,"parent":"647454e","parents":["647454e"],"title":"Setting up your project","date":null,"timestamp":null,"body":{"stripped":"The project has multiple PHP files which are in the src folder of the repository:\n\nIGDB.php: the IGDB wrapper itself\n\nIGDBEndpointException.php: an exception thrown by the IGDB wrapper endpoint methods\n\nIGDBInvalidParameterException.php: an exception thrown by the Query Builder configuring methods\n\nIGDBQueryBuilder.php: the Query Builder\n\nIGDBUtil.php: utility and helper methods\n\nThese files can be imported one-by-one but it is highly recommended to import the class.igdb.php file which handles all the imports for you.\n\n\n\nAfter the import, you are ready to use the wrapper.\n\n:warning If you decide to import the files separately, make sure to check the source code since the exception classes are imported in the respective files where they are needed with hardcoded paths. The files has to be in the same folder to make it work!","markdown":"The project has multiple PHP files which are in the `src` folder of the repository:\n - **IGDB.php**: the IGDB wrapper itself\n - **IGDBEndpointException.php**: an exception thrown by the IGDB wrapper endpoint methods\n - **IGDBInvalidParameterException.php**: an exception thrown by the Query Builder configuring methods\n - **IGDBQueryBuilder.php**: the Query Builder\n - **IGDBUtil.php**: utility and helper methods\n\nThese files can be imported one-by-one but it is highly recommended to import the `class.igdb.php` file which handles all the imports for you.\n\n```php\n\n```\n\nAfter the import, you are ready to use the wrapper.\n\n>:warning If you decide to import the files separately, make sure to check the source code since the exception classes are imported in the respective files where they are needed with hardcoded paths. The files has to be in the same folder to make it work!","html":"The project has multiple PHP files which are in the src
folder of the repository:
These files can be imported one-by-one but it is highly recommended to import the class.igdb.php
file which handles all the imports for you.
<?php\n\n require_once \"class.igdb.php\";\n\n?>\n
\nAfter the import, you are ready to use the wrapper.
\n\n"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":3},{"id":"a1abe44","slug":"instantiating-the-wrapper","level":2,"parent":"647454e","parents":["647454e"],"title":"Instantiating the wrapper","date":null,"timestamp":null,"body":{"stripped":"The wrapper will need your client_id and generated access_token.\n\n\n\nThe wrapper itself does not validate your tokens. If your credentials are invalid you will get an IGDBEndpointException from the endpoint methods when you are sending your queries.","markdown":"The wrapper will need your `client_id` and [generated](https://api-docs.igdb.com/#authentication) `access_token`.\n\n```php\n\n```\n\n> The wrapper itself does not validate your tokens. If your credentials are invalid you will get an `IGDBEndpointException` from the [endpoint methods](#endpoints) when you are sending your queries.","html":":warning If you decide to import the files separately, make sure to check the source code since the exception classes are imported in the respective files where they are needed with hardcoded paths. The files has to be in the same folder to make it work!
\n
The wrapper will need your client_id
and generated access_token
.
<?php\n\n require_once \"class.igdb.php\";\n\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n?>\n
\n\n"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":4},{"id":"0e8132a","slug":"building-queries","level":2,"parent":"647454e","parents":["647454e"],"title":"Building Queries","date":null,"timestamp":null,"body":{"stripped":"There is a helper class to build apicalypse queries called IGDBQueryBuilder. With this class you can easily build parameterized queries.\n\n\n\nThe parameters in the above example are valid, so the $query variable will hold the valid apicalypse string.\n\n\n\nFor more details on the Query Builder refer to the IGDB Query Builder section of this documentation.","markdown":"There is a helper class to build apicalypse queries called [`IGDBQueryBuilder`](#igdb-query-builder). With this class you can easily build parameterized queries.\n\n```php\nsearch(\"uncharted 4\")\n ->fields(\"id, name\")\n ->limit(1)\n ->build();\n } catch (IGDBInvalidParameterException $e) {\n // Invalid argument passed to one of the methods\n echo $e->getMessage();\n }\n?>\n```\n\nThe parameters in the above example are valid, so the `$query` variable will hold the valid apicalypse string.\n\n```text\nfields id,name; search \"uncharted 4\"; limit 1;\n```\n\n> For more details on the Query Builder refer to the [IGDB Query Builder section](#igdb-query-builder) of this documentation.","html":"The wrapper itself does not validate your tokens. If your credentials are invalid you will get an
\nIGDBEndpointException
from the endpoint methods when you are sending your queries.
There is a helper class to build apicalypse queries called IGDBQueryBuilder
. With this class you can easily build parameterized queries.
<?php\n\n require_once \"class.igdb.php\";\n\n $builder = new IGDBQueryBuilder();\n\n try {\n $query = $builder\n ->search(\"uncharted 4\")\n ->fields(\"id, name\")\n ->limit(1)\n ->build();\n } catch (IGDBInvalidParameterException $e) {\n // Invalid argument passed to one of the methods\n echo $e->getMessage();\n }\n?>\n
\nThe parameters in the above example are valid, so the $query
variable will hold the valid apicalypse string.
fields id,name; search \"uncharted 4\"; limit 1;\n
\n\n"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":5},{"id":"5842ca1","slug":"sending-queries-to-igdb","level":2,"parent":"647454e","parents":["647454e"],"title":"Sending Queries to IGDB","date":null,"timestamp":null,"body":{"stripped":"When your $igdb object is created you can send your queries to the IGDB database right away. There are multiple endpoint methods which will allow you to fetch data from the respective IGDB Endpoint. These endpoint methods in the wrapper will accept apicalypse formatted query strings.\n\n\n\nSince the query is valid we have the $result array containing our matched records.\n\n\n\nFor more details on the IGDB Wrapper refer to the IGDB Wrapper section of this documentation.","markdown":"When your `$igdb` object is created you can send your queries to the IGDB database right away. There are multiple [endpoint methods](#endpoints) which will allow you to fetch data from the respective [IGDB Endpoint](https://api-docs.igdb.com/#endpoints). These endpoint methods in the wrapper will accept [apicalypse](https://api-docs.igdb.com/#apicalypse-1) formatted query strings.\n\n```php\ngame('search \"uncharted 4\"; fields id,name; limit 1;');\n } catch (IGDBEndpointException $e) {\n // Something went wrong, we have an error\n echo $e->getMessage();\n }\n\n?>\n```\n\nSince the query is valid we have the `$result` array containing our matched records.\n\n```text\narray (size=1)\n 0 =>\n object(stdClass)[2]\n public 'id' => int 7331\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n```\n\n> For more details on the IGDB Wrapper refer to the [IGDB Wrapper section](#igdb-wrapper) of this documentation.","html":"For more details on the Query Builder refer to the IGDB Query Builder section of this documentation.
\n
When your $igdb
object is created you can send your queries to the IGDB database right away. There are multiple endpoint methods which will allow you to fetch data from the respective IGDB Endpoint. These endpoint methods in the wrapper will accept apicalypse formatted query strings.
<?php\n\n require_once \"class.igdb.php\";\n\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n try {\n $result = $igdb->game('search \"uncharted 4\"; fields id,name; limit 1;');\n } catch (IGDBEndpointException $e) {\n // Something went wrong, we have an error\n echo $e->getMessage();\n }\n\n?>\n
\nSince the query is valid we have the $result
array containing our matched records.
array (size=1)\n 0 =>\n object(stdClass)[2]\n public 'id' => int 7331\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n
\n\n"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":6},{"id":"bf08719","slug":"handling-errors","level":2,"parent":"647454e","parents":["647454e"],"title":"Handling errors","date":null,"timestamp":null,"body":{"stripped":"There are two main type of errors which could occur when using the wrapper:\n\n\"local\" errors: when using the Query Builder to build your queries you may pass invalid parameters to the configuring methods. These methods could throw IGDBInvalidParameterException if an invalid parameter or invalid type of parameter is passed. Head to the Handling Builder Errors section to find out more.\n\n\"remote\" errors: when a query is sent to the IGDB API, but for some reason the query fails. This happens only, when a non-successful response code is recieved from the API. In this case the endpoint methods will throw an IGDBEndpointException. Head to the Handling Request Errors section to find out more.","markdown":"There are two main type of errors which could occur when using the wrapper:\n - **\"local\" errors**: when using the [Query Builder](#igdb-query-builder) to build your queries you may pass invalid parameters to the [configuring methods](#configuring-methods). These methods could throw `IGDBInvalidParameterException` if an invalid parameter or invalid type of parameter is passed. Head to the [Handling Builder Errors](#handling-builder-errors) section to find out more.\n\n - **\"remote\" errors**: when a query is sent to the IGDB API, but for some reason the query fails. This happens only, when a non-successful response code is recieved from the API. In this case the [endpoint methods](#endpoints) will throw an `IGDBEndpointException`. Head to the [Handling Request Errors](#handling-request-errors) section to find out more.","html":"For more details on the IGDB Wrapper refer to the IGDB Wrapper section of this documentation.
\n
There are two main type of errors which could occur when using the wrapper:
\n\"local\" errors: when using the Query Builder to build your queries you may pass invalid parameters to the configuring methods. These methods could throw IGDBInvalidParameterException
if an invalid parameter or invalid type of parameter is passed. Head to the Handling Builder Errors section to find out more.
\"remote\" errors: when a query is sent to the IGDB API, but for some reason the query fails. This happens only, when a non-successful response code is recieved from the API. In this case the endpoint methods will throw an IGDBEndpointException
. Head to the Handling Request Errors section to find out more.
This class is a helper class to help you construct your queries. If you have used this wrapper's eariler versions you were able to send queries by passing an $options
array directly to the endpoint methods. This possibility got removed and these endpoint methods are accepting only apicalypse formatted query strings.
\n"},"icon":"fa-hammer","overview":"Everything about the Query Builder. Configuring and building your queries.","meta":{"revision":0,"created":1699570565561,"version":0},"$loki":8},{"id":"b249413","slug":"instantiating-the-builder","level":2,"parent":"1bc2dc4","parents":["1bc2dc4"],"title":"Instantiating the Builder","date":null,"timestamp":null,"body":{"stripped":"To instantiate the Builder simply use the new keyword.\n\n\n\nNow the $builder object will expose every configuring methods to set up your query before building it.","markdown":"To instantiate the Builder simply use the `new` keyword.\n\n```php\n\n```\n\nNow the `$builder` object will expose every configuring methods to set up your query before [building it](#building-the-query).","html":":tip Using the Builder class is optional as you can pass your own queries to the endpoint methods.
\n
To instantiate the Builder simply use the new
keyword.
<?php\n\n require_once \"class.igdb.php\";\n\n $builer = new IGDBQueryBuiler();\n\n?>\n
\nNow the $builder
object will expose every configuring methods to set up your query before building it.
There are two ways to configure the builder.
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":10},{"id":"6488c7b","slug":"builder-approach","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","3da3bbd"],"title":"Builder approach","date":null,"timestamp":null,"body":{"stripped":"The Builder is using a builder pattern to configure itself with the configuring methods before parsing the properties to a query string. When every parameter is set, calling the build() method will start processing the parameters and will return the query string itself.\n\n:warning When using the builder approach, you must enclose your configuring methods in try...catch blocks. Read more on this in the Handling Builder Errors section.","markdown":"The Builder is using a builder pattern to configure itself with the [configuring methods](#configuring-methods) before parsing the properties to a query string. When every parameter is set, calling the [`build()`](#building-the-query) method will start processing the parameters and will return the query string itself.\n\n>:warning When using the builder approach, you must enclose your configuring methods in try...catch blocks. Read more on this in the [Handling Builder Errors](#handling-builder-errors) section.\n\n```php\nsearch(\"uncharted 4\")\n ->fields(\"id, name\")\n ->limit(1)\n // make sure to call the build method to parse the query string\n ->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid value passed to a method\n echo $e->getMessage();\n }\n\n?>\n```","html":"The Builder is using a builder pattern to configure itself with the configuring methods before parsing the properties to a query string. When every parameter is set, calling the build()
method will start processing the parameters and will return the query string itself.
\n\n:warning When using the builder approach, you must enclose your configuring methods in try...catch blocks. Read more on this in the Handling Builder Errors section.
\n
<?php\n\n require_once \"class.igdb.php\";\n\n $builder = new IGDBQueryBuilder();\n\n try {\n $query = $builder\n ->search(\"uncharted 4\")\n ->fields(\"id, name\")\n ->limit(1)\n // make sure to call the build method to parse the query string\n ->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid value passed to a method\n echo $e->getMessage();\n }\n\n?>\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":11},{"id":"0364192","slug":"traditional-approach","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","3da3bbd"],"title":"Traditional approach","date":null,"timestamp":null,"body":{"stripped":"To support the traditional approach of configuring the queries - the $options array - there is a method called options(). Passing your $options array to this method will process your parameters and will set up the builder.\n\n:warning Using the Builder this way is not recommended as this functionality may will be removed in future versions. Use the builder approach instead.","markdown":"To support the traditional approach of configuring the queries - the `$options` array - there is a method called [`options()`](#options). Passing your `$options` array to this method will process your parameters and will set up the builder.\n\n>:warning Using the Builder this way is not recommended as this functionality may will be removed in future versions. Use the [builder approach](#builder-approach) instead.\n\n```php\n \"uncharted 4\",\n \"fields\" => \"id,name\",\n \"limit\" => 1\n );\n\n try {\n // pass your $options to the options method\n // then build the query\n $query = $builder->options($options)->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```","html":"To support the traditional approach of configuring the queries - the $options
array - there is a method called options()
. Passing your $options
array to this method will process your parameters and will set up the builder.
\n\n:warning Using the Builder this way is not recommended as this functionality may will be removed in future versions. Use the builder approach instead.
\n
<?php\n\n require_once \"class.igdb.php\";\n\n $builder = new IGDBQueryBuilder();\n\n $options = array(\n \"search\" => \"uncharted 4\",\n \"fields\" => \"id,name\",\n \"limit\" => 1\n );\n\n try {\n // pass your $options to the options method\n // then build the query\n $query = $builder->options($options)->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":12},{"id":"36c9e8f","slug":"handling-builder-errors","level":2,"parent":"1bc2dc4","parents":["1bc2dc4"],"title":"Handling Builder Errors","date":null,"timestamp":null,"body":{"stripped":"When an invalid parameter is passed to any of the configuring methods, an IGDBInvaliParameterException is thrown. To properly handle these errors, at least the configuring methods should be enclosed in a try...catch block. Calling the getMessage() method of the exception object will return the error message.\n\n\n\nThe script above will produce this output:\n\n\n\nIt is important to keep in mind, that this validation is happening \"locally\" on your server. The query builder can only validate the type of variables you pass, or it can validate against a list of predefined values that the API expects. For example, if the example above is altered like this:\n\n\n\nThe builder will not throw an exception as the method got a string, which is valid. The output of the script will be:\n\n\n\nThe field nonexistingfield does not exist on the game endpoint which will cause an error on the IGDB API. These errors has to be handled separately. Read more on this in the Handling Request Errors section.","markdown":"When an invalid parameter is passed to any of the [configuring methods](#configuring-methods), an `IGDBInvaliParameterException` is thrown. To properly handle these errors, at least the configuring methods should be enclosed in a try...catch block. Calling the `getMessage()` method of the exception object will return the error message.\n\n```php\nsearch(\"uncharted\")\n // passing an integer to the fields parameter is invalid\n // as this methods expects a string or an array of strings\n ->fields(1)\n ->build();\n\n echo $query;\n } catch (IGDBInvalidParameterException $e) {\n // catching the exception, printing the error message\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe script above will produce this output:\n\n```text\nInvalid type of parameter for fields! String or array of strings are expected, integer passed!\n```\n\nIt is important to keep in mind, that this validation is happening \"locally\" on your server. The query builder can only validate the type of variables you pass, or it can validate against a list of predefined values that the API expects. For example, if the example above is altered like this:\n\n```php\nsearch(\"uncharted\")\n // passing a field name that doesnt exist on the game endpoint\n ->fields(\"nonexistingfield\")\n ->build();\n\n // no exception thrown, printing the query string\n echo $query;\n } catch (IGDBInvalidParameterException $e) {\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe builder will not throw an exception as the method got a string, which is valid. The output of the script will be:\n\n```text\nfields nonexistingfield; search \"uncharted\";\n```\n\nThe field `nonexistingfield` does not exist on the `game` endpoint which will cause an error on the IGDB API. These errors has to be handled separately. Read more on this in the [Handling Request Errors](#handling-request-errors) section.","html":"When an invalid parameter is passed to any of the configuring methods, an IGDBInvaliParameterException
is thrown. To properly handle these errors, at least the configuring methods should be enclosed in a try...catch block. Calling the getMessage()
method of the exception object will return the error message.
<?php\n\n $builder = new IGDBQueryBuilder();\n\n try {\n $query = $builder\n ->search(\"uncharted\")\n // passing an integer to the fields parameter is invalid\n // as this methods expects a string or an array of strings\n ->fields(1)\n ->build();\n\n echo $query;\n } catch (IGDBInvalidParameterException $e) {\n // catching the exception, printing the error message\n echo $e->getMessage();\n }\n\n?>\n
\nThe script above will produce this output:
\nInvalid type of parameter for fields! String or array of strings are expected, integer passed!\n
\nIt is important to keep in mind, that this validation is happening \"locally\" on your server. The query builder can only validate the type of variables you pass, or it can validate against a list of predefined values that the API expects. For example, if the example above is altered like this:
\n<?php\n\n $builder = new IGDBQueryBuilder();\n\n try {\n $query = $builder\n ->search(\"uncharted\")\n // passing a field name that doesnt exist on the game endpoint\n ->fields(\"nonexistingfield\")\n ->build();\n\n // no exception thrown, printing the query string\n echo $query;\n } catch (IGDBInvalidParameterException $e) {\n echo $e->getMessage();\n }\n\n?>\n
\nThe builder will not throw an exception as the method got a string, which is valid. The output of the script will be:
\nfields nonexistingfield; search \"uncharted\";\n
\nThe field nonexistingfield
does not exist on the game
endpoint which will cause an error on the IGDB API. These errors has to be handled separately. Read more on this in the Handling Request Errors section.
The Builder class has its own configuring methods to set the parameters before building the query string. If any of these methods recieves an invalid argument they will throw an IGDBInvalidArgumentException
. Make sure to set these parameters in a try...catch block.
public function count(boolean $count = true) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nThis method will accept a boolean value. This parameter is processed in case of a multiquery build only. If this value is true
the response from IGDB will contain the number of records matching the filters. If false
the records will be returned.
\n\nIf the method is called without parameters, the value will be set to
\ntrue
.
Default value: by default this value is false
, the queries will return the records instead of their count.
Parameters:
\n$count
: true
if a record count is required, false
otherwise.Returns: IGDBQueryBuilder
instance
<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // Configuring the query\n $builder\n ->name(\"Number of games\")\n ->endpoint(\"game\")\n // the default value of count is false\n // to retrieve the count of the matched records, set it to true\n // ->count(true) has the same result\n ->count();\n\n // if you wish to remove the count parameter for any reason later on\n // you can call the count method with a false parameter\n // ->count(false)\n\n // building the query\n $query = $builder->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\nThe value of $query
:
query games/count \"Number of games\" {\n fields *;\n};\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":15},{"id":"81d2aed","slug":"custom-where","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Custom Where","date":null,"timestamp":null,"body":{"stripped":"This method will add a where statement to your query, but will not validate your input or throw any exceptions.\n\nParameters:\n\n$custom_where: an apicalypse string with a custom where statement\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function custom_where(string $custom_where): IGDBQueryBuilder\n```\n\nThis method will add a [where statement](#where) to your query, but will not validate your input or throw any exceptions.\n\n**Parameters**:\n - `$custom_where`: an apicalypse string with a custom where statement\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"(platforms = [6,48] & genres = 13) | (platforms = [130,48] & genres = 12)\"\n );\n\n // builder approach\n $builder->custom_where(\"(platforms = [6,48] & genres = 13) | (platforms = [130,48] & genres = 12)\");\n\n?>\n```","html":"public function custom_where(string $custom_where): IGDBQueryBuilder\n
\nThis method will add a where statement to your query, but will not validate your input or throw any exceptions.
\nParameters:
\n$custom_where
: an apicalypse string with a custom where statementReturns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach\n $options = array(\n \"custom_where\" => \"(platforms = [6,48] & genres = 13) | (platforms = [130,48] & genres = 12)\"\n );\n\n // builder approach\n $builder->custom_where(\"(platforms = [6,48] & genres = 13) | (platforms = [130,48] & genres = 12)\");\n\n?>\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":16},{"id":"8bff07a","slug":"endpoint","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Endpoint","date":null,"timestamp":null,"body":{"stripped":"This method will set the endpoint to send your multiquery against. This parameter is processed in case of a multiquery build only. When setting this value make sure to use the name of the endpoint instead of it's request path. (for example game instead of games and so on).\n\n:warning In case of a multiquery build this parameter is mandatory! If this is missing from the configuration the build will throw an IGDBInvalidParameterException! Refer to the build method for details.\n\nParameters:\n\n$endpoint: the name of the endpoint to send the query against. Make sure to use the name of the endpoint instead of it's request path! The list of endpoints for this parameter:\n\nage_rating\n\nalternative_name\n\nartwork\n\ncharacter_mug_shot\n\ncharacter\n\ncollection\n\ncompany_logo\n\ncompany_website\n\ncompany\n\ncover\n\nexternal_game\n\nfranchise\n\ngame_engine_logo\n\ngame_engine\n\ngame_mode\n\ngame_version_feature_value\n\ngame_version_feature\n\ngame_version\n\ngame_video\n\ngame\n\ngenre\n\ninvolved_company\n\nkeyword\n\nmultiplayer_mode\n\nmultiquery\n\nplatform_family\n\nplatform_logo\n\nplatform_version_company\n\nplatform_version_release_date\n\nplatform_version\n\nplatform_website\n\nplatform\n\nplayer_perspective\n\nrelease_date\n\nscreenshot\n\nsearch\n\ntheme\n\nwebsite\n\nReturns: IGDBQueryBuilder instance\n\n\n\nThe value of $query:","markdown":"```php\npublic function endpoint(string $endpoint) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nThis method will set the endpoint to send your **multiquery** against. This parameter is processed **in case of a multiquery build only**. When setting this value make sure to use the name of the endpoint instead of it's request path. (for example `game` instead of `games` and so on).\n\n>:warning In case of a multiquery build this parameter is mandatory! If this is missing from the configuration the build will throw an `IGDBInvalidParameterException`! Refer to the [build method](#building-the-query) for details.\n\n**Parameters**:\n - `$endpoint`: the name of the endpoint to send the query against. Make sure to use the name of the endpoint instead of it's request path! The list of endpoints for this parameter:\n - age_rating\n - alternative_name\n - artwork\n - character_mug_shot\n - character\n - collection\n - company_logo\n - company_website\n - company\n - cover\n - external_game\n - franchise\n - game_engine_logo\n - game_engine\n - game_mode\n - game_version_feature_value\n - game_version_feature\n - game_version\n - game_video\n - game\n - genre\n - involved_company\n - keyword\n - multiplayer_mode\n - multiquery\n - platform_family\n - platform_logo\n - platform_version_company\n - platform_version_release_date\n - platform_version\n - platform_website\n - platform\n - player_perspective\n - release_date\n - screenshot\n - search\n - theme\n - website\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\nname(\"Game with ID of 25076\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\");\n\n // building the query\n $query = $builder->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe value of `$query`:\n\n```text\nquery games \"Game with ID 25076\" {\n fields id,name;\n where id = 25076;\n};\n```","html":"public function endpoint(string $endpoint) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nThis method will set the endpoint to send your multiquery against. This parameter is processed in case of a multiquery build only. When setting this value make sure to use the name of the endpoint instead of it's request path. (for example game
instead of games
and so on).
\n\n:warning In case of a multiquery build this parameter is mandatory! If this is missing from the configuration the build will throw an
\nIGDBInvalidParameterException
! Refer to the build method for details.
Parameters:
\n$endpoint
: the name of the endpoint to send the query against. Make sure to use the name of the endpoint instead of it's request path! The list of endpoints for this parameter:\nReturns: IGDBQueryBuilder
instance
<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // configuring the query\n $builder\n ->name(\"Game with ID of 25076\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\");\n\n // building the query\n $query = $builder->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\nThe value of $query
:
query games \"Game with ID 25076\" {\n fields id,name;\n where id = 25076;\n};\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":17},{"id":"140e5d5","slug":"exclude","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Exclude","date":null,"timestamp":null,"body":{"stripped":"Exclude is a complement to the regular fields which allows you to request all fields with the exception of any numbers of fields specified with exclude.\n\nParameters:\n\n$exclude: the list of the fields to exclude. This can be either a comma separated list of field names or an array of field names.\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function exclude(string | array $exclude) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nExclude is a complement to the regular fields which allows you to request all fields with the exception of any numbers of fields specified with exclude.\n\n**Parameters**:\n - `$exclude`: the list of the fields to exclude. This can be either a comma separated list of field names or an array of field names.\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"name,slug\"\n );\n\n // traditional approach, as an array\n $options = array(\n \"exclude\" => array(\"name\", \"slug\")\n );\n\n // builder approach, as a string\n $builder->exclude(\"name,slug\");\n\n // builder approach, as an array\n $builder->exclude(array(\"name\", \"slug\"));\n\n?>\n```","html":"public function exclude(string | array $exclude) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nExclude is a complement to the regular fields which allows you to request all fields with the exception of any numbers of fields specified with exclude.
\nParameters:
\n$exclude
: the list of the fields to exclude. This can be either a comma separated list of field names or an array of field names.Returns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach, as a string\n $options = array(\n \"exclude\" => \"name,slug\"\n );\n\n // traditional approach, as an array\n $options = array(\n \"exclude\" => array(\"name\", \"slug\")\n );\n\n // builder approach, as a string\n $builder->exclude(\"name,slug\");\n\n // builder approach, as an array\n $builder->exclude(array(\"name\", \"slug\"));\n\n?>\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":18},{"id":"3045e49","slug":"fields","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Fields","date":null,"timestamp":null,"body":{"stripped":"You can tell which fields you want to get in the result with this parameter.\n\nFields are properties of an entity. For example, a Game field would be genres or release_dates. Some fields have properties of their own, for example, the genres field has the property name.\n\nDefault value: by default every field (\\*) will be requested from the endpoint.\n\nParameters:\n\n$fields: the list of the required fields. This can be either a comma separated list of field names, or an array of field names.\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function fields(string | array $fields) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nYou can tell which fields you want to get in the result with this parameter.\n\nFields are properties of an entity. For example, a Game field would be genres or release_dates. Some fields have properties of their own, for example, the genres field has the property name.\n\n**Default value**: by default every field (`*`) will be requested from the endpoint.\n\n**Parameters**:\n - `$fields`: the list of the required fields. This can be either a comma separated list of field names, or an array of field names.\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"id,name\"\n );\n\n // traditional approach, as an array\n $options = array(\n \"fields\" => array(\"id\", \"name\")\n );\n\n // builder approach, as a string\n $builder->fields(\"id,name\");\n\n // builder approach, as an array\n $builder->fields(array(\"id\", \"name\"));\n\n?>\n```","html":"public function fields(string | array $fields) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nYou can tell which fields you want to get in the result with this parameter.
\nFields are properties of an entity. For example, a Game field would be genres or release_dates. Some fields have properties of their own, for example, the genres field has the property name.
\nDefault value: by default every field (*
) will be requested from the endpoint.
Parameters:
\n$fields
: the list of the required fields. This can be either a comma separated list of field names, or an array of field names.Returns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach, as a string\n $options = array(\n \"fields\" => \"id,name\"\n );\n\n // traditional approach, as an array\n $options = array(\n \"fields\" => array(\"id\", \"name\")\n );\n\n // builder approach, as a string\n $builder->fields(\"id,name\");\n\n // builder approach, as an array\n $builder->fields(array(\"id\", \"name\"));\n\n?>\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":19},{"id":"4188856","slug":"id","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"ID","date":null,"timestamp":null,"body":{"stripped":"This is kind of a traditional thing. Since the IGDB team introduced the apicalypse query there is no separate ID field. This method simply adds a where statement to your query.\n\n\n\nParameters:\n\n$id: one (integer) or more (array of integers) record ID's.\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function id(array | int $id) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nThis is kind of a traditional thing. Since the IGDB team introduced the apicalypse query there is no separate ID field. This method simply adds a [where](#where) statement to your query.\n\n```php\nid(1);\n // where id = 1;\n\n $builder->id(array(1,2,3));\n // where id = (1,2,3);\n\n?>\n```\n\n**Parameters**:\n - `$id`: one (integer) or more (array of integers) record ID's.\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n 1\n );\n\n // traditional approach, multiple id's\n $options = array(\n \"id\" => array(1,2,3)\n );\n\n // builder approach, single id\n $builder->id(1);\n\n // builder approach, multiple id's\n $builder->id(array(1,2,3));\n\n?>\n```","html":"public function id(array | int $id) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nThis is kind of a traditional thing. Since the IGDB team introduced the apicalypse query there is no separate ID field. This method simply adds a where statement to your query.
\n<?php\n\n $builder->id(1);\n // where id = 1;\n\n $builder->id(array(1,2,3));\n // where id = (1,2,3);\n\n?>\n
\nParameters:
\n$id
: one (integer) or more (array of integers) record ID's.Returns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach, single id\n $options = array(\n \"id\" => 1\n );\n\n // traditional approach, multiple id's\n $options = array(\n \"id\" => array(1,2,3)\n );\n\n // builder approach, single id\n $builder->id(1);\n\n // builder approach, multiple id's\n $builder->id(array(1,2,3));\n\n?>\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":20},{"id":"16826a6","slug":"limit","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Limit","date":null,"timestamp":null,"body":{"stripped":"The maximum number of results in a single query. This value must be a number between 1 and 500.\n\nDefault value: by default the IGDB API will return 10 results.\n\nParameters:\n\n$limit: a number between 1 and 500\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function limit(int $limit) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nThe maximum number of results in a single query. This value must be a number between `1` and `500`.\n\n**Default value**: by default the IGDB API will return `10` results.\n\n**Parameters**:\n - `$limit`: a number between 1 and 500\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n array(\n \"limit\" => 20\n );\n\n // builder approach\n $builder->limit(20);\n\n?>\n```","html":"public function limit(int $limit) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nThe maximum number of results in a single query. This value must be a number between 1
and 500
.
Default value: by default the IGDB API will return 10
results.
Parameters:
\n$limit
: a number between 1 and 500Returns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach\n $options => array(\n \"limit\" => 20\n );\n\n // builder approach\n $builder->limit(20);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":21},{"id":"d3a8245","slug":"name","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Name","date":null,"timestamp":null,"body":{"stripped":"This method will set a name for the query. This parameter is processed in case of a multiquery build only.\n\n:warning In case of a multiquery build this parameter is mandatory! If this is missing from the configuration the build will throw an IGDBInvalidParameterException! Refer to the build method for details.\n\nParameters:\n\n$name: the name of the query\n\nReturns: IGDBQueryBuilder instance\n\n\n\nThe value of $query:","markdown":"```php\npublic function name(string $name) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nThis method will set a name for the query. This parameter is processed **in case of a multiquery build only**.\n\n>:warning In case of a multiquery build this parameter is **mandatory**! If this is missing from the configuration the build will throw an `IGDBInvalidParameterException`! Refer to the [build method](#building-the-query) for details.\n\n**Parameters**:\n - `$name`: the name of the query\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\nname(\"Game with ID of 25076\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\");\n\n // building the query\n $query = $builder->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe value of `$query`:\n\n```text\nquery games \"Game with ID 25076\" {\n fields id,name;\n where id = 25076;\n};\n```","html":"public function name(string $name) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nThis method will set a name for the query. This parameter is processed in case of a multiquery build only.
\n\n\n:warning In case of a multiquery build this parameter is mandatory! If this is missing from the configuration the build will throw an
\nIGDBInvalidParameterException
! Refer to the build method for details.
Parameters:
\n$name
: the name of the queryReturns: IGDBQueryBuilder
instance
<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // configuring the query\n $builder\n ->name(\"Game with ID of 25076\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\");\n\n // building the query\n $query = $builder->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\nThe value of $query
:
query games \"Game with ID 25076\" {\n fields id,name;\n where id = 25076;\n};\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":22},{"id":"00cc049","slug":"offset","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Offset","date":null,"timestamp":null,"body":{"stripped":"This will start the result list at the provided value and will give limit number of results. This value must be 0 or greater.\n\nDefault value: the IGDB API will use 0 as a default offset value.\n\nParameters:\n\n$offset: a number which can be 0 or greater.\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function offset(int $offset) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nThis will start the result list at the provided value and will give [`limit`](#limit) number of results. This value must be `0` or greater.\n\n**Default value**: the IGDB API will use `0` as a default offset value.\n\n**Parameters**:\n - `$offset`: a number which can be `0` or greater.\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n 5\n );\n\n // builder approach\n $builder->offset(5);\n\n?>\n```","html":"public function offset(int $offset) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nThis will start the result list at the provided value and will give limit
number of results. This value must be 0
or greater.
Default value: the IGDB API will use 0
as a default offset value.
Parameters:
\n$offset
: a number which can be 0
or greater.Returns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach\n $options = array(\n \"offset\" => 5\n );\n\n // builder approach\n $builder->offset(5);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":23},{"id":"9c7d4f3","slug":"options","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Options","date":null,"timestamp":null,"body":{"stripped":":warning Using the Builder this way is not recommended as this functionality may be removed in future versions. Use the builder approach instead.\n\nWith this method you can parse your $options array instead of using the builder approach. If a non-valid key or value is in the array, an IGDBInvalidParameterException will be thrown.\n\nPassing your $options array to this method will configure the builder with the parameters in it.\n\nParameters:\n\n$options: the options array with your configuration in it\n\nReturns: IGDBQueryBuilder instance\n\n\n\n:warning Calling this method will not reset the configuration. Stacking the options() calls will add each parameter to the builder, overwriting the old values with the new ones. To clear the previous configuration items use the reset method.\n\n\n\nThe query:","markdown":"```php\npublic function options(array $options) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\n>:warning Using the Builder this way is not recommended as this functionality may be removed in future versions. Use the [builder approach](#builder-approach) instead.\n\nWith this method you can parse your `$options` array instead of using the [builder approach](#builder-approach). If a non-valid key or value is in the array, an `IGDBInvalidParameterException` will be thrown.\n\nPassing your `$options` array to this method will configure the builder with the parameters in it.\n\n**Parameters**:\n - `$options`: the options array with your configuration in it\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"uncharted 4\",\n \"fields\" => \"id,name\",\n \"limit\" => 1\n );\n\n try {\n // configuring the builder with an options array\n $builder->options($options);\n\n // still have to call the build method to building the query\n $query = $builder->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```\n\n>:warning Calling this method **will not reset** the configuration. Stacking the `options()` calls will add each parameter to the builder, overwriting the old values with the new ones. To clear the previous configuration items use the [reset method](#reset).\n\n```php\noptions(array(\"search\" => \"uncharted\"))\n ->options(array(\"fields\" => \"id,name\"))\n // this call will overwrite the search parameter!\n ->options(array(\"search\" => \"overwritten uncharted\"))\n ->options(array(\"limit\" => 1));\n\n // building the query\n $query = $builder->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe query:\n\n```text\nfields id,name; search \"overwritten uncharted\"; limit 1;\n```","html":"public function options(array $options) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\n\n\n:warning Using the Builder this way is not recommended as this functionality may be removed in future versions. Use the builder approach instead.
\n
With this method you can parse your $options
array instead of using the builder approach. If a non-valid key or value is in the array, an IGDBInvalidParameterException
will be thrown.
Passing your $options
array to this method will configure the builder with the parameters in it.
Parameters:
\n$options
: the options array with your configuration in itReturns: IGDBQueryBuilder
instance
<?php\n\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n // setting up the options array\n $options = array(\n \"search\" => \"uncharted 4\",\n \"fields\" => \"id,name\",\n \"limit\" => 1\n );\n\n try {\n // configuring the builder with an options array\n $builder->options($options);\n\n // still have to call the build method to building the query\n $query = $builder->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\n\n\n:warning Calling this method will not reset the configuration. Stacking the
\noptions()
calls will add each parameter to the builder, overwriting the old values with the new ones. To clear the previous configuration items use the reset method.
<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // stacking the options calls will add each parameter as this not resets the configuration\n $builder\n ->options(array(\"search\" => \"uncharted\"))\n ->options(array(\"fields\" => \"id,name\"))\n // this call will overwrite the search parameter!\n ->options(array(\"search\" => \"overwritten uncharted\"))\n ->options(array(\"limit\" => 1));\n\n // building the query\n $query = $builder->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\nThe query:
\nfields id,name; search \"overwritten uncharted\"; limit 1;\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":24},{"id":"5b09832","slug":"reset","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Reset","date":null,"timestamp":null,"body":{"stripped":"This method will reset every configuration to the default values.\n\nParameters: -\n\nReturns: IGDBQueryBuilder instance\n\n\n\nThe code above will return the $options2 array's configuration, as it got reset with the reset() method.","markdown":"```php\npublic function reset(): IGDBQueryBuilder\n```\n\nThis method will reset every configuration to the default values.\n\n**Parameters**: -\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"uncharted 4\",\n \"fields\" => \"id,name\",\n \"limit\" => 2\n );\n\n // setting upt he options2 array\n $options2 = array(\n \"search\" => \"star wars\",\n \"fields\" => \"cover,slug\",\n \"limit\" => 1\n );\n\n try {\n // configuring the builder with options1, reset the values then pass options2\n $builder->options($options1)->reset()->options($options2);\n\n // building the query\n $query = $builder->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe code above will return the `$options2` array's configuration, as it got reset with the `reset()` method.\n\n```text\nfields cover,slug; search \"star wars\"; limit 1;\n```","html":"public function reset(): IGDBQueryBuilder\n
\nThis method will reset every configuration to the default values.
\nParameters: -
\nReturns: IGDBQueryBuilder
instance
<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n // setting up the options1 array\n $options1 = array(\n \"search\" => \"uncharted 4\",\n \"fields\" => \"id,name\",\n \"limit\" => 2\n );\n\n // setting upt he options2 array\n $options2 = array(\n \"search\" => \"star wars\",\n \"fields\" => \"cover,slug\",\n \"limit\" => 1\n );\n\n try {\n // configuring the builder with options1, reset the values then pass options2\n $builder->options($options1)->reset()->options($options2);\n\n // building the query\n $query = $builder->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\nThe code above will return the $options2
array's configuration, as it got reset with the reset()
method.
fields cover,slug; search \"star wars\"; limit 1;\n
"},"meta":{"revision":0,"created":1699570565561,"version":0},"$loki":25},{"id":"9b526d4","slug":"search","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Search","date":null,"timestamp":null,"body":{"stripped":"Search based on name, results are sorted by similarity to the given search string.\n\nParameters:\n\n$search: the search string\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function search(string $search) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nSearch based on name, results are sorted by similarity to the given search string.\n\n**Parameters**:\n - `$search`: the search string\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"uncharted 4\"\n );\n\n // builder approach\n $builder->search(\"uncharted 4\");\n\n?>\n```","html":"public function search(string $search) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nSearch based on name, results are sorted by similarity to the given search string.
\nParameters:
\n$search
: the search stringReturns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach\n $options = array(\n \"search\" => \"uncharted 4\"\n );\n\n // builder approach\n $builder->search(\"uncharted 4\");\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":26},{"id":"71fc60c","slug":"sort","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Sort","date":null,"timestamp":null,"body":{"stripped":"Sorting (ordering) is used to order results by a specific field. The parameter can be either an apicalypse formatted sort string or an array with specific key-value pairs. If you provide the Order parameter as an array, you must have two values in it with the following keys:\n\nfield: The field you want to do the ordering by\n\ndirection: The direction of the ordering. It must be either asc for ascending or desc for descending ordering.\n\nParameters:\n\n$sort: either an apicalypse sort string or an array with specific key-value pairs.\n\nReturns: IGDBQueryBuilder instance","markdown":"```php\npublic function sort(string | array $sort) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nSorting (ordering) is used to order results by a specific field. The parameter can be either an apicalypse formatted sort string or an array with specific key-value pairs. If you provide the Order parameter as an array, you must have two values in it with the following keys:\n - `field`: The field you want to do the ordering by\n - `direction`: The direction of the ordering. It must be either `asc` for ascending or `desc` for descending ordering.\n\n**Parameters**:\n - `$sort`: either an apicalypse sort string or an array with specific key-value pairs.\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"release_dates.date desc\",\n );\n\n // traditional approach as an array\n $options = array(\n \"sort\" => array(\n \"field\" => \"release_dates.date\",\n \"direction\" => \"desc\"\n )\n );\n\n // builder approach as a string\n $builder->sort(\"release_dates.date desc\");\n\n // builder approach as an array\n $builder->sort(\n array(\n \"field\" => \"release_dates.date\",\n \"direction\" => \"desc\"\n )\n );\n\n?>\n```","html":"public function sort(string | array $sort) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nSorting (ordering) is used to order results by a specific field. The parameter can be either an apicalypse formatted sort string or an array with specific key-value pairs. If you provide the Order parameter as an array, you must have two values in it with the following keys:
\nfield
: The field you want to do the ordering bydirection
: The direction of the ordering. It must be either asc
for ascending or desc
for descending ordering.Parameters:
\n$sort
: either an apicalypse sort string or an array with specific key-value pairs.Returns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach as a string\n $options = array(\n \"sort\" => \"release_dates.date desc\",\n );\n\n // traditional approach as an array\n $options = array(\n \"sort\" => array(\n \"field\" => \"release_dates.date\",\n \"direction\" => \"desc\"\n )\n );\n\n // builder approach as a string\n $builder->sort(\"release_dates.date desc\");\n\n // builder approach as an array\n $builder->sort(\n array(\n \"field\" => \"release_dates.date\",\n \"direction\" => \"desc\"\n )\n );\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":27},{"id":"97f826b","slug":"where","level":3,"parent":"1bc2dc4","parents":["1bc2dc4","502391f"],"title":"Where","date":null,"timestamp":null,"body":{"stripped":"Filters are used to swift through results to get what you want. You can exclude and include results based on their properties. For example you could remove all Games where the rating was below 80 (where rating >= 80).\n\nThe where parameter can be either an apicalypse formatted string or an array with specific key-value pairs. If you provide the where parameters as an array, you must have three fix keys in it:\n\nfield: The name of the field you want to apply the filter to.\n\npostfix: The postfix you want to use with the filter. Refer to the Available Postfixes section of the IGDB Filters Documentation for available postfixes.\n\nvalue: The value of the filter.\n\nThe where filters will be concatenated with AND operators (&).\n\n:tip Multiple filter parameters can be applied to the same query. Check the examples below.\n\nParameters:\n\n$where: either an apicalypse formatted string or an array with specific keys\n\nReturns: IGDBQueryBuilder instance\n\n\n\nThis method is trying to validate your input against some rules and will throw an IGDBInvalidArgumentException in case of any issues. If you need more flexibility or custom where statements with complex conditions in you queries use the Custom Where method instead.","markdown":"```php\npublic function where(string | array $where) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n```\n\nFilters are used to swift through results to get what you want. You can exclude and include results based on their properties. For example you could remove all Games where the rating was below 80 `(where rating >= 80)`.\n\nThe where parameter can be either an apicalypse formatted string or an array with specific key-value pairs. If you provide the where parameters as an array, you must have three fix keys in it:\n - `field`: The name of the field you want to apply the filter to.\n - `postfix`: The postfix you want to use with the filter. Refer to the [Available Postfixes](https://api-docs.igdb.com/#filters) section of the IGDB Filters Documentation for available postfixes.\n - `value`: The value of the filter.\n\nThe where filters will be concatenated with **AND** operators (`&`).\n\n>:tip Multiple filter parameters can be applied to the same query. Check the examples below.\n\n**Parameters**:\n - `$where`: either an apicalypse formatted string or an array with specific keys\n\n**Returns**: `IGDBQueryBuilder` instance\n\n```php\n \"release_dates.platform = 8\"\n );\n\n // traditional approach, single criteria as an array\n $options = array(\n \"where\" => array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n )\n );\n\n // traditional approach, multiple criteria as a string\n $options = array(\n \"where\" => array(\n \"release_dates.platform = 8\",\n \"total_rating >= 70\"\n );\n );\n\n // traditional approach, multiple criteria as an array\n $options = array(\n \"where\" => array(\n array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n ),\n array(\n \"field\" => \"total_rating\",\n \"postfix\" => \">=\",\n \"value\" => 70\n )\n )\n );\n\n // builder approach, single criteria as a string\n $builder->where(\"release_dates.platform = 8\");\n\n // builder approach, single criteria as an array\n $builder->where(\n array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n )\n );\n\n // builder approach, multiple criteria as a string\n $builder\n ->where(\"release_dates.platform = 8\")\n ->where(\"total_rating >= 70\");\n\n // builder approach, multiple criteria as an array\n $builder\n ->where(\n array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n )\n )\n ->where(\n array(\n \"field\" => \"total_rating\",\n \"postfix\" => \">=\",\n \"value\" => 70\n )\n );\n?>\n```\n\n> This method is trying to validate your input against some rules and will throw an `IGDBInvalidArgumentException` in case of any issues. If you need more flexibility or custom where statements with complex conditions in you queries use the [Custom Where](#custom-where) method instead.","html":"public function where(string | array $where) throws IGDBInvalidArgumentException: IGDBQueryBuilder\n
\nFilters are used to swift through results to get what you want. You can exclude and include results based on their properties. For example you could remove all Games where the rating was below 80 (where rating >= 80)
.
The where parameter can be either an apicalypse formatted string or an array with specific key-value pairs. If you provide the where parameters as an array, you must have three fix keys in it:
\nfield
: The name of the field you want to apply the filter to.postfix
: The postfix you want to use with the filter. Refer to the Available Postfixes section of the IGDB Filters Documentation for available postfixes.value
: The value of the filter.The where filters will be concatenated with AND operators (&
).
\n\n:tip Multiple filter parameters can be applied to the same query. Check the examples below.
\n
Parameters:
\n$where
: either an apicalypse formatted string or an array with specific keysReturns: IGDBQueryBuilder
instance
<?php\n\n // traditional approach, single criteria as a string\n $options = array(\n \"where\" => \"release_dates.platform = 8\"\n );\n\n // traditional approach, single criteria as an array\n $options = array(\n \"where\" => array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n )\n );\n\n // traditional approach, multiple criteria as a string\n $options = array(\n \"where\" => array(\n \"release_dates.platform = 8\",\n \"total_rating >= 70\"\n );\n );\n\n // traditional approach, multiple criteria as an array\n $options = array(\n \"where\" => array(\n array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n ),\n array(\n \"field\" => \"total_rating\",\n \"postfix\" => \">=\",\n \"value\" => 70\n )\n )\n );\n\n // builder approach, single criteria as a string\n $builder->where(\"release_dates.platform = 8\");\n\n // builder approach, single criteria as an array\n $builder->where(\n array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n )\n );\n\n // builder approach, multiple criteria as a string\n $builder\n ->where(\"release_dates.platform = 8\")\n ->where(\"total_rating >= 70\");\n\n // builder approach, multiple criteria as an array\n $builder\n ->where(\n array(\n \"field\" => \"release_dates.platform\",\n \"postfix\" => \"=\",\n \"value\" => 8\n )\n )\n ->where(\n array(\n \"field\" => \"total_rating\",\n \"postfix\" => \">=\",\n \"value\" => 70\n )\n );\n?>\n
\n\n"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":28},{"id":"ee45e35","slug":"building-the-query","level":2,"parent":"1bc2dc4","parents":["1bc2dc4"],"title":"Building the Query","date":null,"timestamp":null,"body":{"stripped":"When the Builder object is configured properly the final step is to build the query to an apicalypse query string. The syntax of the query depends on which endpoint the query is executed against. The multiquery endpoint requires a few additional information and a slightly different syntax.\n\nA game endpoint query:\n\n\n\nA multiquery to the game game endpoint:\n\n\n\nThe build method accepts one boolean parameter. Using this parameter the build method decides which syntax to return. If a multiquery is required, a few extra fields has to be set for the builder:\n\nname: the name of the query choosen by the user\n\nendpoint: the endpoint to send the query against\n\ncount \\[optional]: whether the records or their count is required. By default the value of this parameter is false.\n\n:warning In case of a multiquery request the properties name and endpoint are mandatory! If any of these are missing from the configuration, an IGDBInvalidParameterException will be thrown.\n\nParameters:\n\n$multiquery: if true, a multiquery will be returned, an endpoint query otherwise. The default value of this parameter is false.\n\n:warning If a non-boolean parameter is passed to the build method, an IGDBInavlidParameterException is thrown!\n\nReturns: the apicalypse query string\n\nAn endpoint query example:\n\n\n\nThe value of $query:\n\n\n\nA multiquery example:\n\n\n\nThe value of $query:","markdown":"```php\npublic function build(boolean $multiquery = false) throws IGDBInvalidParameterException: mixed\n```\n\nWhen the Builder object is configured properly the final step is to build the query to an apicalypse query string. The syntax of the query depends on which endpoint the query is executed against. The multiquery endpoint requires a few additional information and a slightly different syntax.\n\nA [`game`](#game) endpoint query:\n```text\nfields id,name;\nwhere id = 25076;\n```\n\nA [`multiquery`](#multiquery) to the game [`game`](#game) endpoint:\n```text\nquery games \"Main Game\" {\n fields id,name;\n where id = 25076;\n};\n```\n\nThe build method accepts one `boolean` parameter. Using this parameter the build method decides which syntax to return. If a multiquery is required, a few extra fields has to be set for the builder:\n - [`name`](#name): the name of the query choosen by the user\n - [`endpoint`](#endpoint): the endpoint to send the query against\n - [`count`](#count) [optional]: whether the records or their count is required. By default the value of this parameter is `false`.\n\n>:warning In case of a multiquery request the properties [name](#name) and [endpoint](#endpoint) are **mandatory**! If any of these are missing from the configuration, an `IGDBInvalidParameterException` will be thrown.\n\n**Parameters**:\n - `$multiquery`: if `true`, a multiquery will be returned, an endpoint query otherwise. The default value of this parameter is `false`.\n\n >:warning If a non-boolean parameter is passed to the build method, an `IGDBInavlidParameterException` is thrown!\n\n**Returns**: the apicalypse query string\n\nAn endpoint query example:\n```php\nsearch(\"uncharted 4\")\n ->fields(\"id, name\")\n ->limit(1)\n ->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid value passed to a method\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe value of `$query`:\n\n```text\nfields id,name;\nsearch \"uncharted 4\";\nlimit 1;\n```\n\nA multiquery example:\n\n```php\nname(\"Game with ID of 25076\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\")\n // note the true parameter\n ->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe value of `$query`:\n\n```text\nquery games \"Game with ID of 25076\" {\n fields id,name;\n where id = 25076;\n};\n```","html":"This method is trying to validate your input against some rules and will throw an
\nIGDBInvalidArgumentException
in case of any issues. If you need more flexibility or custom where statements with complex conditions in you queries use the Custom Where method instead.
public function build(boolean $multiquery = false) throws IGDBInvalidParameterException: mixed\n
\nWhen the Builder object is configured properly the final step is to build the query to an apicalypse query string. The syntax of the query depends on which endpoint the query is executed against. The multiquery endpoint requires a few additional information and a slightly different syntax.
\nA game
endpoint query:
fields id,name;\nwhere id = 25076;\n
\nA multiquery
to the game game
endpoint:
query games \"Main Game\" {\n fields id,name;\n where id = 25076;\n};\n
\nThe build method accepts one boolean
parameter. Using this parameter the build method decides which syntax to return. If a multiquery is required, a few extra fields has to be set for the builder:
name
: the name of the query choosen by the userendpoint
: the endpoint to send the query againstcount
[optional]: whether the records or their count is required. By default the value of this parameter is false
.\n\n:warning In case of a multiquery request the properties name and endpoint are mandatory! If any of these are missing from the configuration, an
\nIGDBInvalidParameterException
will be thrown.
Parameters:
\n$multiquery
: if true
, a multiquery will be returned, an endpoint query otherwise. The default value of this parameter is false
.\n\n:warning If a non-boolean parameter is passed to the build method, an
\nIGDBInavlidParameterException
is thrown!
Returns: the apicalypse query string
\nAn endpoint query example:
\n<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // configuring the query\n $query = $builder\n ->search(\"uncharted 4\")\n ->fields(\"id, name\")\n ->limit(1)\n ->build();\n } catch (IGDBInvaliParameterException $e) {\n // invalid value passed to a method\n echo $e->getMessage();\n }\n\n?>\n
\nThe value of $query
:
fields id,name;\nsearch \"uncharted 4\";\nlimit 1;\n
\nA multiquery example:
\n<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // configuring the query\n $builder\n ->name(\"Game with ID of 25076\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\")\n // note the true parameter\n ->build(true);\n } catch (IGDBInvaliParameterException $e) {\n // invalid key or value found in the $options array\n echo $e->getMessage();\n }\n\n?>\n
\nThe value of $query
:
query games \"Game with ID of 25076\" {\n fields id,name;\n where id = 25076;\n};\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":29},{"id":"cbf8ecb","slug":"igdb-wrapper","level":1,"parent":null,"parents":[],"title":"IGDB Wrapper","date":null,"timestamp":1698348963000,"body":{"stripped":"This is the most important part of the wrapper, the IGDB class which does the heavy lifting: communicating with the IGDB API.\n\nAs mentioned in the Introduction, to have access to IGDB's database you have to register a Twitch Account and have your own client_id and access_token.\n\n:tip You can add your tokens to the documentation to replace them in the exmple codes. Click the logo in the top left corner to get back to the main page and save your tokens.","markdown":"This is the most important part of the wrapper, the `IGDB` class which does the heavy lifting: communicating with the IGDB API.\n\nAs mentioned in the [Introduction](#getting-started), to have access to IGDB's database you have to register a Twitch Account and have your own `client_id` and `access_token`.\n\n>:tip You can add your tokens to the documentation to replace them in the exmple codes. Click the logo in the top left corner to get back to the main page and save your tokens.","html":"This is the most important part of the wrapper, the IGDB
class which does the heavy lifting: communicating with the IGDB API.
As mentioned in the Introduction, to have access to IGDB's database you have to register a Twitch Account and have your own client_id
and access_token
.
\n"},"icon":"fa-gift","overview":"The main wrapper. Methods, endpoints, properties, configurations. Sending your queries to the IGDB API.","meta":{"revision":0,"created":1699570565562,"version":0},"$loki":30},{"id":"554c02d","slug":"instantiating-the-wrapper-ii","level":2,"parent":"cbf8ecb","parents":["cbf8ecb"],"title":"Instantiating the wrapper","date":null,"timestamp":null,"body":{"stripped":"After importing the dependencies you can instantiate the class with the new keyword by passing your tokens to the constructor.\n\n\n\n:info The wrapper itself does not validate your tokens. If your credentials are invalid, you will get an error from the IGDB API after executing a query.","markdown":"After importing the dependencies you can instantiate the class with the `new` keyword by passing your tokens to the constructor.\n\n```php\n\n```\n\n>:info The wrapper itself does not validate your tokens. If your credentials are invalid, you will get an error from the IGDB API after executing a query.","html":":tip You can add your tokens to the documentation to replace them in the exmple codes. Click the logo in the top left corner to get back to the main page and save your tokens.
\n
After importing the dependencies you can instantiate the class with the new
keyword by passing your tokens to the constructor.
<?php\n\n require_once \"class.igdb.php\";\n\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n?>\n
\n\n"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":31},{"id":"884a161","slug":"public-methods","level":2,"parent":"cbf8ecb","parents":["cbf8ecb"],"title":"Public Methods","date":null,"timestamp":null,"body":{"stripped":"These methods are exposed from the IGDB object.","markdown":"These methods are exposed from the `IGDB` object.","html":":info The wrapper itself does not validate your tokens. If your credentials are invalid, you will get an error from the IGDB API after executing a query.
\n
These methods are exposed from the IGDB
object.
public function get_request_info()\n
\nAfter a query is executed, the latest request information will be stored and can be retrieved using this method.
\n\n\nThe new version of the IGDB API (v4) will return a http response code
\n429
when you exceed the limit of requests on the database (4 requests per second at the time of writing this documentation).
<?php\n\n require_once \"class.igdb.php\";\n\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n try {\n $igdb->game('fields id,name; search \"uncharted 4\"; limit 1;');\n\n // getting the details of the latest query\n $request_info = $igdb->get_request_info();\n\n // showing the details\n var_dump($request_info);\n } catch (IGDBEndpointException $e) {\n echo $e->getMessage();\n }\n\n?>\n
\nDetails of the query can be fetched from the output of the get_request_info()
method (for example, the HTTP Response code from http_code
).
array (size=37)\n 'url' => string 'https://api.igdb.com/v4/games' (length=29)\n 'content_type' => string 'application/json;charset=utf-8' (length=30)\n 'http_code' => int 200\n 'header_size' => int 870\n 'request_size' => int 224\n 'filetime' => int -1\n 'ssl_verify_result' => int 20\n 'redirect_count' => int 0\n 'total_time' => float 0.748895\n 'namelookup_time' => float 0.000705\n 'connect_time' => float 0.048049\n 'pretransfer_time' => float 0.088656\n 'size_upload' => float 46\n 'size_download' => float 73\n 'speed_download' => float 97\n 'speed_upload' => float 61\n 'download_content_length' => float 73\n 'upload_content_length' => float 46\n 'starttransfer_time' => float 0.088661\n 'redirect_time' => float 0\n 'redirect_url' => string '' (length=0)\n 'primary_ip' => string '104.22.65.239' (length=13)\n 'certinfo' =>\n array (size=0)\n empty\n 'primary_port' => int 443\n 'local_ip' => string '192.168.1.99' (length=12)\n 'local_port' => int 58813\n 'http_version' => int 3\n 'protocol' => int 2\n 'ssl_verifyresult' => int 0\n 'scheme' => string 'HTTPS' (length=5)\n 'appconnect_time_us' => int 88535\n 'connect_time_us' => int 48049\n 'namelookup_time_us' => int 705\n 'pretransfer_time_us' => int 88656\n 'redirect_time_us' => int 0\n 'starttransfer_time_us' => int 88661\n 'total_time_us' => int 748895\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":33},{"id":"f00c144","slug":"construct-url","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","884a161"],"title":"Construct URL","date":null,"timestamp":null,"body":{"stripped":"The method will construct the full URL for the request and will return the constructed URL as a string. If an invalid endpoint name passed to $endpoint an IGDBInvalidParameterException will be thrown.\n\nParameters:\n\n$endpoint: the endpoint to use (the name of the endpoint, not the path to it!). Possible values:\n\nage_rating\n\nage_rating_content_description\n\nalternative_name\n\nartwork\n\ncharacter\n\ncharacter_mug_shot\n\ncollection\n\ncollection_membership\n\ncollection_membership_type\n\ncollection_relation\n\ncollection_relation_type\n\ncollection_type\n\ncompany\n\ncompany_logo\n\ncompany_website\n\ncover\n\nevent\n\nevent_logo\n\nevent_network\n\nexternal_game\n\nfranchise\n\ngame\n\ngame_engine\n\ngame_engine_logo\n\ngame_localization\n\ngame_mode\n\ngame_version\n\ngame_version_feature\n\ngame_version_feature_value\n\ngame_video\n\ngenre\n\ninvolved_company\n\nkeyword\n\nlanguage\n\nlanguage_support\n\nmultiplayer_mode\n\nplatform\n\nlanguage_support_type\n\nplatform_family\n\nnetwork_type\n\nplatform_logo\n\nplatform_version_company\n\nplatform_version\n\nplatform_website\n\nplatform_version_release_date\n\nplayer_perspective\n\nregion\n\nrelease_date\n\nrelease_date_status\n\nscreenshot\n\nsearch\n\ntheme\n\nwebsite\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: the full constructed URL to the IGDB Endpoint as a string.\n\n\n\nOutput:","markdown":"```php\npublic function construct_url(string $endpoint, boolean $count = false) throws IGDBInvalidParameterException: string\n```\n\nThe method will construct the full URL for the request and will return the constructed URL as a string. If an invalid endpoint name passed to `$endpoint` an `IGDBInvalidParameterException` will be thrown.\n\n**Parameters**:\n - `$endpoint`: the endpoint to use (the name of the endpoint, not the path to it!). Possible values:\n - age_rating\n - age_rating_content_description\n - alternative_name\n - artwork\n - character\n - character_mug_shot\n - collection\n - collection_membership\n - collection_membership_type\n - collection_relation\n - collection_relation_type\n - collection_type\n - company\n - company_logo\n - company_website\n - cover\n - event\n - event_logo\n - event_network\n - external_game\n - franchise\n - game\n - game_engine\n - game_engine_logo\n - game_localization\n - game_mode\n - game_version\n - game_version_feature\n - game_version_feature_value\n - game_video\n - genre\n - involved_company\n - keyword\n - language\n - language_support\n - multiplayer_mode\n - platform\n - language_support_type\n - platform_family\n - network_type\n - platform_logo\n - platform_version_company\n - platform_version\n - platform_website\n - platform_version_release_date\n - player_perspective\n - region\n - release_date\n - release_date_status\n - screenshot\n - search\n - theme\n - website\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: the full constructed URL to the IGDB Endpoint as a string.\n\n```php\nconstruct_url(\"game\");\n\n // constructing an url to get counts\n $count_url = $igdb->construct_url(\"game\", true);\n\n // showing the results\n echo \"url: \" . $url;\n echo \"count url: \" . $count_url;\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter passed to the construct_url method\n echo $e->getMessage();\n }\n\n?>\n```\n\nOutput:\n\n```text\nurl: https://api.igdb.com/v4/games\ncount url: https://api.igdb.com/v4/games/count\n```","html":"public function construct_url(string $endpoint, boolean $count = false) throws IGDBInvalidParameterException: string\n
\nThe method will construct the full URL for the request and will return the constructed URL as a string. If an invalid endpoint name passed to $endpoint
an IGDBInvalidParameterException
will be thrown.
Parameters:
\n$endpoint
: the endpoint to use (the name of the endpoint, not the path to it!). Possible values:\n$count
: whether the request should return the number of matches instead of the actual resultsetReturns: the full constructed URL to the IGDB Endpoint as a string.
\n<?php\n\n // instantiating the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n try {\n // constructing an url\n $url = $igdb->construct_url(\"game\");\n\n // constructing an url to get counts\n $count_url = $igdb->construct_url(\"game\", true);\n\n // showing the results\n echo \"url: \" . $url;\n echo \"count url: \" . $count_url;\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter passed to the construct_url method\n echo $e->getMessage();\n }\n\n?>\n
\nOutput:
\nurl: https://api.igdb.com/v4/games\ncount url: https://api.igdb.com/v4/games/count\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":34},{"id":"5eb5cf1","slug":"close-curl-session","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","884a161"],"title":"Close CURL Session","date":null,"timestamp":null,"body":{"stripped":"You can close the CURL session handler manually if you need to.\n\nParameters: -\n\nReturns: -\n\nThe curl handler will be reinitialized automatically when a new request is sent to the IGDB API with any of the endpoint methods.","markdown":"```php\npublic function curl_close(): void\n```\n\nYou can close the CURL session handler manually if you need to.\n\n**Parameters**: -\n\n**Returns**: -\n\n> The curl handler will be [reinitialized](#reinitialize-curl-session) automatically when a new request is sent to the IGDB API with any of the endpoint methods.","html":"public function curl_close(): void\n
\nYou can close the CURL session handler manually if you need to.
\nParameters: -
\nReturns: -
\n\n"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":35},{"id":"e10c0ea","slug":"reinitialize-curl-session","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","884a161"],"title":"Reinitialize CURL Session","date":null,"timestamp":null,"body":{"stripped":"After you closed the CURL session manually with curl_close() you can manually reinitialize the curl handler.\n\nParameters: -\n\nReturns: -\n\nBefore sending a request with an endpoint method, the wrapper will check the status of the curl handler. If it is closed, it will reinitialize it automatically.","markdown":"```php\npublic function curl_reinit() : void\n```\n\nAfter you closed the CURL session manually with [curl_close()](#close-curl-session) you can manually reinitialize the curl handler.\n\n**Parameters**: -\n\n**Returns**: -\n\n> Before sending a request with an endpoint method, the wrapper will check the status of the curl handler. If it is closed, it will reinitialize it automatically.","html":"The curl handler will be reinitialized automatically when a new request is sent to the IGDB API with any of the endpoint methods.
\n
public function curl_reinit() : void\n
\nAfter you closed the CURL session manually with curl_close() you can manually reinitialize the curl handler.
\nParameters: -
\nReturns: -
\n\n"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":36},{"id":"9652f37","slug":"handling-request-errors","level":2,"parent":"cbf8ecb","parents":["cbf8ecb"],"title":"Handling Request Errors","date":null,"timestamp":null,"body":{"stripped":"Your query may fail on the IGDB side. In this case the API will send back a non-successful response code indicating that something went wrong. When this happens an IGDBEndpointException can be caught to extract information about the issue. To catch these errors you have to enclose your endpoint method calls in a try...catch block.\n\n\n\nSince the query above is not valid, as there is no field called nonexistingfield on the game endpoint, the API will send a response with an error message and a non-successful response code. The result of the script above is:\n\n\n\nYou can also get some additional information about this request using the get_request_info() method.","markdown":"Your query may fail on the IGDB side. In this case the API will send back a non-successful response code indicating that something went wrong. When this happens an `IGDBEndpointException` can be caught to extract information about the issue. To catch these errors you have to enclose your [endpoint](#endpoints) method calls in a try...catch block.\n\n```php\ngame($query);\n } catch (IGDBEndpointException $e) {\n // since the query contains a non-existing field, an error occured\n // printing the response code and the error message\n echo \"Response code: \" . $e->getResponseCode();\n echo \"Message: \" . $e->getMessage();\n }\n\n?>\n```\n\nSince the query above is not valid, as there is no field called `nonexistingfield` on the game endpoint, the API will send a response with an error message and a non-successful response code. The result of the script above is:\n\n```text\nResponse code: 400\nMessage: Invalid Field\n```\n\nYou can also get some additional information about this request using the [`get_request_info()`](#get-request-info) method.","html":"Before sending a request with an endpoint method, the wrapper will check the status of the curl handler. If it is closed, it will reinitialize it automatically.
\n
Your query may fail on the IGDB side. In this case the API will send back a non-successful response code indicating that something went wrong. When this happens an IGDBEndpointException
can be caught to extract information about the issue. To catch these errors you have to enclose your endpoint method calls in a try...catch block.
<?php\n\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // your query string with a field that doesn't exist\n $query = 'search \"uncharted\"; fields nonexistingfield;';\n\n try {\n // executing the query\n $games = $igdb->game($query);\n } catch (IGDBEndpointException $e) {\n // since the query contains a non-existing field, an error occured\n // printing the response code and the error message\n echo \"Response code: \" . $e->getResponseCode();\n echo \"Message: \" . $e->getMessage();\n }\n\n?>\n
\nSince the query above is not valid, as there is no field called nonexistingfield
on the game endpoint, the API will send a response with an error message and a non-successful response code. The result of the script above is:
Response code: 400\nMessage: Invalid Field\n
\nYou can also get some additional information about this request using the get_request_info()
method.
Every endpoint method is named after the IGDB API endpoints using snake-casing naming convention. These methods are expecting at least one parameter, the $query
itself. The second $count
parameter is optional, it is false
by default.
Parameters:
\n$query
: the query itself as an apicalypse string$count
: a boolean
value to whether return the records or the count of the records\n\n:tip To build your queries, give IGDB Query Builder a try!
\n
These methods will return an array of objects decoded from IGDB response JSON when the $count
parameter is false. Otherwise, it will execute a count query against the selected endpoint which will return an object with a count
property holding the sum of the found items. The count queries can be filtered with where parameters.
IGDBEndpointException
is thrown if a non-successful response code is recieved from the IGDB API. To find out how to handle request errors, head to the Handle Request Errors section.
Please refer to the return values section for more details about the return values of these methods.
\nFor the endpoint specific fields that the API returns please refer to the IGDB documentation's respective paragraph. Each endpoint has a direct link!
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":38},{"id":"dec8c3f","slug":"age-rating","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Age Rating","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Age Rating endpoint.\n\nEndpoint Description: Age Rating according to various rating organisations\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function age_rating(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Age Rating](https://api-docs.igdb.com/#age-rating) endpoint.\n\n**Endpoint Description**: Age Rating according to various rating organisations\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nage_rating($query, $count);\n\n?>\n```","html":"public function age_rating(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Age Rating endpoint.
\nEndpoint Description: Age Rating according to various rating organisations
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Age Rating endpoint method\n $igdb->age_rating($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":39},{"id":"df10452","slug":"age-rating-content-description","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Age Rating Content Description","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Age Rating Content Description endpoint.\n\nEndpoint Description: Age Rating Descriptors\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function age_rating_content_description(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Age Rating Content Description](https://api-docs.igdb.com/#age-rating-content-description) endpoint.\n\n**Endpoint Description**: Age Rating Descriptors\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nage_rating_content_description($query, $count);\n\n?>\n```","html":"public function age_rating_content_description(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Age Rating Content Description endpoint.
\nEndpoint Description: Age Rating Descriptors
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Age Rating Content Description endpoint method\n $igdb->age_rating_content_description($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":40},{"id":"ef28a61","slug":"alternative-name","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Alternative Name","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Alternative Name endpoint.\n\nEndpoint Description: Alternative and international game titles\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function alternative_name(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Alternative Name](https://api-docs.igdb.com/#alternative-name) endpoint.\n\n**Endpoint Description**: Alternative and international game titles\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nalternative_name($query, $count);\n\n?>\n```","html":"public function alternative_name(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Alternative Name endpoint.
\nEndpoint Description: Alternative and international game titles
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Alternative Name endpoint method\n $igdb->alternative_name($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":41},{"id":"bd511a9","slug":"artwork","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Artwork","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Artwork endpoint.\n\nEndpoint Description: official artworks (resolution and aspect ratio may vary)\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function artwork(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Artwork](https://api-docs.igdb.com/#artwork) endpoint.\n\n**Endpoint Description**: official artworks (resolution and aspect ratio may vary)\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nartwork($query, $count);\n\n?>\n```","html":"public function artwork(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Artwork endpoint.
\nEndpoint Description: official artworks (resolution and aspect ratio may vary)
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Artwork endpoint method\n $igdb->artwork($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":42},{"id":"80c438e","slug":"character","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Character","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Character endpoint.\n\nEndpoint Description: Video game characters\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function character(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Character](https://api-docs.igdb.com/#character) endpoint.\n\n**Endpoint Description**: Video game characters\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncharacter($query, $count);\n\n?>\n```","html":"public function character(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Character endpoint.
\nEndpoint Description: Video game characters
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Character endpoint method\n $igdb->character($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":43},{"id":"58e8450","slug":"character-mug-shot","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Character Mug Shot","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Character Mug Shot endpoint.\n\nEndpoint Description: Images depicting game characters\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function character_mug_shot(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Character Mug Shot](https://api-docs.igdb.com/#character-mug-shot) endpoint.\n\n**Endpoint Description**: Images depicting game characters\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncharacter_mug_shot($query, $count);\n\n?>\n```","html":"public function character_mug_shot(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Character Mug Shot endpoint.
\nEndpoint Description: Images depicting game characters
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Character Mug Shot endpoint method\n $igdb->character_mug_shot($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":44},{"id":"7e9aa14","slug":"collection","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Collection","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Collection endpoint.\n\nEndpoint Description: Collection, AKA Series\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function collection(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Collection](https://api-docs.igdb.com/#collection) endpoint.\n\n**Endpoint Description**: Collection, AKA Series\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncollection($query, $count);\n\n?>\n```","html":"public function collection(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Collection endpoint.
\nEndpoint Description: Collection, AKA Series
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Collection endpoint method\n $igdb->collection($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":45},{"id":"6b3a503","slug":"collection-membership","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Collection Membership","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Collection Membership endpoint.\n\nEndpoint Description: The Collection Memberships.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function collection_membership(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Collection Membership](https://api-docs.igdb.com/#collection-membership) endpoint.\n\n**Endpoint Description**: The Collection Memberships.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncollection_membership($query, $count);\n\n?>\n```","html":"public function collection_membership(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Collection Membership endpoint.
\nEndpoint Description: The Collection Memberships.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Collection Membership endpoint method\n $igdb->collection_membership($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":46},{"id":"7622413","slug":"collection-membership-type","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Collection Membership Type","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Collection Membership Type endpoint.\n\nEndpoint Description: Enums for collection membership types.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function collection_membership_type(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Collection Membership Type](https://api-docs.igdb.com/#collection-membership-type) endpoint.\n\n**Endpoint Description**: Enums for collection membership types.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncollection_membership_type($query, $count);\n\n?>\n```","html":"public function collection_membership_type(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Collection Membership Type endpoint.
\nEndpoint Description: Enums for collection membership types.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Collection Membership Type endpoint method\n $igdb->collection_membership_type($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":47},{"id":"33962df","slug":"collection-relation","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Collection Relation","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Collection Relation endpoint.\n\nEndpoint Description: Describes Relationship between Collections.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function collection_relation(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Collection Relation](https://api-docs.igdb.com/#collection-relation) endpoint.\n\n**Endpoint Description**: Describes Relationship between Collections.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncollection_relation($query, $count);\n\n?>\n```","html":"public function collection_relation(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Collection Relation endpoint.
\nEndpoint Description: Describes Relationship between Collections.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Collection Relation endpoint method\n $igdb->collection_relation($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":48},{"id":"70906f1","slug":"collection-relation-type","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Collection Relation Type","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Collection Relation Type endpoint.\n\nEndpoint Description: Collection Relation Types\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function collection_relation_type(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Collection Relation Type](https://api-docs.igdb.com/#collection-relation-type) endpoint.\n\n**Endpoint Description**: Collection Relation Types\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncollection_relation_type($query, $count);\n\n?>\n```","html":"public function collection_relation_type(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Collection Relation Type endpoint.
\nEndpoint Description: Collection Relation Types
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Collection Relation Type endpoint method\n $igdb->collection_relation_type($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":49},{"id":"8999774","slug":"collection-type","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Collection Type","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Collection Type endpoint.\n\nEndpoint Description: Enums for collection types.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function collection_type(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Collection Type](https://api-docs.igdb.com/#collection-type) endpoint.\n\n**Endpoint Description**: Enums for collection types.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncollection_type($query, $count);\n\n?>\n```","html":"public function collection_type(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Collection Type endpoint.
\nEndpoint Description: Enums for collection types.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Collection Type endpoint method\n $igdb->collection_type($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":50},{"id":"299fb52","slug":"company","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Company","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Company endpoint.\n\nEndpoint Description: Video game companies. Both publishers & developers\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function company(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Company](https://api-docs.igdb.com/#company) endpoint.\n\n**Endpoint Description**: Video game companies. Both publishers & developers\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncompany($query, $count);\n\n?>\n```","html":"public function company(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Company endpoint.
\nEndpoint Description: Video game companies. Both publishers & developers
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Company endpoint method\n $igdb->company($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":51},{"id":"4141062","slug":"company-logo","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Company Logo","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Company Logo endpoint.\n\nEndpoint Description: The logos of developers and publishers\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function company_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Company Logo](https://api-docs.igdb.com/#company-logo) endpoint.\n\n**Endpoint Description**: The logos of developers and publishers\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncompany_logo($query, $count);\n\n?>\n```","html":"public function company_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Company Logo endpoint.
\nEndpoint Description: The logos of developers and publishers
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Company Logo endpoint method\n $igdb->company_logo($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":52},{"id":"a2eec3c","slug":"company-website","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Company Website","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Company Website endpoint.\n\nEndpoint Description: Company Website\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function company_website(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Company Website](https://api-docs.igdb.com/#company-website) endpoint.\n\n**Endpoint Description**: Company Website\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncompany_website($query, $count);\n\n?>\n```","html":"public function company_website(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Company Website endpoint.
\nEndpoint Description: Company Website
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Company Website endpoint method\n $igdb->company_website($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":53},{"id":"6ddfbfb","slug":"cover","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Cover","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Cover endpoint.\n\nEndpoint Description: The cover art of games\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function cover(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Cover](https://api-docs.igdb.com/#cover) endpoint.\n\n**Endpoint Description**: The cover art of games\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ncover($query, $count);\n\n?>\n```","html":"public function cover(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Cover endpoint.
\nEndpoint Description: The cover art of games
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Cover endpoint method\n $igdb->cover($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":54},{"id":"4cbda9a","slug":"event","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Event","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Event endpoint.\n\nEndpoint Description: Gaming event like GamesCom, Tokyo Game Show, PAX or GSL\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function event(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Event](https://api-docs.igdb.com/#event) endpoint.\n\n**Endpoint Description**: Gaming event like GamesCom, Tokyo Game Show, PAX or GSL\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nevent($query, $count);\n\n?>\n```","html":"public function event(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Event endpoint.
\nEndpoint Description: Gaming event like GamesCom, Tokyo Game Show, PAX or GSL
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Event endpoint method\n $igdb->event($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":55},{"id":"9dd4ccb","slug":"event-logo","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Event Logo","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Event Logo endpoint.\n\nEndpoint Description: Logo for the event\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function event_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Event Logo](https://api-docs.igdb.com/#event-logo) endpoint.\n\n**Endpoint Description**: Logo for the event\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nevent_logo($query, $count);\n\n?>\n```","html":"public function event_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Event Logo endpoint.
\nEndpoint Description: Logo for the event
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Event Logo endpoint method\n $igdb->event_logo($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":56},{"id":"6be76dd","slug":"event-network","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Event Network","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Event Network endpoint.\n\nEndpoint Description: Urls related to the event like twitter, facebook and youtube\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function event_network(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Event Network](https://api-docs.igdb.com/#event-network) endpoint.\n\n**Endpoint Description**: Urls related to the event like twitter, facebook and youtube\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nevent_network($query, $count);\n\n?>\n```","html":"public function event_network(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Event Network endpoint.
\nEndpoint Description: Urls related to the event like twitter, facebook and youtube
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Event Network endpoint method\n $igdb->event_network($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":57},{"id":"202fadd","slug":"external-game","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"External Game","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the External Game endpoint.\n\nEndpoint Description: Game IDs on other services\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function external_game(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [External Game](https://api-docs.igdb.com/#external-game) endpoint.\n\n**Endpoint Description**: Game IDs on other services\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nexternal_game($query, $count);\n\n?>\n```","html":"public function external_game(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the External Game endpoint.
\nEndpoint Description: Game IDs on other services
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // External Game endpoint method\n $igdb->external_game($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":58},{"id":"e11e6bd","slug":"franchise","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Franchise","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Franchise endpoint.\n\nEndpoint Description: A list of video game franchises such as Star Wars.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function franchise(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Franchise](https://api-docs.igdb.com/#franchise) endpoint.\n\n**Endpoint Description**: A list of video game franchises such as Star Wars.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nfranchise($query, $count);\n\n?>\n```","html":"public function franchise(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Franchise endpoint.
\nEndpoint Description: A list of video game franchises such as Star Wars.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Franchise endpoint method\n $igdb->franchise($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":59},{"id":"2f3ec6b","slug":"game","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game endpoint.\n\nEndpoint Description: Video Games!\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function game(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game](https://api-docs.igdb.com/#game) endpoint.\n\n**Endpoint Description**: Video Games!\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame($query, $count);\n\n?>\n```","html":"public function game(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game endpoint.
\nEndpoint Description: Video Games!
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game endpoint method\n $igdb->game($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":60},{"id":"c5d47de","slug":"game-engine","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Engine","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Engine endpoint.\n\nEndpoint Description: Video game engines such as unreal engine.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function game_engine(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Engine](https://api-docs.igdb.com/#game-engine) endpoint.\n\n**Endpoint Description**: Video game engines such as unreal engine.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_engine($query, $count);\n\n?>\n```","html":"public function game_engine(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Engine endpoint.
\nEndpoint Description: Video game engines such as unreal engine.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Engine endpoint method\n $igdb->game_engine($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":61},{"id":"2b61696","slug":"game-engine-logo","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Engine Logo","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Engine Logo endpoint.\n\nEndpoint Description: The logos of game engines\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function game_engine_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Engine Logo](https://api-docs.igdb.com/#game-engine-logo) endpoint.\n\n**Endpoint Description**: The logos of game engines\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_engine_logo($query, $count);\n\n?>\n```","html":"public function game_engine_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Engine Logo endpoint.
\nEndpoint Description: The logos of game engines
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Engine Logo endpoint method\n $igdb->game_engine_logo($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":62},{"id":"cff0478","slug":"game-localization","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Localization","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Localization endpoint.\n\nEndpoint Description: Game localization for a game\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function game_localization(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Localization](https://api-docs.igdb.com/#game-localization) endpoint.\n\n**Endpoint Description**: Game localization for a game\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_localization($query, $count);\n\n?>\n```","html":"public function game_localization(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Localization endpoint.
\nEndpoint Description: Game localization for a game
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Localization endpoint method\n $igdb->game_localization($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":63},{"id":"96984d3","slug":"game-mode","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Mode","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Mode endpoint.\n\nEndpoint Description: Single player, Multiplayer etc\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function game_mode(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Mode](https://api-docs.igdb.com/#game-mode) endpoint.\n\n**Endpoint Description**: Single player, Multiplayer etc\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_mode($query, $count);\n\n?>\n```","html":"public function game_mode(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Mode endpoint.
\nEndpoint Description: Single player, Multiplayer etc
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Mode endpoint method\n $igdb->game_mode($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":64},{"id":"3cbb2f9","slug":"game-version","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Version","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Version endpoint.\n\nEndpoint Description: Details about game editions and versions.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function game_version(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Version](https://api-docs.igdb.com/#game-version) endpoint.\n\n**Endpoint Description**: Details about game editions and versions.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_version($query, $count);\n\n?>\n```","html":"public function game_version(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Version endpoint.
\nEndpoint Description: Details about game editions and versions.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Version endpoint method\n $igdb->game_version($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":65},{"id":"4b88c69","slug":"game-version-feature","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Version Feature","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Version Feature endpoint.\n\nEndpoint Description: Features and descriptions of what makes each version/edition different from the main game\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function game_version_feature(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Version Feature](https://api-docs.igdb.com/#game-version-feature) endpoint.\n\n**Endpoint Description**: Features and descriptions of what makes each version/edition different from the main game\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_version_feature($query, $count);\n\n?>\n```","html":"public function game_version_feature(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Version Feature endpoint.
\nEndpoint Description: Features and descriptions of what makes each version/edition different from the main game
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Version Feature endpoint method\n $igdb->game_version_feature($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":66},{"id":"9ac2c22","slug":"game-version-feature-value","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Version Feature Value","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Version Feature Value endpoint.\n\nEndpoint Description: The bool/text value of the feature\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function game_version_feature_value(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Version Feature Value](https://api-docs.igdb.com/#game-version-feature-value) endpoint.\n\n**Endpoint Description**: The bool/text value of the feature\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_version_feature_value($query, $count);\n\n?>\n```","html":"public function game_version_feature_value(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Version Feature Value endpoint.
\nEndpoint Description: The bool/text value of the feature
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Version Feature Value endpoint method\n $igdb->game_version_feature_value($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":67},{"id":"59ffba6","slug":"game-video","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Game Video","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Game Video endpoint.\n\nEndpoint Description: A video associated with a game\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function game_video(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Game Video](https://api-docs.igdb.com/#game-video) endpoint.\n\n**Endpoint Description**: A video associated with a game\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngame_video($query, $count);\n\n?>\n```","html":"public function game_video(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Game Video endpoint.
\nEndpoint Description: A video associated with a game
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Game Video endpoint method\n $igdb->game_video($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":68},{"id":"182baa8","slug":"genre","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Genre","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Genre endpoint.\n\nEndpoint Description: Genres of video game\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function genre(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Genre](https://api-docs.igdb.com/#genre) endpoint.\n\n**Endpoint Description**: Genres of video game\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ngenre($query, $count);\n\n?>\n```","html":"public function genre(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Genre endpoint.
\nEndpoint Description: Genres of video game
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Genre endpoint method\n $igdb->genre($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":69},{"id":"ab92e48","slug":"involved-company","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Involved Company","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Involved Company endpoint.\n\nEndpoint Description:\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function involved_company(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Involved Company](https://api-docs.igdb.com/#involved-company) endpoint.\n\n**Endpoint Description**: \n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ninvolved_company($query, $count);\n\n?>\n```","html":"public function involved_company(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Involved Company endpoint.
\nEndpoint Description:
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Involved Company endpoint method\n $igdb->involved_company($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":70},{"id":"f09333f","slug":"keyword","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Keyword","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Keyword endpoint.\n\nEndpoint Description: Keywords are words or phrases that get tagged to a game such as \"world war 2\" or \"steampunk\".\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function keyword(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Keyword](https://api-docs.igdb.com/#keyword) endpoint.\n\n**Endpoint Description**: Keywords are words or phrases that get tagged to a game such as "world war 2" or "steampunk".\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nkeyword($query, $count);\n\n?>\n```","html":"public function keyword(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Keyword endpoint.
\nEndpoint Description: Keywords are words or phrases that get tagged to a game such as \"world war 2\" or \"steampunk\".
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Keyword endpoint method\n $igdb->keyword($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":71},{"id":"5d740a7","slug":"language","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Language","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Language endpoint.\n\nEndpoint Description: Languages that are used in the Language Support endpoint.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function language(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Language](https://api-docs.igdb.com/#language) endpoint.\n\n**Endpoint Description**: Languages that are used in the Language Support endpoint.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nlanguage($query, $count);\n\n?>\n```","html":"public function language(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Language endpoint.
\nEndpoint Description: Languages that are used in the Language Support endpoint.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Language endpoint method\n $igdb->language($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":72},{"id":"33a992f","slug":"language-support","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Language Support","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Language Support endpoint.\n\nEndpoint Description: Games can be played with different languages for voice acting, subtitles, or the interface language.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function language_support(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Language Support](https://api-docs.igdb.com/#language-support) endpoint.\n\n**Endpoint Description**: Games can be played with different languages for voice acting, subtitles, or the interface language.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nlanguage_support($query, $count);\n\n?>\n```","html":"public function language_support(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Language Support endpoint.
\nEndpoint Description: Games can be played with different languages for voice acting, subtitles, or the interface language.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Language Support endpoint method\n $igdb->language_support($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":73},{"id":"4bd0a18","slug":"multiplayer-mode","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Multiplayer Mode","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Multiplayer Mode endpoint.\n\nEndpoint Description: Data about the supported multiplayer types\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function multiplayer_mode(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Multiplayer Mode](https://api-docs.igdb.com/#multiplayer-mode) endpoint.\n\n**Endpoint Description**: Data about the supported multiplayer types\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nmultiplayer_mode($query, $count);\n\n?>\n```","html":"public function multiplayer_mode(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Multiplayer Mode endpoint.
\nEndpoint Description: Data about the supported multiplayer types
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Multiplayer Mode endpoint method\n $igdb->multiplayer_mode($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565562,"version":0},"$loki":74},{"id":"6a55946","slug":"platform","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform endpoint.\n\nEndpoint Description: The hardware used to run the game or game delivery network\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function platform(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform](https://api-docs.igdb.com/#platform) endpoint.\n\n**Endpoint Description**: The hardware used to run the game or game delivery network\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform($query, $count);\n\n?>\n```","html":"public function platform(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform endpoint.
\nEndpoint Description: The hardware used to run the game or game delivery network
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform endpoint method\n $igdb->platform($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":75},{"id":"c26847e","slug":"language-support-type","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Language Support Type","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Language Support Type endpoint.\n\nEndpoint Description: Language Support Types contains the identifiers for the support types that Language Support uses.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function language_support_type(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Language Support Type](https://api-docs.igdb.com/#language-support-type) endpoint.\n\n**Endpoint Description**: Language Support Types contains the identifiers for the support types that Language Support uses.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nlanguage_support_type($query, $count);\n\n?>\n```","html":"public function language_support_type(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Language Support Type endpoint.
\nEndpoint Description: Language Support Types contains the identifiers for the support types that Language Support uses.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Language Support Type endpoint method\n $igdb->language_support_type($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":76},{"id":"21558e9","slug":"platform-family","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform Family","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform Family endpoint.\n\nEndpoint Description: A collection of closely related platforms\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function platform_family(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform Family](https://api-docs.igdb.com/#platform-family) endpoint.\n\n**Endpoint Description**: A collection of closely related platforms\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform_family($query, $count);\n\n?>\n```","html":"public function platform_family(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform Family endpoint.
\nEndpoint Description: A collection of closely related platforms
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform Family endpoint method\n $igdb->platform_family($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":77},{"id":"3f1f69c","slug":"network-type","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Network Type","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Network Type endpoint.\n\nEndpoint Description: Social networks related to the event like twitter, facebook and youtube\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function network_type(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Network Type](https://api-docs.igdb.com/#network-type) endpoint.\n\n**Endpoint Description**: Social networks related to the event like twitter, facebook and youtube\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nnetwork_type($query, $count);\n\n?>\n```","html":"public function network_type(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Network Type endpoint.
\nEndpoint Description: Social networks related to the event like twitter, facebook and youtube
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Network Type endpoint method\n $igdb->network_type($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":78},{"id":"7448df9","slug":"platform-logo","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform Logo","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform Logo endpoint.\n\nEndpoint Description: Logo for a platform\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function platform_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform Logo](https://api-docs.igdb.com/#platform-logo) endpoint.\n\n**Endpoint Description**: Logo for a platform\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform_logo($query, $count);\n\n?>\n```","html":"public function platform_logo(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform Logo endpoint.
\nEndpoint Description: Logo for a platform
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform Logo endpoint method\n $igdb->platform_logo($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":79},{"id":"26c0c2f","slug":"platform-version-company","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform Version Company","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform Version Company endpoint.\n\nEndpoint Description: A platform developer\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function platform_version_company(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform Version Company](https://api-docs.igdb.com/#platform-version-company) endpoint.\n\n**Endpoint Description**: A platform developer\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform_version_company($query, $count);\n\n?>\n```","html":"public function platform_version_company(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform Version Company endpoint.
\nEndpoint Description: A platform developer
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform Version Company endpoint method\n $igdb->platform_version_company($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":80},{"id":"fd4b00d","slug":"platform-version","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform Version","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform Version endpoint.\n\nEndpoint Description:\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function platform_version(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform Version](https://api-docs.igdb.com/#platform-version) endpoint.\n\n**Endpoint Description**: \n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform_version($query, $count);\n\n?>\n```","html":"public function platform_version(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform Version endpoint.
\nEndpoint Description:
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform Version endpoint method\n $igdb->platform_version($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":81},{"id":"2a0f2e3","slug":"platform-website","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform Website","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform Website endpoint.\n\nEndpoint Description: The main website for the platform\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function platform_website(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform Website](https://api-docs.igdb.com/#platform-website) endpoint.\n\n**Endpoint Description**: The main website for the platform\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform_website($query, $count);\n\n?>\n```","html":"public function platform_website(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform Website endpoint.
\nEndpoint Description: The main website for the platform
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform Website endpoint method\n $igdb->platform_website($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":82},{"id":"0fc5bf3","slug":"platform-version-release-date","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Platform Version Release Date","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Platform Version Release Date endpoint.\n\nEndpoint Description: A handy endpoint that extends platform release dates. Used to dig deeper into release dates, platforms and versions.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function platform_version_release_date(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Platform Version Release Date](https://api-docs.igdb.com/#platform-version-release-date) endpoint.\n\n**Endpoint Description**: A handy endpoint that extends platform release dates. Used to dig deeper into release dates, platforms and versions.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplatform_version_release_date($query, $count);\n\n?>\n```","html":"public function platform_version_release_date(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Platform Version Release Date endpoint.
\nEndpoint Description: A handy endpoint that extends platform release dates. Used to dig deeper into release dates, platforms and versions.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Platform Version Release Date endpoint method\n $igdb->platform_version_release_date($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":83},{"id":"946855e","slug":"player-perspective","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Player Perspective","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Player Perspective endpoint.\n\nEndpoint Description: Player perspectives describe the view/perspective of the player in a video game.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function player_perspective(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Player Perspective](https://api-docs.igdb.com/#player-perspective) endpoint.\n\n**Endpoint Description**: Player perspectives describe the view/perspective of the player in a video game.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nplayer_perspective($query, $count);\n\n?>\n```","html":"public function player_perspective(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Player Perspective endpoint.
\nEndpoint Description: Player perspectives describe the view/perspective of the player in a video game.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Player Perspective endpoint method\n $igdb->player_perspective($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":84},{"id":"d9117e1","slug":"region","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Region","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Region endpoint.\n\nEndpoint Description: Region for game localization\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function region(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Region](https://api-docs.igdb.com/#region) endpoint.\n\n**Endpoint Description**: Region for game localization\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nregion($query, $count);\n\n?>\n```","html":"public function region(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Region endpoint.
\nEndpoint Description: Region for game localization
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Region endpoint method\n $igdb->region($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":85},{"id":"204b21c","slug":"release-date","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Release Date","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Release Date endpoint.\n\nEndpoint Description: A handy endpoint that extends game release dates. Used to dig deeper into release dates, platforms and versions.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function release_date(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Release Date](https://api-docs.igdb.com/#release-date) endpoint.\n\n**Endpoint Description**: A handy endpoint that extends game release dates. Used to dig deeper into release dates, platforms and versions.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nrelease_date($query, $count);\n\n?>\n```","html":"public function release_date(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Release Date endpoint.
\nEndpoint Description: A handy endpoint that extends game release dates. Used to dig deeper into release dates, platforms and versions.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Release Date endpoint method\n $igdb->release_date($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":86},{"id":"292c41b","slug":"release-date-status","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Release Date Status","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Release Date Status endpoint.\n\nEndpoint Description: An endpoint to provide definition of all of the current release date statuses.\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function release_date_status(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Release Date Status](https://api-docs.igdb.com/#release-date-status) endpoint.\n\n**Endpoint Description**: An endpoint to provide definition of all of the current release date statuses.\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nrelease_date_status($query, $count);\n\n?>\n```","html":"public function release_date_status(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Release Date Status endpoint.
\nEndpoint Description: An endpoint to provide definition of all of the current release date statuses.
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Release Date Status endpoint method\n $igdb->release_date_status($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":87},{"id":"f67ed58","slug":"screenshot","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Screenshot","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Screenshot endpoint.\n\nEndpoint Description: Screenshots of games\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function screenshot(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Screenshot](https://api-docs.igdb.com/#screenshot) endpoint.\n\n**Endpoint Description**: Screenshots of games\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nscreenshot($query, $count);\n\n?>\n```","html":"public function screenshot(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Screenshot endpoint.
\nEndpoint Description: Screenshots of games
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Screenshot endpoint method\n $igdb->screenshot($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":88},{"id":"67b3635","slug":"search-ii","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Search","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Search endpoint.\n\nEndpoint Description:\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function search(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Search](https://api-docs.igdb.com/#search) endpoint.\n\n**Endpoint Description**: \n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nsearch($query, $count);\n\n?>\n```","html":"public function search(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Search endpoint.
\nEndpoint Description:
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Search endpoint method\n $igdb->search($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":89},{"id":"20792d4","slug":"theme","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Theme","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Theme endpoint.\n\nEndpoint Description: Video game themes\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function theme(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Theme](https://api-docs.igdb.com/#theme) endpoint.\n\n**Endpoint Description**: Video game themes\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\ntheme($query, $count);\n\n?>\n```","html":"public function theme(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Theme endpoint.
\nEndpoint Description: Video game themes
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Theme endpoint method\n $igdb->theme($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":90},{"id":"f8262e8","slug":"website","level":3,"parent":"cbf8ecb","parents":["cbf8ecb","29c37ba"],"title":"Website","date":null,"timestamp":null,"body":{"stripped":"Fetching data from IGDB API using the Website endpoint.\n\nEndpoint Description: A website url, usually associated with a game\n\nParameters:\n\n$query: an apicalypse formatted query String\n\n$count: whether the request should return the number of matches instead of the actual resultset\n\nReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count parameter.","markdown":"```php\npublic function website(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n```\n\nFetching data from IGDB API using the [Website](https://api-docs.igdb.com/#website) endpoint.\n\n**Endpoint Description**: A website url, usually associated with a game\n\n**Parameters**:\n - `$query`: an apicalypse formatted query String\n - `$count`: whether the request should return the number of matches instead of the actual resultset\n\n**Returns**: either the resultset as an array of objects, or a single object with a count property. Depends on the second `$count` parameter.\n\n```php\nwebsite($query, $count);\n\n?>\n```","html":"public function website(string $query, boolean $count = false) throws IGDBEndpointException: mixed\n
\nFetching data from IGDB API using the Website endpoint.
\nEndpoint Description: A website url, usually associated with a game
\nParameters:
\n$query
: an apicalypse formatted query String$count
: whether the request should return the number of matches instead of the actual resultsetReturns: either the resultset as an array of objects, or a single object with a count property. Depends on the second $count
parameter.
<?php\n\n // Website endpoint method\n $igdb->website($query, $count);\n\n?>\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":91},{"id":"cf8a7d3","slug":"multiquery","level":2,"parent":"cbf8ecb","parents":["cbf8ecb"],"title":"MultiQuery","date":null,"timestamp":null,"body":{"stripped":"This method executes a query against the multiquery endpoint. With this functionality one is able to execute multiple queries in a single request.\n\n:warning If you are using the Query Builder to construct your queries, the parameters name and endpoint are mandatory! There is also a third optional parameter count. If any of the mandatory parameters are missing for the multiquery, an IGDBInvalidParameterException is thrown! Please refer to the build method for more information!\n\nParameters\n\n$queries: an array of apicalypse formatted multiquery query strings.\n\nReturns: the response from the IGDB endpoint. The result object can vary depending on your query.\n\n\n\nThe result of the query:","markdown":"```php\npublic function multiquery(array $queries) throws IGDBEndpointException, IGDBInvalidParameterException: mixed\n```\n\nThis method executes a query against the `multiquery` endpoint. With this functionality one is able to execute multiple queries in a single request.\n\n> :warning If you are using the [Query Builder](#igdb-query-builder) to construct your queries, the parameters [`name`](#name) and [`endpoint`](#endpoint) are **mandatory**! There is also a third optional parameter [`count`](#count). If any of the mandatory parameters are missing for the multiquery, an `IGDBInvalidParameterException` is thrown! Please refer to the [`build`](#building-the-query) method for more information!\n\n**Parameters**\n - `$queries`: an array of apicalypse formatted multiquery query strings.\n\n**Returns**: the response from the IGDB endpoint. The result object can vary depending on your query.\n\n```php\nname(\"Main Game\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\")\n ->build(true);\n\n // building the bundle query\n $bundle = $bundle_builder\n ->name(\"Bundles\")\n ->endpoint(\"game\")\n ->fields(\"id,name,version_parent,category\")\n ->where(\"version_parent = 25076\")\n ->where(\"category = 0\")\n ->build(true);\n\n // the query can be passed as a string too\n\n // $main = \"query games \\\"Main Game\\\" {\n // fields id,name;\n // where id = 25076;\n // };\";\n\n // $bundle = \"query games \\\"Bundles\\\" {\n // fields id,name,version_parent,category;\n // where version_parent = 25076 & category = 0;\n // };\";\n\n // passing the queries to the multiquery method as an array of strings\n var_dump(\n $igdb->multiquery(\n array($main, $bundle)\n )\n );\n } catch (IGDBInvaliParameterException $e) {\n // a builder property is invalid\n echo $e->getMessage();\n } catch (IGDBEndpointException $e) {\n // something went wront with the query\n echo $e->getMessage();\n }\n?>\n```\nThe result of the query:\n\n```text\narray (size=2)\n 0 =>\n object(stdClass)[4]\n public 'name' => string 'Main Game' (length=9)\n public 'result' =>\n array (size=1)\n 0 =>\n object(stdClass)[5]\n public 'id' => int 25076\n public 'name' => string 'Red Dead Redemption 2' (length=21)\n 1 =>\n object(stdClass)[6]\n public 'name' => string 'Bundles' (length=7)\n public 'result' =>\n array (size=3)\n 0 =>\n object(stdClass)[7]\n public 'id' => int 103207\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Collector's Box' (length=38)\n public 'version_parent' => int 25076\n 1 =>\n object(stdClass)[8]\n public 'id' => int 103206\n public 'category' => int 0\n public 'name' => string 'Red dead Redemption 2: Ultimate Edition' (length=39)\n public 'version_parent' => int 25076\n 2 =>\n object(stdClass)[9]\n public 'id' => int 103205\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Special Edition' (length=38)\n public 'version_parent' => int 25076\n```","html":"public function multiquery(array $queries) throws IGDBEndpointException, IGDBInvalidParameterException: mixed\n
\nThis method executes a query against the multiquery
endpoint. With this functionality one is able to execute multiple queries in a single request.
\n\n:warning If you are using the Query Builder to construct your queries, the parameters
\nname
andendpoint
are mandatory! There is also a third optional parametercount
. If any of the mandatory parameters are missing for the multiquery, anIGDBInvalidParameterException
is thrown! Please refer to thebuild
method for more information!
Parameters
\n$queries
: an array of apicalypse formatted multiquery query strings.Returns: the response from the IGDB endpoint. The result object can vary depending on your query.
\n<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // query builder for the main game\n $main_builder = new IGDBQueryBuilder();\n\n // query builder for the bundles\n $bundle_builder = new IGDBQueryBuilder();\n\n try {\n // building the main game query\n $main = $main_builder\n ->name(\"Main Game\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\")\n ->build(true);\n\n // building the bundle query\n $bundle = $bundle_builder\n ->name(\"Bundles\")\n ->endpoint(\"game\")\n ->fields(\"id,name,version_parent,category\")\n ->where(\"version_parent = 25076\")\n ->where(\"category = 0\")\n ->build(true);\n\n // the query can be passed as a string too\n\n // $main = \"query games \\\"Main Game\\\" {\n // fields id,name;\n // where id = 25076;\n // };\";\n\n // $bundle = \"query games \\\"Bundles\\\" {\n // fields id,name,version_parent,category;\n // where version_parent = 25076 & category = 0;\n // };\";\n\n // passing the queries to the multiquery method as an array of strings\n var_dump(\n $igdb->multiquery(\n array($main, $bundle)\n )\n );\n } catch (IGDBInvaliParameterException $e) {\n // a builder property is invalid\n echo $e->getMessage();\n } catch (IGDBEndpointException $e) {\n // something went wront with the query\n echo $e->getMessage();\n }\n?>\n
\nThe result of the query:
\narray (size=2)\n 0 =>\n object(stdClass)[4]\n public 'name' => string 'Main Game' (length=9)\n public 'result' =>\n array (size=1)\n 0 =>\n object(stdClass)[5]\n public 'id' => int 25076\n public 'name' => string 'Red Dead Redemption 2' (length=21)\n 1 =>\n object(stdClass)[6]\n public 'name' => string 'Bundles' (length=7)\n public 'result' =>\n array (size=3)\n 0 =>\n object(stdClass)[7]\n public 'id' => int 103207\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Collector's Box' (length=38)\n public 'version_parent' => int 25076\n 1 =>\n object(stdClass)[8]\n public 'id' => int 103206\n public 'category' => int 0\n public 'name' => string 'Red dead Redemption 2: Ultimate Edition' (length=39)\n public 'version_parent' => int 25076\n 2 =>\n object(stdClass)[9]\n public 'id' => int 103205\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Special Edition' (length=38)\n public 'version_parent' => int 25076\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":92},{"id":"a68dee9","slug":"return-values","level":2,"parent":"cbf8ecb","parents":["cbf8ecb"],"title":"Return Values","date":null,"timestamp":null,"body":{"stripped":"Every endpoint method can return two different type of results, depending on the second parameter passed to them.\n\nBy default the second $count parameter is a boolean false. this means, that the query will be executed against the IGDB, returning a $result array of objects.\n\n\n\nThe result of the query above:\n\n\n\nIf you pass a boolean true as a second parameter, then you will get an object with a count property containing the item count from the selected endpoint filtered by the $query filters.\n\n\n\nThe result of the query above:\n\n\n\nThe result object's properties will vary depending on the provided field list in the $query. From the example result above you can see, the result holds an array, containing two elements. Every element of the result array is an object, containing properties with name of the fields from the fields parameter.","markdown":"Every endpoint method can return two different type of results, depending on the second parameter passed to them.\n\nBy default the second `$count` parameter is a boolean `false`. this means, that the query will be executed against the IGDB, returning a `$result` **array of objects**.\n\n```php\ngame(\"fields id,name; where id = (1,2);\");\n\n?>\n```\n\nThe result of the query above:\n\n```text\narray (size=2)\n 0 =>\n object(stdClass)[2]\n public 'id' => int 1\n public 'name' => string 'Thief II: The Metal Age' (length=23)\n 1 =>\n object(stdClass)[3]\n public 'id' => int 2\n public 'name' => string 'Thief: The Dark Project' (length=23)\n```\n\nIf you pass a boolean `true` as a second parameter, then you will get an object with a `count` property containing the item count from the selected endpoint filtered by the `$query` filters.\n\n```php\ngame(\"fields id,name; where id = (1,2);\", true);\n\n?>\n```\n\nThe result of the query above:\n```text\nobject(stdClass)[3]\n public 'count' => int 2\n```\n\nThe result object's properties will vary depending on the provided field list in the `$query`. From the example result above you can see, the result holds an array, containing two elements. Every element of the result array is an object, containing properties with name of the fields from the `fields` parameter.","html":"Every endpoint method can return two different type of results, depending on the second parameter passed to them.
\nBy default the second $count
parameter is a boolean false
. this means, that the query will be executed against the IGDB, returning a $result
array of objects.
<?php\n\n // a query against the game endpoint without a $count parameter\n $igdb->game(\"fields id,name; where id = (1,2);\");\n\n?>\n
\nThe result of the query above:
\narray (size=2)\n 0 =>\n object(stdClass)[2]\n public 'id' => int 1\n public 'name' => string 'Thief II: The Metal Age' (length=23)\n 1 =>\n object(stdClass)[3]\n public 'id' => int 2\n public 'name' => string 'Thief: The Dark Project' (length=23)\n
\nIf you pass a boolean true
as a second parameter, then you will get an object with a count
property containing the item count from the selected endpoint filtered by the $query
filters.
<?php\n // a query against the game endpoint with a second true parameter\n // note the second boolean true parameter\n $igdb->game(\"fields id,name; where id = (1,2);\", true);\n\n?>\n
\nThe result of the query above:
\nobject(stdClass)[3]\n public 'count' => int 2\n
\nThe result object's properties will vary depending on the provided field list in the $query
. From the example result above you can see, the result holds an array, containing two elements. Every element of the result array is an object, containing properties with name of the fields from the fields
parameter.
A utility class to help with some tasks.
\n\n"},"icon":"fa-tools","overview":"Utility tools for making the job easier with the IGDB API","meta":{"revision":0,"created":1699570565563,"version":0},"$loki":94},{"id":"ed871fa","slug":"authenticate","level":2,"parent":"120f8ce","parents":["120f8ce"],"title":"Authenticate","date":null,"timestamp":null,"body":{"stripped":"A helper method to generate your access_token. This method will send a post request to the Twitch API with your client_id and client_secret.\n\nParameters:\n\n$client_id: your client id\n\n$client_secret: the client secret generated by twitch\n\nRetunrs: an object decoded from the response from the Twitch API containing three keys: access_token, expires_in and token_type.\n\nIf a non-successful response is recieved from Twitch, an Exception is thrown.\n\n\n\nThe output of the method will contain your new access_token:","markdown":"```php\npublic static function authenticate(string $client_id, string $client_secret) throws Exception: object\n```\n\nA helper method to generate your `access_token`. This method will send a post request to the Twitch API with your `client_id` and `client_secret`.\n\n**Parameters**:\n - `$client_id`: your client id\n - `$client_secret`: the client secret generated by twitch\n\n**Retunrs**: an object decoded from the response from the Twitch API containing three keys: `access_token`, `expires_in` and `token_type`.\n\nIf a non-successful response is recieved from Twitch, an `Exception` is thrown.\n\n```php\ngetMessage();\n }\n\n?>\n```\n\nThe output of the method will contain your new `access_token`:\n\n```text\nobject(stdClass)[1]\n public 'access_token' => string 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' (length=30)\n public 'expires_in' => int 5269900\n public 'token_type' => string 'bearer' (length=6)\n```","html":"The methods in this class are static, therefore you can use them with the double colon syntax.
\n
public static function authenticate(string $client_id, string $client_secret) throws Exception: object\n
\nA helper method to generate your access_token
. This method will send a post request to the Twitch API with your client_id
and client_secret
.
Parameters:
\n$client_id
: your client id$client_secret
: the client secret generated by twitchRetunrs: an object decoded from the response from the Twitch API containing three keys: access_token
, expires_in
and token_type
.
If a non-successful response is recieved from Twitch, an Exception
is thrown.
<?php\n\n require_once \"class.igdb.php\";\n\n try {\n var_dump(IGDBUtils::authenticate(\"{client_id}\", \"{client_secret}\"));\n } catch (Exception $e) {\n // something went wrong\n echo $e->getMessage();\n }\n\n?>\n
\nThe output of the method will contain your new access_token
:
object(stdClass)[1]\n public 'access_token' => string 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' (length=30)\n public 'expires_in' => int 5269900\n public 'token_type' => string 'bearer' (length=6)\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":95},{"id":"38a7e63","slug":"image-url","level":2,"parent":"120f8ce","parents":["120f8ce"],"title":"Image URL","date":null,"timestamp":null,"body":{"stripped":"Get the URL of a specific sized image for a record.\n\nParameters:\n\n$image_id: the image_id of the image. Each image in the database has it's own id and image_id fields. You must use the image_id field!\n\n$size: the required size. Possible sizes:\n\ncover_small\n\ncover_small\\_2x\n\nscreenshot_med\n\nscreenshot_med\\_2x\n\ncover_big\n\ncover_big\\_2x\n\nlogo_med\n\nlogo_med\\_2x\n\nscreenshot_big\n\nscreenshot_big\\_2x\n\nscreenshot_huge\n\nscreenshot_huge\\_2x\n\nthumb\n\nthumb\\_2x\n\nmicro\n\nmicro\\_2x\n\n720p\n\n720p\\_2x\n\n1080p\n\n1080p\\_2x\n\nIf an invalid second parameter is passed, an IGDBInvalidParameterException will be thrown.\n\n\n\nThe script above will produce the output below:\n\n\n\nOn the last line you can see the 720p version of the image which is a valid url.","markdown":"```php\npublic static function image_url(string $image_id, string $size) throws IGDBInvalidParameterException: string\n```\n\nGet the URL of a specific sized image for a record.\n\n**Parameters**:\n - `$image_id`: the `image_id` of the image. Each image in the database has it's own `id` and `image_id` fields. You **must** use the `image_id` field!\n - `$size`: the required size. Possible sizes:\n - cover_small\n - cover_small_2x\n - screenshot_med\n - screenshot_med_2x\n - cover_big\n - cover_big_2x\n - logo_med\n - logo_med_2x\n - screenshot_big\n - screenshot_big_2x\n - screenshot_huge\n - screenshot_huge_2x\n - thumb\n - thumb_2x\n - micro\n - micro_2x\n - 720p\n - 720p_2x\n - 1080p\n - 1080p_2x\n\nIf an invalid second parameter is passed, an `IGDBInvalidParameterException` will be thrown.\n\n```php\ngame(\n $builder\n ->fields(\"id, name, artworks.*\")\n ->search(\"uncharted 4\")\n ->limit(1)\n ->build()\n );\n\n var_dump($result);\n\n // processing the first result's first artwork\n echo \"720p version: \" . IGDBUtils::image_url($result[0]->artworks[0]->image_id, \"720p\");\n } catch (IGDBInvalidParameterException $e) {\n // invalid parameter passed to the builder\n echo $e->getMessage();\n } catch (IGDBEndpointException $e) {\n // failed query\n echo $e->getMessage();\n }\n\n?>\n```\n\nThe script above will produce the output below:\n\n```text\narray (size=1)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 7331\n public 'artworks' =>\n array (size=5)\n 0 =>\n object(stdClass)[4]\n public 'id' => int 6303\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1059\n public 'image_id' => string 'ar4v3' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v3.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string 'ded76617-94df-a813-28cb-feffebeb9d36' (length=36)\n 1 =>\n object(stdClass)[5]\n public 'id' => int 6304\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1059\n public 'image_id' => string 'ar4v4' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v4.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string '5655acde-a94d-8aa5-8c35-2ef4bc2e965d' (length=36)\n 2 =>\n object(stdClass)[6]\n public 'id' => int 6305\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1060\n public 'image_id' => string 'ar4v5' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v5.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string '30441489-b264-70d7-2d26-86b7c1eb3d3a' (length=36)\n 3 =>\n object(stdClass)[7]\n public 'id' => int 6306\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1060\n public 'image_id' => string 'ar4v6' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v6.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string 'e8629a83-2452-ec8c-2388-f42c6ec21de5' (length=36)\n 4 =>\n object(stdClass)[8]\n public 'id' => int 6307\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1060\n public 'image_id' => string 'ar4v7' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v7.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string 'e0b49da1-76dd-a863-b499-30b7f0ae0c78' (length=36)\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n720p version: https://images.igdb.com/igdb/image/upload/t_720p/ar4v3.jpg\n```\n\nOn the last line you can see the 720p version of the image which is a valid url.","html":"public static function image_url(string $image_id, string $size) throws IGDBInvalidParameterException: string\n
\nGet the URL of a specific sized image for a record.
\nParameters:
\n$image_id
: the image_id
of the image. Each image in the database has it's own id
and image_id
fields. You must use the image_id
field!$size
: the required size. Possible sizes:\nIf an invalid second parameter is passed, an IGDBInvalidParameterException
will be thrown.
<?php\n\n require_once \"class.igdb.php\";\n\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n $builder = new IGDBQueryBuilder();\n\n try {\n $result = $igdb->game(\n $builder\n ->fields(\"id, name, artworks.*\")\n ->search(\"uncharted 4\")\n ->limit(1)\n ->build()\n );\n\n var_dump($result);\n\n // processing the first result's first artwork\n echo \"720p version: \" . IGDBUtils::image_url($result[0]->artworks[0]->image_id, \"720p\");\n } catch (IGDBInvalidParameterException $e) {\n // invalid parameter passed to the builder\n echo $e->getMessage();\n } catch (IGDBEndpointException $e) {\n // failed query\n echo $e->getMessage();\n }\n\n?>\n
\nThe script above will produce the output below:
\narray (size=1)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 7331\n public 'artworks' =>\n array (size=5)\n 0 =>\n object(stdClass)[4]\n public 'id' => int 6303\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1059\n public 'image_id' => string 'ar4v3' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v3.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string 'ded76617-94df-a813-28cb-feffebeb9d36' (length=36)\n 1 =>\n object(stdClass)[5]\n public 'id' => int 6304\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1059\n public 'image_id' => string 'ar4v4' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v4.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string '5655acde-a94d-8aa5-8c35-2ef4bc2e965d' (length=36)\n 2 =>\n object(stdClass)[6]\n public 'id' => int 6305\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1060\n public 'image_id' => string 'ar4v5' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v5.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string '30441489-b264-70d7-2d26-86b7c1eb3d3a' (length=36)\n 3 =>\n object(stdClass)[7]\n public 'id' => int 6306\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1060\n public 'image_id' => string 'ar4v6' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v6.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string 'e8629a83-2452-ec8c-2388-f42c6ec21de5' (length=36)\n 4 =>\n object(stdClass)[8]\n public 'id' => int 6307\n public 'alpha_channel' => boolean false\n public 'animated' => boolean false\n public 'game' => int 7331\n public 'height' => int 1060\n public 'image_id' => string 'ar4v7' (length=5)\n public 'url' => string '//images.igdb.com/igdb/image/upload/t_thumb/ar4v7.jpg' (length=53)\n public 'width' => int 1500\n public 'checksum' => string 'e0b49da1-76dd-a863-b499-30b7f0ae0c78' (length=36)\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n720p version: https://images.igdb.com/igdb/image/upload/t_720p/ar4v3.jpg\n
\nOn the last line you can see the 720p version of the image which is a valid url.
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":96},{"id":"7c0fcd6","slug":"examples","level":1,"parent":null,"parents":[],"title":"Examples","date":null,"timestamp":1669925801000,"body":{"stripped":"The examples in this section will try to cover most of the use cases of the wrapper.\n\n:tip To see your own tokens in the example codes set them up on the home page as described in Using the documentation section!","markdown":"The examples in this section will try to cover most of the use cases of the wrapper.\n\n>:tip To see your own tokens in the example codes set them up on the home page as described in [Using the documentation section](#using-the-documentation)!","html":"The examples in this section will try to cover most of the use cases of the wrapper.
\n\n"},"icon":"fa-code","overview":"Working examples, covering most of the functionalities of the wrapper","meta":{"revision":0,"created":1699570565563,"version":0},"$loki":97},{"id":"c892c4b","slug":"basic-example","level":2,"parent":"7c0fcd6","parents":["7c0fcd6"],"title":"Basic Example","date":null,"timestamp":null,"body":{"stripped":"A basic example to send your apicalypse query to the IGDB API.\n\nMake sure to place your endpoint method calls in a try...catch block to be able to catch errors!\n\nCode\n\n\n\nResult","markdown":"A basic example to send your apicalypse query to the IGDB API.\n\n> Make sure to place your [endpoint method](#endpoints) calls in a try...catch block to be able to catch errors!\n\n**Code**\n\n```php\ngame($query);\n\n // showing the results\n var_dump($games);\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n```\n\n**Result**\n\n```text\narray (size=5)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 125062\n public 'cover' => int 83686\n public 'name' => string 'Uncharted Ocean: Set Sail' (length=25)\n 1 =>\n object(stdClass)[4]\n public 'id' => int 19583\n public 'cover' => int 15883\n public 'name' => string 'Uncharted: Fight for Fortune' (length=28)\n 2 =>\n object(stdClass)[5]\n public 'id' => int 26193\n public 'cover' => int 85149\n public 'name' => string 'Uncharted: The Lost Legacy' (length=26)\n 3 =>\n object(stdClass)[6]\n public 'id' => int 19609\n public 'cover' => int 85164\n public 'name' => string 'Uncharted: Fortune Hunter' (length=25)\n 4 =>\n object(stdClass)[7]\n public 'id' => int 7331\n public 'cover' => int 81917\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n```","html":":tip To see your own tokens in the example codes set them up on the home page as described in Using the documentation section!
\n
A basic example to send your apicalypse query to the IGDB API.
\n\n\nMake sure to place your endpoint method calls in a try...catch block to be able to catch errors!
\n
Code
\n<?php\n\n // importing the wrapper\n require 'class.igdb.php';\n\n // instantiating the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // your query string\n $query = 'search \"uncharted\"; fields id,name,cover; limit 5; offset 10;';\n\n try {\n // executing the query\n $games = $igdb->game($query);\n\n // showing the results\n var_dump($games);\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n
\nResult
\narray (size=5)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 125062\n public 'cover' => int 83686\n public 'name' => string 'Uncharted Ocean: Set Sail' (length=25)\n 1 =>\n object(stdClass)[4]\n public 'id' => int 19583\n public 'cover' => int 15883\n public 'name' => string 'Uncharted: Fight for Fortune' (length=28)\n 2 =>\n object(stdClass)[5]\n public 'id' => int 26193\n public 'cover' => int 85149\n public 'name' => string 'Uncharted: The Lost Legacy' (length=26)\n 3 =>\n object(stdClass)[6]\n public 'id' => int 19609\n public 'cover' => int 85164\n public 'name' => string 'Uncharted: Fortune Hunter' (length=25)\n 4 =>\n object(stdClass)[7]\n public 'id' => int 7331\n public 'cover' => int 81917\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":98},{"id":"e6c295d","slug":"using-the-query-builder","level":2,"parent":"7c0fcd6","parents":["7c0fcd6"],"title":"Using the Query Builder","date":null,"timestamp":null,"body":{"stripped":"An example to see how to use the IGDB Query Builder to build the query strings.\n\nMake sure to place your query builder configuration and endpoint method calls in a try...catch block to be able to catch errors!\n\nCode\n\n\n\nResult","markdown":"An example to see how to use the [IGDB Query Builder](#igdb-query-builder) to build the query strings.\n\n> Make sure to place your [query builder configuration](#configuring-methods) and [endpoint method](#endpoints) calls in a try...catch block to be able to catch errors!\n\n**Code**\n\n```php\nsearch(\"uncharted\")\n // we want to see these fields in the results\n ->fields(\"id, name, cover\")\n // we only need maximum 5 results per query (pagination)\n ->limit(5)\n // we would like to show the third page; fetch the results from the tenth element (pagination)\n ->offset(10)\n // process the configuration and return a string\n ->build();\n\n // executing the query\n $games = $igdb->game($query);\n\n // showing the results\n var_dump($games);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n```\n\n**Result**\n\n```text\narray (size=5)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 125062\n public 'cover' => int 83686\n public 'name' => string 'Uncharted Ocean: Set Sail' (length=25)\n 1 =>\n object(stdClass)[4]\n public 'id' => int 19583\n public 'cover' => int 15883\n public 'name' => string 'Uncharted: Fight for Fortune' (length=28)\n 2 =>\n object(stdClass)[5]\n public 'id' => int 26193\n public 'cover' => int 85149\n public 'name' => string 'Uncharted: The Lost Legacy' (length=26)\n 3 =>\n object(stdClass)[6]\n public 'id' => int 19609\n public 'cover' => int 85164\n public 'name' => string 'Uncharted: Fortune Hunter' (length=25)\n 4 =>\n object(stdClass)[7]\n public 'id' => int 7331\n public 'cover' => int 81917\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n```","html":"An example to see how to use the IGDB Query Builder to build the query strings.
\n\n\nMake sure to place your query builder configuration and endpoint method calls in a try...catch block to be able to catch errors!
\n
Code
\n<?php\n\n // importing the wrapper\n require 'class.igdb.php';\n\n // instantiating the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // building the query\n $query = $builder\n // searching for games LIKE uncharted\n ->search(\"uncharted\")\n // we want to see these fields in the results\n ->fields(\"id, name, cover\")\n // we only need maximum 5 results per query (pagination)\n ->limit(5)\n // we would like to show the third page; fetch the results from the tenth element (pagination)\n ->offset(10)\n // process the configuration and return a string\n ->build();\n\n // executing the query\n $games = $igdb->game($query);\n\n // showing the results\n var_dump($games);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n
\nResult
\narray (size=5)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 125062\n public 'cover' => int 83686\n public 'name' => string 'Uncharted Ocean: Set Sail' (length=25)\n 1 =>\n object(stdClass)[4]\n public 'id' => int 19583\n public 'cover' => int 15883\n public 'name' => string 'Uncharted: Fight for Fortune' (length=28)\n 2 =>\n object(stdClass)[5]\n public 'id' => int 26193\n public 'cover' => int 85149\n public 'name' => string 'Uncharted: The Lost Legacy' (length=26)\n 3 =>\n object(stdClass)[6]\n public 'id' => int 19609\n public 'cover' => int 85164\n public 'name' => string 'Uncharted: Fortune Hunter' (length=25)\n 4 =>\n object(stdClass)[7]\n public 'id' => int 7331\n public 'cover' => int 81917\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":99},{"id":"4dc1f8f","slug":"query-builder-with-options","level":2,"parent":"7c0fcd6","parents":["7c0fcd6"],"title":"Query Builder with Options","date":null,"timestamp":null,"body":{"stripped":"The IGDB Query Builder still supports the legacy $options array to parameterize the query.\n\n:warning Using the Builder this way is not recommended as this functionality may be removed in future versions. Use the builder approach instead.\n\nCode\n\n\n\nResult","markdown":"The [IGDB Query Builder](#igdb-query-builder) still supports the legacy `$options` array to parameterize the query.\n\n>:warning Using the Builder this way is not recommended as this functionality may be removed in future versions. Use the [builder approach](#builder-approach) instead.\n\n**Code**\n\n```php\n \"uncharted\",\n // we want to see these fields in the results\n \"fields\" => array(\"id\", \"name\", \"cover\"),\n // we only need maximum 5 results per query (pagination)\n \"limit\" => 5,\n // we would like to show the third page; fetch the results from the tenth element (pagination)\n \"offset\" => 10\n );\n\n try {\n // adding your $options array with the options method\n $builder->options($options);\n\n // building the query\n $query = $builder->build();\n\n // executing the query\n $games = $igdb->game($query);\n\n // showing the results\n var_dump($games);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n```\n\n**Result**\n\n```text\narray (size=5)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 125062\n public 'cover' => int 83686\n public 'name' => string 'Uncharted Ocean: Set Sail' (length=25)\n 1 =>\n object(stdClass)[4]\n public 'id' => int 19583\n public 'cover' => int 15883\n public 'name' => string 'Uncharted: Fight for Fortune' (length=28)\n 2 =>\n object(stdClass)[5]\n public 'id' => int 26193\n public 'cover' => int 85149\n public 'name' => string 'Uncharted: The Lost Legacy' (length=26)\n 3 =>\n object(stdClass)[6]\n public 'id' => int 19609\n public 'cover' => int 85164\n public 'name' => string 'Uncharted: Fortune Hunter' (length=25)\n 4 =>\n object(stdClass)[7]\n public 'id' => int 7331\n public 'cover' => int 81917\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n```","html":"The IGDB Query Builder still supports the legacy $options
array to parameterize the query.
\n\n:warning Using the Builder this way is not recommended as this functionality may be removed in future versions. Use the builder approach instead.
\n
Code
\n<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiating the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // instantiating the builder\n $builder = new IGDBQueryBuilder();\n\n // creating the options array\n $options = array(\n // searching for games LIKE uncharted\n \"search\" => \"uncharted\",\n // we want to see these fields in the results\n \"fields\" => array(\"id\", \"name\", \"cover\"),\n // we only need maximum 5 results per query (pagination)\n \"limit\" => 5,\n // we would like to show the third page; fetch the results from the tenth element (pagination)\n \"offset\" => 10\n );\n\n try {\n // adding your $options array with the options method\n $builder->options($options);\n\n // building the query\n $query = $builder->build();\n\n // executing the query\n $games = $igdb->game($query);\n\n // showing the results\n var_dump($games);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n
\nResult
\narray (size=5)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 125062\n public 'cover' => int 83686\n public 'name' => string 'Uncharted Ocean: Set Sail' (length=25)\n 1 =>\n object(stdClass)[4]\n public 'id' => int 19583\n public 'cover' => int 15883\n public 'name' => string 'Uncharted: Fight for Fortune' (length=28)\n 2 =>\n object(stdClass)[5]\n public 'id' => int 26193\n public 'cover' => int 85149\n public 'name' => string 'Uncharted: The Lost Legacy' (length=26)\n 3 =>\n object(stdClass)[6]\n public 'id' => int 19609\n public 'cover' => int 85164\n public 'name' => string 'Uncharted: Fortune Hunter' (length=25)\n 4 =>\n object(stdClass)[7]\n public 'id' => int 7331\n public 'cover' => int 81917\n public 'name' => string 'Uncharted 4: A Thief's End' (length=26)\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":100},{"id":"a423327","slug":"counting-results","level":2,"parent":"7c0fcd6","parents":["7c0fcd6"],"title":"Counting Results","date":null,"timestamp":null,"body":{"stripped":"An example to count the matched records.\n\nWhen true is passed as the second parameter, the return value will be an object with a single property called count. For more details on the return values of the endpoint methods please refer to the return values section.\n\nCode\n\n\n\nResult","markdown":"An example to count the matched records.\n\n> When `true` is passed as the second parameter, the return value will be an object with a single property called `count`. For more details on the return values of the endpoint methods please refer to the [return values section](#return-values).\n\n**Code**\n\n```php\nwhere(\n array(\n 'field' => 'rating',\n 'postfix' => '>',\n 'value' => 75\n )\n )\n // process the configuration and return a string\n ->build();\n\n // executing the query\n // note the second true parameter\n $game_count = $igdb->game($query, true);\n\n // showing the results\n var_dump($game_count);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n```\n\n**Result**\n\n```text\nobject(stdClass)[3]\n public 'count' => int 8081\n```","html":"An example to count the matched records.
\n\n\nWhen
\ntrue
is passed as the second parameter, the return value will be an object with a single property calledcount
. For more details on the return values of the endpoint methods please refer to the return values section.
Code
\n<?php\n\n // importing the wrapper\n require 'class.igdb.php';\n\n // instantiating the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // building the query\n $query = $builder\n // setting a filter to fetch games with rating greater than 75\n ->where(\n array(\n 'field' => 'rating',\n 'postfix' => '>',\n 'value' => 75\n )\n )\n // process the configuration and return a string\n ->build();\n\n // executing the query\n // note the second true parameter\n $game_count = $igdb->game($query, true);\n\n // showing the results\n var_dump($game_count);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n
\nResult
\nobject(stdClass)[3]\n public 'count' => int 8081\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":101},{"id":"cca5fdc","slug":"expander","level":2,"parent":"7c0fcd6","parents":["7c0fcd6"],"title":"Expander","date":null,"timestamp":null,"body":{"stripped":"Some fields are actually ids pointing to other endpoints. The expander feature is a convenient way to go into these other endpoints and access more information from them in the same query, instead of having to do multiple queries.\n\nCode\n\n\n\nResult","markdown":"Some fields are actually ids pointing to other endpoints. The expander feature is a convenient way to go into these other endpoints and access more information from them in the same query, instead of having to do multiple queries.\n\n**Code**\n\n```php\nid(array(1,2))\n // fields can be expanded with a dot followed by the fields you want to access from a certain endpoint\n ->fields(array(\"name\", \"themes.url\", \"themes.name\"))\n // process the configuration and return a string\n ->build();\n\n // executing the query\n $game_count = $igdb->game($query);\n\n // showing the results\n var_dump($game_count);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n```\n\n**Result**\n\n```text\narray (size=2)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 1\n public 'name' => string 'Thief II: The Metal Age' (length=23)\n public 'themes' =>\n array (size=3)\n 0 =>\n object(stdClass)[4]\n public 'id' => int 1\n public 'name' => string 'Action' (length=6)\n public 'url' => string 'https://www.igdb.com/themes/action' (length=34)\n 1 =>\n object(stdClass)[5]\n public 'id' => int 17\n public 'name' => string 'Fantasy' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/fantasy' (length=35)\n 2 =>\n object(stdClass)[6]\n public 'id' => int 23\n public 'name' => string 'Stealth' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/stealth' (length=35)\n 1 =>\n object(stdClass)[7]\n public 'id' => int 2\n public 'name' => string 'Thief: The Dark Project' (length=23)\n public 'themes' =>\n array (size=3)\n 0 =>\n object(stdClass)[8]\n public 'id' => int 1\n public 'name' => string 'Action' (length=6)\n public 'url' => string 'https://www.igdb.com/themes/action' (length=34)\n 1 =>\n object(stdClass)[9]\n public 'id' => int 17\n public 'name' => string 'Fantasy' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/fantasy' (length=35)\n 2 =>\n object(stdClass)[10]\n public 'id' => int 23\n public 'name' => string 'Stealth' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/stealth' (length=35)\n```","html":"Some fields are actually ids pointing to other endpoints. The expander feature is a convenient way to go into these other endpoints and access more information from them in the same query, instead of having to do multiple queries.
\nCode
\n<?php\n\n // importing the wrapper\n require 'class.igdb.php';\n\n // instantiating the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // instantiate the query builder\n $builder = new IGDBQueryBuilder();\n\n try {\n // building the query\n $query = $builder\n // fetching the first 2 games by id 1 and 2\n ->id(array(1,2))\n // fields can be expanded with a dot followed by the fields you want to access from a certain endpoint\n ->fields(array(\"name\", \"themes.url\", \"themes.name\"))\n // process the configuration and return a string\n ->build();\n\n // executing the query\n $game_count = $igdb->game($query);\n\n // showing the results\n var_dump($game_count);\n } catch (IGDBInvalidParameterException $e) {\n // an invalid parameter is passed to the query builder\n echo $e->getMessage();\n } catch (IGDBEnpointException $e) {\n // a non-successful response recieved from the IGDB API\n echo $e->getMessage();\n }\n\n?>\n
\nResult
\narray (size=2)\n 0 =>\n object(stdClass)[3]\n public 'id' => int 1\n public 'name' => string 'Thief II: The Metal Age' (length=23)\n public 'themes' =>\n array (size=3)\n 0 =>\n object(stdClass)[4]\n public 'id' => int 1\n public 'name' => string 'Action' (length=6)\n public 'url' => string 'https://www.igdb.com/themes/action' (length=34)\n 1 =>\n object(stdClass)[5]\n public 'id' => int 17\n public 'name' => string 'Fantasy' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/fantasy' (length=35)\n 2 =>\n object(stdClass)[6]\n public 'id' => int 23\n public 'name' => string 'Stealth' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/stealth' (length=35)\n 1 =>\n object(stdClass)[7]\n public 'id' => int 2\n public 'name' => string 'Thief: The Dark Project' (length=23)\n public 'themes' =>\n array (size=3)\n 0 =>\n object(stdClass)[8]\n public 'id' => int 1\n public 'name' => string 'Action' (length=6)\n public 'url' => string 'https://www.igdb.com/themes/action' (length=34)\n 1 =>\n object(stdClass)[9]\n public 'id' => int 17\n public 'name' => string 'Fantasy' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/fantasy' (length=35)\n 2 =>\n object(stdClass)[10]\n public 'id' => int 23\n public 'name' => string 'Stealth' (length=7)\n public 'url' => string 'https://www.igdb.com/themes/stealth' (length=35)\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":102},{"id":"25c7cc2","slug":"multiquery-ii","level":2,"parent":"7c0fcd6","parents":["7c0fcd6"],"title":"MultiQuery","date":null,"timestamp":null,"body":{"stripped":"Using multiquery multiple queries can be executed against the IGDB database using a single query. The multiquery method expects an array of multiquery query strings.\n\n:info Using the build method with a boolean true parameter, a query will be returned with a multiquery syntax.\n\nCode\n\n\n\nResult","markdown":"Using multiquery multiple queries can be executed against the IGDB database using a single query. The multiquery method expects an array of multiquery query strings.\n\n>:info Using the [`build`](#building-the-query) method with a boolean `true` parameter, a query will be returned with a multiquery syntax.\n\n**Code**\n\n```php\nname(\"Main Game\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\");\n\n // configuring the bundle query\n $bundle\n ->name(\"Bundles\")\n ->endpoint(\"game\")\n ->fields(\"id,name,version_parent,category\")\n ->where(\"version_parent = 25076\")\n ->where(\"category = 0\");\n\n var_dump(\n $igdb->multiquery(\n array(\n $main->build(true),\n $bundle->build(true)\n )\n )\n );\n } catch (IGDBInvaliParameterException $e) {\n // a builder property is invalid\n echo $e->getMessage();\n } catch (IGDBEndpointException $e) {\n // something went wront with the query\n echo $e->getMessage();\n }\n?>\n```\n\n**Result**\n\n```text\narray (size=2)\n 0 =>\n object(stdClass)[4]\n public 'name' => string 'Main Game' (length=9)\n public 'result' =>\n array (size=1)\n 0 =>\n object(stdClass)[5]\n public 'id' => int 25076\n public 'name' => string 'Red Dead Redemption 2' (length=21)\n 1 =>\n object(stdClass)[6]\n public 'name' => string 'Bundles' (length=7)\n public 'result' =>\n array (size=3)\n 0 =>\n object(stdClass)[7]\n public 'id' => int 103205\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Special Edition' (length=38)\n public 'version_parent' => int 25076\n 1 =>\n object(stdClass)[8]\n public 'id' => int 103207\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Collector's Box' (length=38)\n public 'version_parent' => int 25076\n 2 =>\n object(stdClass)[9]\n public 'id' => int 103206\n public 'category' => int 0\n public 'name' => string 'Red dead Redemption 2: Ultimate Edition' (length=39)\n public 'version_parent' => int 25076\n```","html":"Using multiquery multiple queries can be executed against the IGDB database using a single query. The multiquery method expects an array of multiquery query strings.
\n\n\n:info Using the
\nbuild
method with a booleantrue
parameter, a query will be returned with a multiquery syntax.
Code
\n<?php\n\n // importing the wrapper\n require_once \"class.igdb.php\";\n\n // instantiate the wrapper\n $igdb = new IGDB(\"{client_id}\", \"{access_token}\");\n\n // query builder for the main game\n $main = new IGDBQueryBuilder();\n\n // query builder for the bundles\n $bundle = new IGDBQueryBuilder();\n\n try {\n // configuring the main query\n $main\n ->name(\"Main Game\")\n ->endpoint(\"game\")\n ->fields(\"id,name\")\n ->where(\"id = 25076\");\n\n // configuring the bundle query\n $bundle\n ->name(\"Bundles\")\n ->endpoint(\"game\")\n ->fields(\"id,name,version_parent,category\")\n ->where(\"version_parent = 25076\")\n ->where(\"category = 0\");\n\n var_dump(\n $igdb->multiquery(\n array(\n $main->build(true),\n $bundle->build(true)\n )\n )\n );\n } catch (IGDBInvaliParameterException $e) {\n // a builder property is invalid\n echo $e->getMessage();\n } catch (IGDBEndpointException $e) {\n // something went wront with the query\n echo $e->getMessage();\n }\n?>\n
\nResult
\narray (size=2)\n 0 =>\n object(stdClass)[4]\n public 'name' => string 'Main Game' (length=9)\n public 'result' =>\n array (size=1)\n 0 =>\n object(stdClass)[5]\n public 'id' => int 25076\n public 'name' => string 'Red Dead Redemption 2' (length=21)\n 1 =>\n object(stdClass)[6]\n public 'name' => string 'Bundles' (length=7)\n public 'result' =>\n array (size=3)\n 0 =>\n object(stdClass)[7]\n public 'id' => int 103205\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Special Edition' (length=38)\n public 'version_parent' => int 25076\n 1 =>\n object(stdClass)[8]\n public 'id' => int 103207\n public 'category' => int 0\n public 'name' => string 'Red Dead Redemption 2: Collector's Box' (length=38)\n public 'version_parent' => int 25076\n 2 =>\n object(stdClass)[9]\n public 'id' => int 103206\n public 'category' => int 0\n public 'name' => string 'Red dead Redemption 2: Ultimate Edition' (length=39)\n public 'version_parent' => int 25076\n
"},"meta":{"revision":0,"created":1699570565563,"version":0},"$loki":103},{"id":"74d88cc","slug":"change-log","level":1,"parent":null,"parents":[],"title":"Change Log","date":null,"timestamp":1650388071000,"body":{"stripped":"","markdown":"","html":""},"icon":"fa-clipboard-list","overview":"Changes, updates, notes.","meta":{"revision":0,"created":1699570565563,"version":0},"$loki":104},{"id":"797e68c","slug":"v4-3-1---april-19--2022","level":2,"parent":"74d88cc","parents":["74d88cc"],"title":"v4.3.1 - April 19, 2022","date":null,"timestamp":null,"body":{"stripped":"IGDBEndpointException\n\nAdded a getResponseCode() to fetch http response code from IGDB API\n\nAdded sections to the documentation:\n\nHandling Errors\n\nHandling Builder Errors\n\nHandling Request Errors","markdown":"- IGDBEndpointException\n - Added a `getResponseCode()` to fetch http response code from IGDB API\n - Added sections to the documentation:\n - [Handling Errors](#handling-errors)\n - [Handling Builder Errors](#handling-builder-errors)\n - [Handling Request Errors](#handling-request-errors)","html":"getResponseCode()
to fetch http response code from IGDB API$options
array parsing to the options()
methodreset()
method added$options
arrayIGDBEndpointException
and IGDBInvalidParameterException
classes$options
, only apicalypse query stringsIGDB::api_status()
method_init_curl() => _curl_init()
close_curl() => curl_close()
reinit_curl() => curl_reinit()
where
filter (#6 Issues with slug field)_construct_url
expander
parameterfilter
to where
order
to sort
_stringify_options
_construct_url
count
custom_query
apicalypse
api_status
$execute
, added $count
)public IGDB::get_request_info()
public method added