teemocell / steam-web-api
A modern Steam Web API client for PHP and Laravel 12+
Requires
- php: ^8.2
- ext-bcmath: *
- ext-curl: *
- ext-json: *
- ext-libxml: *
- ext-simplexml: *
- guzzlehttp/guzzle: ^7.8
- laravel/framework: ^12.61.1|^13.12.0
Requires (Dev)
- orchestra/testbench: ^10.0|^11.0
- phpunit/phpunit: ^11.0|^12.0|^13.0
- rector/rector: ^1.0|^2.0
- vlucas/phpdotenv: ^5.6
This package is auto-updated.
Last update: 2026-07-20 02:37:24 UTC
README
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
ISteamNewsIPlayerServiceISteamUserISteamUserStatsIStoreServiceIPublishedFileServiceISteamWebAPIUtil- read-only
IGameServersService - publisher-key methods for
ISteamUser,ISteamNewsandIInventoryService - 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:
- Installation
- Configuration
- Laravel integration
- Client usage
- Endpoint reference
- Community inventories
- Error handling
- Migration guide
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
- Stygiansabyss
- nicekiwi
- rannmann
- Amegatron
- mjmarianetti
- MaartenStaa
- JRizzle88
- jastend
- Teakowa
- Ben Sherred
License
This package is open-source software licensed under the MIT License.