Skip to content

Commit d8e00c6

Browse files
committed
Updating readme. Minor fixes while writing docs
1 parent 9178e80 commit d8e00c6

File tree

2 files changed

+310
-7
lines changed

2 files changed

+310
-7
lines changed

README.md

Lines changed: 310 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
This package provides an easy way to get details from the steam api service. The services it can access are:
44

5-
- `Steam_News`
6-
- `Steam_Player`
7-
- `Steam_User`
8-
- `Steam_User_Stats`
9-
- `Steam_App`
5+
- `ISteamNews`
6+
- `IPlayerService`
7+
- `ISteamUser`
8+
- `ISteamUserStats`
9+
- `ISteamApp`
1010

1111
## Installation
1212

@@ -26,4 +26,308 @@ Once that is finished, add the service provider to `app/config/app.php`
2626

2727
'Syntax\SteamApi\SteamApiServiceProvider',
2828

29-
> The alias to Steam is already handled by the package.
29+
> The alias to Steam is already handled by the package.
30+
31+
Lastly, publish the config file. You can get your API key from [Steam](http://steamcommunity.com/dev/apikey)
32+
33+
php artisan config:publish syntax/steam-api
34+
35+
## Usage
36+
37+
Each service from the steam api has it's own methods you can use.
38+
39+
- [News](#news)
40+
- [Player](#player)
41+
- [User](#user)
42+
- [User Stats](#user-stats)
43+
- [App](#app)
44+
45+
### News
46+
The [Steam News](https://developer.valvesoftware.com/wiki/Steam_Web_API#GetNewsForApp_.28v0002.29) web api is used to get articles for games.
47+
48+
```php
49+
Steam::news()
50+
```
51+
52+
#### GetNewsForApp
53+
This method will get the news articles for a given app id. It has three parameters.
54+
55+
##### Arguments
56+
57+
Name | Type | Description | Required | Default
58+
-----|------|-------------|----------|---------
59+
appId| int | The id for the app you want news on | Yes
60+
count | int | The number of news items to return | No | 5
61+
maxlength | int | The maximum number of characters to return | No | null
62+
63+
Example usage
64+
65+
```php
66+
<?php
67+
$news = Steam::news()->GetNewsForApp($appId, 5, 500)->newsitems;
68+
?>
69+
```
70+
71+
### Player
72+
The [Player Service](https://developer.valvesoftware.com/wiki/Steam_Web_API#GetOwnedGames_.28v0001.29) is used to get details on players.
73+
74+
When instantiating the player class, you are required to pass a steamId.
75+
76+
```php
77+
Steam::player($steamId)
78+
```
79+
80+
#### GetSteamLevel
81+
This method will return the level of the steam user given. It simply returns the integer of their current level.
82+
83+
#### GetPlayerLevelDetails
84+
This will return a Syntax\Containers\Player_Level object with full details for the players level. The object contains the following properties.
85+
86+
- playerXp
87+
- playerLevel
88+
- xpToLevelUp
89+
- xpForCurrentLevel
90+
- currentLevelFloor
91+
- currentLevelCeieling
92+
- percentThroughLevel
93+
94+
#### GetBadges
95+
This call will give you a list of the badges that the player currently has. There is currently no schema for badges so all you will get is the id and details.
96+
97+
#### GetOwnedGames
98+
GetOwnedGames returns a list of games a player owns along with some playtime information, if the profile is publicly visible. Private, friends-only, and other privacy settings are not supported unless you are asking for your own personal details (ie the WebAPI key you are using is linked to the steamid you are requesting).
99+
100+
##### Arguments
101+
102+
Name | Type | Description | Required | Default
103+
-----|------|-------------|----------|---------
104+
includeAppInfo| boolean | Whether or not to include game details | No | true
105+
includePlayedFreeGames | boolean | Whether or not to include free games | No | false
106+
appIdsFilter | array | An array of appIds. These will be the only ones returned if the user has them | No | array()
107+
108+
This will return a collection of Syntax\SteamApi\Containers\Game objects. These objects contain the following properties.
109+
110+
- appId
111+
- name
112+
- playtimeTwoWeeks
113+
- playtimeForever
114+
- playtimeForeverReadable
115+
- icon
116+
- logo
117+
- header
118+
- hasCommunityVisibleStats
119+
120+
#### GetRecentlyPlayedGames
121+
GetRecentlyPlayedGames returns a list of games a player has played in the last two weeks, if the profile is publicly visible. Private, friends-only, and other privacy settings are not supported unless you are asking for your own personal details (ie the WebAPI key you are using is linked to the steamid you are requesting).
122+
123+
##### Arguments
124+
125+
Name | Type | Description | Required | Default
126+
-----|------|-------------|----------|---------
127+
count| int | The number of games to return | No | null
128+
129+
This will return a collection of Syntax\SteamApi\Containers\Game objects.
130+
131+
#### IsPlayingSharedGame
132+
IsPlayingSharedGame returns the original owner's SteamID if a borrowing account is currently playing this game. If the game is not borrowed or the borrower currently doesn't play this game, the result is always 0.
133+
134+
##### Arguments
135+
136+
Name | Type | Description | Required | Default
137+
-----|------|-------------|----------|---------
138+
appId| int | The game to check for | Yes |
139+
140+
### User
141+
The [User](https://developer.valvesoftware.com/wiki/Steam_Web_API#GetFriendList_.28v0001.29) WebAPI call is used to get details about the user specifically.
142+
143+
When instantiating the user class, you are required to pass a steamId.
144+
145+
```php
146+
Steam::user($steamId)
147+
```
148+
149+
#### GetPlayerSummaries
150+
This will return details on the user.
151+
152+
##### Arguments
153+
154+
Name | Type | Description | Required | Default
155+
-----|------|-------------|----------|---------
156+
steamId| int[] | An array of (or singular) steam id(s) to get details for | No | Steam id passed to user()
157+
158+
```php
159+
$player = Steam::user($steamId)->GetPlayerSummaries()[0];
160+
```
161+
162+
This will return a Syntax\SteamApi\Containers\Player object with the following properties.
163+
164+
- steamId
165+
- communityVisibilityState
166+
- profileState
167+
- personaName
168+
- lastLogoff
169+
- profileUrl
170+
- avatar
171+
- avatarMedium
172+
- avatarFull
173+
- personaState
174+
- primaryClanId
175+
- timecreated
176+
- personaStateFlags
177+
178+
#### GetFriendList
179+
Returns the friend list of any Steam user, provided his Steam Community profile visibility is set to "Public".
180+
181+
##### Arguments
182+
183+
Name | Type | Description | Required | Default
184+
-----|------|-------------|----------|---------
185+
relationship| string (all or friend) | The type of friends to get | No | all
186+
187+
Once the list of friends is gathered, it is passed through [GetPlayerSummaries](#GetPlayerSummaries). This allows you to get back a collection of Player objects.
188+
189+
### User Stats
190+
The [User Stats](https://developer.valvesoftware.com/wiki/Steam_Web_API#GetPlayerAchievements_.28v0001.29) WebAPI call is used to get details about a user's gaming.
191+
192+
When instantiating the user stats class, you are required to pass a steamId.
193+
194+
```php
195+
Steam::userStats($steamId)
196+
```
197+
198+
#### GetPlayerAchievements
199+
Returns a list of achievements for this user by app id.
200+
201+
##### Arguments
202+
203+
Name | Type | Description | Required | Default
204+
-----|------|-------------|----------|---------
205+
appId| int | The id of the game you want the user's achievements in | Yes |
206+
207+
This will return a Syntax\SteamApi\Containers\Achievement object with the following properties.
208+
209+
- apiName
210+
- achieved
211+
- name
212+
- description
213+
214+
#### GetGlobalAchievementPercentagesForApp
215+
This method will return a list of all chievements for the specified game and the percentage that each achievement has been unlocked.
216+
217+
##### Arguments
218+
219+
Name | Type | Description | Required | Default
220+
-----|------|-------------|----------|---------
221+
appId| int | The id of the game you want the user's achievements in | Yes |
222+
223+
#### GetUserStatsForGame
224+
Returns a list of achievements for this user by app id.
225+
226+
##### Arguments
227+
228+
Name | Type | Description | Required | Default
229+
-----|------|-------------|----------|---------
230+
appId| int | The id of the game you want the user's achievements in | Yes |
231+
232+
This returns the steam api objects. The details are very minimal.
233+
234+
Example output for Rocksmith 2014
235+
236+
```php
237+
Array
238+
(
239+
[0] => stdClass Object
240+
(
241+
[name] => ACHIEVEMENT_1
242+
[achieved] => 1
243+
)
244+
245+
[1] => stdClass Object
246+
(
247+
[name] => ACHIEVEMENT_2
248+
[achieved] => 1
249+
)
250+
251+
[2] => stdClass Object
252+
(
253+
[name] => ACHIEVEMENT_45
254+
[achieved] => 1
255+
)
256+
257+
[3] => stdClass Object
258+
(
259+
[name] => ACHIEVEMENT_49
260+
[achieved] => 1
261+
)
262+
263+
)
264+
```
265+
266+
### App
267+
This area will get details for games.
268+
269+
```php
270+
Steam::app()
271+
```
272+
273+
#### appDetails
274+
This gets all the details for a game. This is most of the infomation from the store page of a game.
275+
276+
##### Arguments
277+
278+
Name | Type | Description | Required | Default
279+
-----|------|-------------|----------|---------
280+
appIds| int[] | The ids of the games you want details for | Yes |
281+
282+
This will return a Syntax\SteamApi\Containers\App object with the following properties.
283+
284+
- id
285+
- name
286+
- controllerSupport
287+
- description
288+
- about
289+
- header
290+
- website
291+
- pcRequirements
292+
- legal
293+
- developers
294+
- publishers
295+
- price
296+
- platforms
297+
- metacritic
298+
- categories
299+
- genres
300+
- release
301+
302+
#### GetAppList
303+
This method will return an array of app objects directly from steam. It includes the appId and the app name.
304+
305+
Example output
306+
```php
307+
Array
308+
(
309+
[0] => stdClass Object
310+
(
311+
[appid] => 5
312+
[name] => Dedicated Server
313+
)
314+
315+
[1] => stdClass Object
316+
(
317+
[appid] => 7
318+
[name] => Steam Client
319+
)
320+
321+
[2] => stdClass Object
322+
(
323+
[appid] => 8
324+
[name] => winui2
325+
)
326+
327+
[3] => stdClass Object
328+
(
329+
[appid] => 10
330+
[name] => Counter-Strike
331+
)
332+
)
333+
```

src/Syntax/SteamApi/Steam/Player.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public function GetSteamLevel()
2929
public function GetPlayerLevelDetails()
3030
{
3131
$details = $this->GetBadges();
32-
// ppd($details);
3332

3433
$details = new Containers\Player_Level($details);
3534

0 commit comments

Comments
 (0)