PHPackages                             fkrzski/php-steam-api-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. fkrzski/php-steam-api-sdk

ActiveLibrary[API Development](/categories/api)

fkrzski/php-steam-api-sdk
=========================

Framework-agnostic PHP SDK for the Steam Web API, built on Saloon.

0.2.0(1mo ago)2460↓38.8%1MITPHPPHP ^8.5.0CI passing

Since Jun 3Pushed 3w ago1 watchersCompare

[ Source](https://github.com/fkrzski/php-steam-api-sdk)[ Packagist](https://packagist.org/packages/fkrzski/php-steam-api-sdk)[ GitHub Sponsors](https://github.com/fkrzski)[ RSS](/packages/fkrzski-php-steam-api-sdk/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (17)Versions (4)Used By (1)

PHP Steam API SDK
=================

[](#php-steam-api-sdk)

[![Banner of PHP Steam API SDK](art/banner.png)](art/banner.png)

[![License](https://camo.githubusercontent.com/d80efcc992ad51858936f7b553ea0097b6d887389e2c2a7937dd55bce98fa4ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f666b727a736b692f7068702d737465616d2d6170692d73646b2e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/fkrzski/php-steam-api-sdk)[![Latest Version on Packagist](https://camo.githubusercontent.com/316dcb2d2f24ff2ef864c5ebab877c320cdcd45f72264a6ef4b148602021f475/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666b727a736b692f7068702d737465616d2d6170692d73646b2e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/fkrzski/php-steam-api-sdk)[![Total Downloads](https://camo.githubusercontent.com/55ca42ca06e8edc3b62767bb0edc3a56baa3f065c60eb11a18e8c7c79b98c00d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666b727a736b692f7068702d737465616d2d6170692d73646b2e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/fkrzski/php-steam-api-sdk)[![Tests](https://camo.githubusercontent.com/0893f654d356fa2bb0193cfcaf0c042a14d3c4871ab4b1a488dfa9ce58d6501d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f666b727a736b692f7068702d737465616d2d6170692d73646b2f74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666f722d7468652d6261646765)](https://github.com/fkrzski/php-steam-api-sdk/actions/workflows/tests.yml)

Framework-agnostic PHP SDK for the [Steam Web API](https://steamcommunity.com/dev), built on top of [Saloon](https://docs.saloon.dev/) v4.

- Strong types (PHP 8.5, PHPStan max, 100% type coverage).
- Readonly DTOs with `DateTimeImmutable` instead of framework date objects.
- Domain exception hierarchy rooted at `SteamApiException`.
- Daily 100 000-request rate limit baked in via [`saloonphp/rate-limit-plugin`](https://github.com/saloonphp/rate-limit-plugin).
- Zero framework coupling — a Laravel bridge package ships separately.

Requirements
------------

[](#requirements)

- PHP **8.5+**
- Saloon **4+**

Installation
------------

[](#installation)

```
composer require fkrzski/php-steam-api-sdk
```

Quickstart
----------

[](#quickstart)

```
use Fkrzski\SteamApiSdk\Http\Requests\ISteamUser\GetPlayerSummariesRequest;
use Fkrzski\SteamApiSdk\SteamConfig;
use Fkrzski\SteamApiSdk\SteamConnector;
use Fkrzski\SteamApiSdk\ValueObjects\SteamId;

$connector = new SteamConnector(new SteamConfig(apiKey: 'YOUR_STEAM_API_KEY'));

$summaries = $connector
    ->send(new GetPlayerSummariesRequest([SteamId::fromSteamId64('76561198000000000')]))
    ->dto();

echo $summaries[0]->personaName;
```

Every `Request::createDtoFromResponse()` returns a readonly DTO — call `->dto()` on the Saloon response to get it.

Value object: `SteamId`
-----------------------

[](#value-object-steamid)

`SteamId` is the only accepted identifier across the SDK. Build one from a verified 64-bit ID, or try to parse user input:

```
use Fkrzski\SteamApiSdk\ValueObjects\SteamId;

// Strict — throws InvalidSteamIdException when the input is not a 17-digit numeric ID.
$id = SteamId::fromSteamId64('76561198000000000');

// Lenient — returns null when the input is not a SteamID64 or /profiles/ URL.
$id = SteamId::tryFromInput('https://steamcommunity.com/profiles/76561198000000000');

// Extract the slug from /id/ URLs (or trim raw input). Resolve it via ResolveVanityUrlRequest.
$vanity = SteamId::extractVanityName('https://steamcommunity.com/id/gabelogannewell/');
```

Available requests
------------------

[](#available-requests)

### Resolve a vanity URL

[](#resolve-a-vanity-url)

```
use Fkrzski\SteamApiSdk\Exceptions\SteamUserNotFoundException;
use Fkrzski\SteamApiSdk\Http\Requests\ISteamUser\ResolveVanityUrlRequest;

try {
    $steamId = $connector->send(new ResolveVanityUrlRequest('gabelogannewell'))->dto();
} catch (SteamUserNotFoundException) {
    // The vanity slug does not exist.
}
```

### Player summaries (batch, ≤100 IDs)

[](#player-summaries-batch-100-ids)

```
use Fkrzski\SteamApiSdk\Exceptions\TooManySteamIdsException;
use Fkrzski\SteamApiSdk\Http\Requests\ISteamUser\GetPlayerSummariesRequest;

$summaries = $connector->send(new GetPlayerSummariesRequest([$steamId]))->dto();

foreach ($summaries as $summary) {
    echo $summary->personaName, ' — ', $summary->profileUrl, PHP_EOL;
}
```

Passing more than 100 IDs throws `TooManySteamIdsException`.

### Owned games

[](#owned-games)

```
use Fkrzski\SteamApiSdk\Exceptions\ProfileNotPublicException;
use Fkrzski\SteamApiSdk\Http\Requests\IPlayerService\GetOwnedGamesRequest;

try {
    $library = $connector->send(new GetOwnedGamesRequest(
        steamId: $steamId,
        appIdsFilter: [381210],     // optional
        includeAppInfo: true,       // optional
        includePlayedFreeGames: false,
    ))->dto();
} catch (ProfileNotPublicException) {
    // The profile (or its games list) is hidden.
}
```

### User stats for a single game

[](#user-stats-for-a-single-game)

```
use Fkrzski\SteamApiSdk\Http\Requests\ISteamUserStats\GetUserStatsForGameRequest;

$stats = $connector->send(new GetUserStatsForGameRequest(
    steamId: $steamId,
    appId: 381210,
    language: 'english', // optional; localises achievement metadata
))->dto();

foreach ($stats->stats as $stat) {
    echo $stat->name, ' = ', $stat->value, PHP_EOL;
}
```

### Player achievements

[](#player-achievements)

```
use Fkrzski\SteamApiSdk\Http\Requests\ISteamUserStats\GetPlayerAchievementsRequest;

$achievements = $connector->send(new GetPlayerAchievementsRequest(
    steamId: $steamId,
    appId: 381210,
    language: 'english',
))->dto();

foreach ($achievements->achievements as $achievement) {
    echo $achievement->apiName, ' — ', $achievement->achieved ? 'unlocked' : 'locked', PHP_EOL;
}
```

Rate limiting
-------------

[](#rate-limiting)

The Steam Web API allows **100 000 requests per API key per day**. The connector enforces this through `saloonphp/rate-limit-plugin` and throws `SteamRateLimitException` once the budget is exhausted.

By default the limit is tracked in an in-memory `MemoryStore`, which only spans a single PHP process. For multi-process deployments (queue workers, FPM pools) inject a shared store:

```
use Fkrzski\SteamApiSdk\SteamConfig;
use Fkrzski\SteamApiSdk\SteamConnector;
use Saloon\RateLimitPlugin\Stores\PredisStore;

$connector = new SteamConnector(new SteamConfig(
    apiKey: 'YOUR_STEAM_API_KEY',
    rateLimitStore: new PredisStore($predis),
));
```

Any implementation of `Saloon\RateLimitPlugin\Contracts\RateLimitStore` is accepted (Predis, PSR-16, file, Laravel cache, custom).

Exception hierarchy
-------------------

[](#exception-hierarchy)

```
SteamApiException                (root, extends RuntimeException)
├── InvalidSteamIdException      Malformed SteamID64.
├── SteamUserNotFoundException   Vanity URL unresolved or profile missing.
├── ProfileNotPublicException    Profile / games list / stats are private.
├── TooManySteamIdsException     More than 100 IDs in a batch request.
└── SteamRateLimitException      100k/day quota reached; exposes the offending Limit.

```

Catch the root `SteamApiException` to handle every SDK failure uniformly.

Testing
-------

[](#testing)

The SDK uses Pest with Saloon's `MockClient` and recorded JSON fixtures in `tests/Fixtures/Saloon/`.

```
composer test          # lint + phpstan + pest (100% coverage)
composer test:unit     # pest only
composer test:types    # phpstan max
composer test:lint     # pint + rector dry-run
```

License
-------

[](#license)

MIT. See [LICENSE.md](LICENSE.md).

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance93

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

2

Last Release

47d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/accf44fd0ffa5349a96edefe2daf51dc4475af31a01611acade1d44b35341d61?d=identicon)[fkrzski](/maintainers/fkrzski)

---

Top Contributors

[![fkrzski](https://avatars.githubusercontent.com/u/75097934?v=4)](https://github.com/fkrzski "fkrzski (40 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (1 commits)")

---

Tags

phpsdksaloonsteamsteam api

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/fkrzski-php-steam-api-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/fkrzski-php-steam-api-sdk/health.svg)](https://phpackages.com/packages/fkrzski-php-steam-api-sdk)
```

###  Alternatives

[saloonphp/laravel-plugin

The official Laravel plugin for Saloon

807.1M211](/packages/saloonphp-laravel-plugin)[sandorian/moneybird-api-php

Moneybird API client for PHP

148.2k](/packages/sandorian-moneybird-api-php)[marceloeatworld/falai-php

\#1 PHP client for the fal.ai serverless AI platform, compatible with Laravel and native PHP, built on Saloon v4

106.1k](/packages/marceloeatworld-falai-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
