evilfreelancer / steam-api-client
The SteamAPI PHP Client is a PHP library for interacting with the Steam API. It provides an easy way to fetch data from the Steam platform, such as user profiles, games, and reviews.
Requires
- php: ^8.1
- ext-curl: *
- ext-dom: *
- ext-json: *
- guzzlehttp/guzzle: ^7.5.1
- symfony/dom-crawler: ^6.0
Requires (Dev)
- larapack/dd: ^1.1
- limedeck/phpunit-detailed-printer: ^5.0
- orchestra/testbench: ^4.0|^5.0
- phpunit/phpunit: ^9.6
- rector/rector: ^0.9
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2024-11-30 02:44:22 UTC
README
Note: This library is still under development and not yet production-ready.
The SteamAPI PHP Client is a PHP library for interacting with the Steam API. It provides an easy way to fetch data from the Steam platform, such as user profiles, games, and reviews.
Installation
To install the SteamAPI PHP Client, simply use Composer:
composer require evilfreelancer/steam-api-client
Usage
Configuration
First, you need to create a Config object with your desired configuration:
use SteamApi\Config; $config = new Config(); $config->storeUri = 'https://store.steampowered.com'; $config->retries = 5; $config->retryTimeoutMs = 1000;
Next, create an instance of the HttpClient class and pass your Config object:
use SteamApi\HttpClient; $httpClient = new HttpClient($config);
Getting Curator Reviews
To get reviews for a specific curator, you can use the Curator class:
// Replace with a valid curator ID $curatorId = 31790204; // Games-4-Programmers $curator = $httpClient->store->curator($curatorId); // Get the total number of reviews for the curator $totalCount = $curator->getTotalCount(); // Get a limited number of reviews (default: last 10 reviews) $reviews = $curator->getReviews(); // Get all available reviews $allReviews = $curator->allReviews();
License
This library is released under the MIT License. See the LICENSE file for details.