dimuska139 / rawg-sdk-php
Installs: 1 637
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=7.0
- ext-json: *
- guzzlehttp/guzzle: ^6.5
- lukasoppermann/http-status: ^2.0
Requires (Dev)
- codeception/codeception: ^4.1
- codeception/module-asserts: ^1.0.0
- codeception/module-phpbrowser: ^1.0.0
README
This is unofficial RAWG PHP SDK. This library contains methods for interacting with RAWG API.
Installation
composer require dimuska139/rawg-sdk-php
Usage
require 'vendor/autoload.php'; use Rawg\ApiClient; use Rawg\Config; use Rawg\DateRange; use Rawg\Filters\GamesFilter; use Rawg\Filters\PaginationFilter; $cfg = new Config('api-key', 'en'); $client = new ApiClient($cfg); $additionsFilter = (new PaginationFilter())->setPage(1)->setPageSize(5); print_r($client->games()->getAdditions(47, $additionsFilter)->getData()); $gamesFilter = (new GamesFilter()) ->setPage(1) ->setPageSize(20) ->setDates([ DateRange::create(new DateTime( '2012-02-01' ), new DateTime( '2015-06-25' )) ]) ->setOrdering('-name') ->setTags([1,2,3]); print_r($client->games()->getGames($gamesFilter)->getData());
The tests should be considered a part of the documentation. Also you can read official docs.
API limitations
Only 5 requests per second allowed from one IP.
License
RAWG PHP SDK is released under the MIT License.