Download the PHP package kris-kuiper/igdbv4 without Composer
On this page you can find all versions of the php package kris-kuiper/igdbv4. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kris-kuiper/igdbv4
More information about kris-kuiper/igdbv4
Files in kris-kuiper/igdbv4
Informations about the package igdbv4
IGDB V4 PHP API
Introduction
This package is a PHP wrapper for the IGDB version 4 API for retrieving game information. It contains the following:
- All the IGDB v4 endpoints
- Authentication package for retrieving the access token
- Advanced query builder
System Requirements
Requires PHP 8.0 or later; Using the latest PHP version whenever possible is recommended.
Installation
Run the following to install this package:
Authentication
To use the IGDB API you must have a Client ID and Access Token. Full information regarding acquiring these can be found at https://dev.twitch.tv/docs/authentication.
However, to get started immediately:
- Sign Up with Twitch for a free account
- Register your application
- Manage your newly created application
- Generate a Client Secret by pressing [New Secret]
- Take note of the Client ID and Client Secret
When you got the Client ID and Client Secret, you can use the Authentication
class to get an access token.
Example retrieving the access token
Note: An access token is approximately valid for 60 days. It is recommended to save the access token and expiration time for later use, so there is no need to generate a new access token for every request.
Endpoints
Every endpoint listed can be request by calling the endpoints name and has the following methods:
findById()
- Find an item by its identifier (i.e. find a game by id)list()
- Returns a list of items (i.e. list all screenshots of a specific game)query()
- Execute a raw query on the current endpoint (i.e. execute a custom query to find a specific genre)
Only the game, platform, collection, character and theme endpoints supports also the search()
method.
Below is a list of the supported endpoints.
Example fetching game(s), platform(s) and genre(s):
Note: All the listed endpoints are available through the IGDB
class.
Advanced Query Builder
The query builder lets you programmatically create queries which you can use for each endpoint calling the query()
method.
It contains the following methods:
fields()
(selecting specific fields)exclude()
(excluding specific fields)search()
where()
(where, whereIn and grouping where's)orWhere()
(only after a where)sort()
offset()
limit()
Example using the query builder with the "games" endpoint
Examples using the query builder
Query builder advanced where conditions
Run Unit Test
Install phpunit in your environment and run:
Questions and Feedback
Questions that are not addressed in the manual should be directed to the relevant repository, as linked above.
If you find code in this release behaving in an unexpected manner or contrary to its documented behavior, please create an issue with the relevant repository, as linked above.
License
You can find a copy of this license in LICENSE.md.
All versions of igdbv4 with dependencies
guzzlehttp/guzzle Version ^7.3.0
psr/http-message Version ^2.0
beberlei/assert Version ^3.3