PHP Wrapper to communicate with Steam Web API
Please refer to https://steamid.co/ or https://steamidconverter.com/ to find the user steam id.
Add to your composer.json
{
"require": {
"jocolopes/steamapi": "dev-master"
}
}
$user = new \SteamApi\User('YOUR-STEAM-KEY', 'THE-STEAMID64');
$user->GetPlayerBans();
// OR
$user->GetPlayerBans('THE-FIRST-STEAMID64,THE-SECOND-STEAMID64,THE-ANY-STEAMID64');
$user->GetPlayerSummaries();
// OR
$user->GetPlayerSummaries('THE-FIRST-STEAMID64,THE-SECOND-STEAMID64,THE-ANY-STEAMID64');
$user->GetFriendList();
$user->GetUserGroupList();
$user->ResolveVanityUrl('id-of-user-to-translate-into-steam-id');
// Example
$user->ResolveVanityUrl('pr00fgames'); // Result: 76561197963455129
$player = new \SteamApi\Player('YOUR-STEAM-KEY', 'THE-STEAMID64');
$player->GetSteamLevel();
$player->GetPlayerLevelDetails();
$player->GetBadges();
$player->GetCommunityBadgeProgress();
$player->GetOwnedGames();
$player->GetRecentlyPlayedGames();
$player->IsPlayingSharedGame($gameId);
$news = new \SteamApi\News('YOUR-STEAM-KEY');
$news->GetNewsForApp($appId[, $numberOfNews, $maxLength]); // Last 2 arguments are optional
$app = new \SteamApi\App('YOUR-STEAM-KEY');
$app->appDetails($appId);
$app->GetServersAtAddress($address); // Hostname or IP:Port
$app->GetAppList();
$app->UpToDateCheck($appId, $appVersion);
$stats = new Stats('YOUR-STEAM-KEY', 'THE-STEAMID64');
$stats->GetGlobalStatsForGame($gameId, array('STATS-NAME'));
// Example
$stats->GetGlobalStatsForGame(17740, array('global.map.emp_isle'));
$stats->GetNumberOfCurrentPlayers($appId);
$stats->GetSchemaForGame($appId);
$stats->GetPlayerAchievements($appId);
$stats->GetGlobalAchievementPercentagesForApp($appId);
$stats->GetUserStatsForGame($appId);
Please Refer to the tests folder to get more information on how to use the library
The objective of this library is to wrap the steam web API into a php object.
There are some missing methods that I plan to implement soon.
Feel free to add some missing methods and as for a pull request on this repo.
The missing methods can be found using the swissapiknife.
You do need PHP 5.4+ and composer. You also need to load the vendor/autoload.php
into your project.
This library is framework agnostic, maybe the framework you're using requires some aditional setup.
If your framework uses composer you should be good to go. But let me know if you run into any troubles.
If you have the capacity to fix it yourself by all means do and create a pull request.
If you don't, raise an issue on github and me or someone else will try to fix it.