A modern PHP client for the Steam Web API with optional Laravel integration.
- 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
composer require teemocell/steam-web-apiuse 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.
Add the API key to .env:
STEAM_API_KEY=your-key-hereThe 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"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.
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
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.
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.
Bug reports and pull requests are welcome through the GitHub issue tracker.
- Stygiansabyss
- nicekiwi
- rannmann
- Amegatron
- mjmarianetti
- MaartenStaa
- JRizzle88
- jastend
- Teakowa
- Ben Sherred
This package is open-source software licensed under the MIT License.