vinevax/steam-php-api

PHP Client for accessing the Steam API

v1.1.1 2023-12-22 15:49 UTC

This package is auto-updated.

Last update: 2024-10-22 22:41:12 UTC


README

License Latest Version on Packagist Total Downloads

Installation

composer require "vinevax/steam-php-api"

Usage

First create a new instance of VineVax\SteamPHPApi\SteamClient with your API key. You can get your API key from here.

use VineVax\SteamPHPApi\SteamClient;

$steam = new SteamClient('YOUR_API_KEY');

Available methods

Get game news

$steam->getNewsForApp(appId: 440, count: 3, maxlength: 300);

Get global achievements overview

$steam->getGlobalAchievementPercentagesForApp(appId: 440);

Get player summaries (accepts 1 steamid or an array of steamids)

$steam->getPlayerSummaries(steamIds: 76561197960435530);
$steam->getPlayerSummaries(steamIds: [76561197960435530, 76561197960435531]);

Get player friend list

$steam->getFriendList(steamId: 76561197960435530, relationship: 'friend');

Get player achievements

$steam->getPlayerAchievements(steamId: 76561197960435530, appId: 440, language: \VineVax\SteamPHPApi\Enums\Language::ENGLISH);

Get player stats for game

$steam->getPlayerStatsForGame(steamId: 76561197960435530, appId: 440, language: \VineVax\SteamPHPApi\Enums\Language::ENGLISH);

Get owned games

$steam->getOwnedGames(steamId: 76561197960435530, includeAppInfo: true, includeFreeGames: true);

Get recently played games

$steam->getRecentlyPlayedGames(steamId: 76561197960435530, count: 15);