https://github.com/dimuska139/rawg-sdk-php
This is RAWG PHP SDK. This library contains methods for interacting with RAWG API.
https://github.com/dimuska139/rawg-sdk-php
http-client rawg rawg-api rest-client
Last synced: 4 months ago
JSON representation
This is RAWG PHP SDK. This library contains methods for interacting with RAWG API.
- Host: GitHub
- URL: https://github.com/dimuska139/rawg-sdk-php
- Owner: dimuska139
- Created: 2020-09-04T19:32:25.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-01T21:49:44.000Z (about 4 years ago)
- Last Synced: 2025-09-23T23:53:04.883Z (9 months ago)
- Topics: http-client, rawg, rawg-api, rest-client
- Language: PHP
- Homepage: https://packagist.org/packages/dimuska139/rawg-sdk-php
- Size: 93.8 KB
- Stars: 5
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RAWG Video Games Database PHP client
[](https://travis-ci.org/dimuska139/rawg-sdk-php)
[](https://codecov.io/gh/dimuska139/rawg-sdk-php)
[](https://github.com/dimuska139/go-email-normalizer/blob/master/LICENSE)
This is unofficial RAWG PHP SDK. This library contains methods for interacting with [RAWG API](https://rawg.io/).
## Installation
`composer require dimuska139/rawg-sdk-php`
## Usage
```php
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](https://rawg.io/apidocs).
## API limitations
Only 5 requests per second allowed from one IP.
## License
RAWG PHP SDK is released under the
[MIT License](http://www.opensource.org/licenses/MIT).