teemocell/steam-web-api

A modern Steam Web API client for PHP and Laravel 12+

Maintainers

Package info

github.com/TeemoCell/SteamWebAPI

pkg:composer/teemocell/steam-web-api

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master 2026-07-20 02:33 UTC

This package is auto-updated.

Last update: 2026-07-20 02:37:24 UTC


README

Unit Tests Latest Stable Version Total Downloads License

A modern PHP client for the Steam Web API with optional Laravel integration.

Requirements

  • PHP 8.2 or newer
  • Laravel 12.61.1 or newer, or Laravel 13.12.0 or newer, when used inside Laravel
  • A Steam Web API key

Installation

composer require teemocell/steam-web-api

Quick start

use TeemoCell\SteamWebApi\Client;

$steam = new Client(apiKey: $_ENV['STEAM_API_KEY']);

$player = $steam
    ->user(76561197960287930)
    ->GetPlayerSummaries()[0];

echo $player->personaName;

The package uses the TeemoCell\SteamWebApi PHP namespace.

Laravel

Add the API key to .env:

STEAM_API_KEY=your-key-here

The package registers TeemoCell\SteamWebApi\Client as a singleton through Laravel package discovery:

use TeemoCell\SteamWebApi\Client;

final class SteamProfileController
{
    public function __invoke(Client $steam, string $steamId)
    {
        return $steam->user($steamId)->GetPlayerSummaries();
    }
}

Publish the configuration only when it needs to be customized:

php artisan vendor:publish --provider="TeemoCell\SteamWebApi\SteamApiServiceProvider"

Supported services

  • ISteamNews
  • IPlayerService
  • ISteamUser
  • ISteamUserStats
  • IStoreService
  • IPublishedFileService
  • ISteamWebAPIUtil
  • read-only IGameServersService
  • publisher-key methods for ISteamUser, ISteamNews and IInventoryService
  • experimental public Steam Community inventories

Legacy Store and Steam Community endpoints remain available for backwards compatibility.

Public Community inventories include assets, names, descriptions, images and market metadata. Steam does not officially document this Community endpoint, so the client is explicitly experimental:

$inventory = $steam->communityInventory()->GetInventory(
    steamId: $steamId,
    appId: 730,
    contextId: 2,
);

Publisher keys can use the official inventory service for their own apps:

$publisher = (new Client(apiKey: $publisherKey))->publisher();
$items = $publisher->GetInventory($appId, $steamId);
$definitions = $publisher->GetItemDefs($appId);
$prices = $publisher->GetPriceSheet($currency);

GetPriceSheet() returns Inventory Service store prices, not Community Market resale prices.

Documentation

Full installation, configuration, endpoint and migration documentation is available in the GitHub Wiki:

Testing

Run the deterministic offline suite:

php vendor/bin/phpunit --filter "AppListTest|ClientConstructionTest|CommunityInventoryTest|CurrentApiEndpointsTest|UserStatsResponseTest|LaravelClientBindingTest"

The complete suite contains live Steam API tests and requires STEAM_API_KEY.

Security

Never expose normal API keys, publisher keys or game-server login tokens in client-side code, logs, issues or committed files. Publisher methods must only run on a trusted server.

Contributing

Bug reports and pull requests are welcome through the GitHub issue tracker.

Contributors

License

This package is open-source software licensed under the MIT License.