steam_api_client 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0b06cbf7dc49fbd605cab7c84469fd11a1bde80779469db95bbe30b5867701d
4
- data.tar.gz: 5b32661f36c1ad7495760925e0348f5778933bd647f0f876b3bdbfdcc8a621df
3
+ metadata.gz: 410a0d3b36b83ac8888323849214253b0d0ba26501d1218ad7f48176eb8dd2af
4
+ data.tar.gz: 89f42dc5315420c9cbe41b3bb5b0eb1c511c1ca6c7133d7305c4ec700e1a6f31
5
5
  SHA512:
6
- metadata.gz: 887564c19ec25082f2498e8f55c2c316b499abd4c19d3bf00ed97206f7c2028fa81e1266649470fd6f2966aa2c39f5f99d8f5726e406d0bd52dfaa787b269c63
7
- data.tar.gz: '04545587357f1c91db0e6fa2fb4585c029f9b363aa09c55815d8222d12c39e79190d404a22c9bf38b4df86ed6f75c251d970165a96331519fec24a0dda57de86'
6
+ metadata.gz: ddff8c5f6b2a3b2e4faf56dccf572dd659517125b0f29a2c224b2eafb782319218c956a1b3cb2c131c988382da58eb05125c84a7bf80eb5de891d8a768cfe8fb
7
+ data.tar.gz: 34bd9e558c5d1a29453e02dfd76c709876765b2c1958744d5cdac985045e7b04c09cbc7c51d1706fe81df0d1ab54d2fdbaf4d411335ad2038ae86236b6a0da5e
data/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.6.0] - 2026-11-04
10
+
11
+ ### Added
12
+
13
+ - `app_list`: the apps in the store, a page at a time (up to 50,000 per call), filtered by type or by last change (#109).
14
+
15
+ ## [1.5.0] - 2026-11-04
16
+
17
+ ### Added
18
+
19
+ - `player_bans` and `player_badges`: VAC, game, community and trade ban status of up to 100 players, and a player's badges and level progress (#106).
20
+
9
21
  ## [1.4.0] - 2026-11-04
10
22
 
11
23
  ### Added
@@ -222,7 +234,9 @@ The versions below were bumped in `version.rb` during development but **never pu
222
234
 
223
235
  - Initial gem skeleton.
224
236
 
225
- [Unreleased]: https://github.com/jpechaves/steam_api/compare/v1.4.0...HEAD
237
+ [Unreleased]: https://github.com/jpechaves/steam_api/compare/v1.6.0...HEAD
238
+ [1.6.0]: https://github.com/jpechaves/steam_api/compare/v1.5.0...v1.6.0
239
+ [1.5.0]: https://github.com/jpechaves/steam_api/compare/v1.4.0...v1.5.0
226
240
  [1.4.0]: https://github.com/jpechaves/steam_api/compare/v1.3.0...v1.4.0
227
241
  [1.3.0]: https://github.com/jpechaves/steam_api/compare/v1.2.0...v1.3.0
228
242
  [1.2.0]: https://github.com/jpechaves/steam_api/compare/v1.1.0...v1.2.0
data/docs/USAGE.md CHANGED
@@ -191,6 +191,33 @@ stats.achievements.first # => #<data SteamApiClient::PlayerGameStats::Achievemen
191
191
 
192
192
  Stat values are Integers or Floats, as the game defines them. A private profile, or a game without stats, raises `Errors::HttpBadRequest`.
193
193
 
194
+ #### `player_bans`
195
+
196
+ 🔑 The ban status of up to 100 players. Steam leaves out IDs it doesn't know, and silently ignores IDs after the 100th.
197
+
198
+ ```ruby
199
+ client.player_bans.retrieve(steamids: [76561197960435530, 76561198000000001])
200
+ # => [#<data SteamApiClient::PlayerBan steam_id=76561197960435530, community_banned=false, vac_banned=false, number_of_vac_bans=0,
201
+ # days_since_last_ban=0, number_of_game_bans=0, economy_ban="none">, ...]
202
+ ```
203
+
204
+ `days_since_last_ban` counts from the last VAC or game ban (`0` when never banned). `number_of_game_bans` are bans set by game developers. `economy_ban` is the trade ban status: `"none"`, `"probation"` or `"banned"`.
205
+
206
+ #### `player_badges`
207
+
208
+ 🔑 A player's badges and Steam level progress, or `nil` when the profile isn't public.
209
+
210
+ ```ruby
211
+ progress = client.player_badges.retrieve(steamid: 76561198000000001)
212
+ progress.player_level # => 157
213
+ progress.player_xp_needed_to_level_up # => 1530
214
+ progress.badges.first
215
+ # => #<data SteamApiClient::PlayerBadges::Badge badge_id=13, level=1280, completion_time=1787785402, xp=1530, scarcity=251922,
216
+ # app_id=nil, community_item_id=nil, border_color=nil>
217
+ ```
218
+
219
+ `scarcity` is how many players have the badge. Game (trading card) badges also have `app_id`, `community_item_id` and `border_color` (`1` for foil). Times are unix timestamps. An ID that isn't a valid SteamID raises `Errors::HttpBadRequest`.
220
+
194
221
  #### `player_wishlist`
195
222
 
196
223
  The apps on a player's wishlist. No key needed.
@@ -309,6 +336,36 @@ lists.top_sellers.items.map(&:name)
309
336
 
310
337
  `SteamApiClient::FeaturedCategories` fields: `specials`, `coming_soon`, `top_sellers`, `new_releases`, each a `FeaturedCategories::Category` (`id`, `name` in the requested language, `items`: `FeaturedItem`), or `nil` when Steam leaves the list out. Steam also sends the spotlights, the daily deal, genres and trailers, whose shapes vary: use `retrieve_raw` for those.
311
338
 
339
+ #### `app_list`
340
+
341
+ 🔑 One page of the apps in the store, in app ID order. It's the way to find an app's ID by name across the whole catalog (`store_search` returns at most 10 results). `nil` when there's nothing: past the last page, or no app changed since `if_modified_since`.
342
+
343
+ - `include_games:` (default `true`), `include_dlc:`, `include_software:`, `include_videos:`, `include_hardware:` (default `false`) pick the types.
344
+ - `max_results:` is the page size, 10,000 by default, up to 50,000.
345
+ - `last_appid:` starts after that app: pass the previous page's `last_app_id` to get the next page.
346
+ - `if_modified_since:` (unix time) only returns apps changed since then.
347
+
348
+ ```ruby
349
+ page = client.app_list.retrieve(max_results: 5)
350
+ # => #<data SteamApiClient::AppList apps=[#<data SteamApiClient::AppList::App app_id=10, name="Counter-Strike",
351
+ # last_modified=1745368572, price_change_number=39636801>, ...], have_more_results=true, last_app_id=50>
352
+
353
+ # Every game, a page at a time (about 200,000 in 4 calls)
354
+ apps = []
355
+ last_appid = 0
356
+ loop do
357
+ page = client.app_list.retrieve(last_appid: last_appid, max_results: 50_000)
358
+ break unless page
359
+
360
+ apps.concat(page.apps)
361
+ break unless page.have_more_results
362
+
363
+ last_appid = page.last_app_id
364
+ end
365
+ ```
366
+
367
+ On the last page Steam leaves out `have_more_results` (so `false`) and `last_app_id` (`nil`).
368
+
312
369
  #### `app_news`
313
370
 
314
371
  The latest news of an app. `count:` is required, `maxlength:` (default 300) shortens each item's contents.
@@ -441,6 +498,6 @@ Don't retry other 4xx errors: they won't succeed on their own.
441
498
 
442
499
  - **Rate limits.** Steam's [Web API terms](https://steamcommunity.com/dev/apiterms) allow 100,000 calls per day per key. The Storefront API (`app_details`, `package_details`, `app_dlc`, `store_search`, `featured`, `featured_categories`) is rate limited per IP address, commonly reported at about 200 requests per 5 minutes. Both answer `429` when you go over. Cache what you can.
443
500
  - **The Storefront API is unofficial.** The Storefront endpoints use the API behind Steam's store and Big Picture mode. Valve doesn't document it, and its fields change without notice.
444
- - **Private profiles.** What a player hides depends on their privacy settings. Depending on the endpoint, Steam answers with an error (`player_achievements`: 403, `player_game_stats`: 400, `player_friends`: 401) or with empty data, which the gem returns as `nil` or `[]` (`player_owned_games`, `player_recent_games`, `player_level`, `player_wishlist`, `player_wishlist_count`, `player_followed_games`). Steam answers the same way for an empty wishlist, so the wishlist endpoints can't tell the two apart. `player_summaries` still returns the public part of the profile.
501
+ - **Private profiles.** What a player hides depends on their privacy settings. Depending on the endpoint, Steam answers with an error (`player_achievements`: 403, `player_game_stats`: 400, `player_friends`: 401) or with empty data, which the gem returns as `nil` or `[]` (`player_owned_games`, `player_recent_games`, `player_level`, `player_badges`, `player_wishlist`, `player_wishlist_count`, `player_followed_games`). Steam answers the same way for an empty wishlist, so the wishlist endpoints can't tell the two apart. `player_summaries` still returns the public part of the profile.
445
502
  - **The key is in the URL.** Steam requires `?key=...` in the query string. Treat logs of request URLs as secrets (see [Configuration](#configuration)), and [rotate your key](https://steamcommunity.com/dev/apikey) if it leaks.
446
503
  - **SteamIDs are 64 bit Integers** (e.g. `76561197960435530`). Use `player_steamid` to get one from a vanity URL.
@@ -44,6 +44,26 @@ module SteamApiClient
44
44
  params: {appid: param.integer(as: :gameid)}
45
45
  ),
46
46
 
47
+ # One page of the apps in the store, by app ID => AppList, or nil when there's nothing
48
+ # (past the last page, or nothing modified since if_modified_since)
49
+ # @see https://steamapi.xpaw.me/#IStoreService/GetAppList
50
+ Endpoint.new(
51
+ :app_list, "IStoreService/GetAppList/v1/", returns: AppList, at: %i[response],
52
+ params: {
53
+ include_games: param.boolean(default: true),
54
+ include_dlc: param.boolean(default: false),
55
+ include_software: param.boolean(default: false),
56
+ include_videos: param.boolean(default: false),
57
+ include_hardware: param.boolean(default: false),
58
+ # Only apps changed since then, in unix time (0 for all)
59
+ if_modified_since: param.integer(default: 0),
60
+ # The previous page's last_app_id (0 for the first page)
61
+ last_appid: param.integer(default: 0),
62
+ # Apps per page, up to 50,000
63
+ max_results: param.integer(default: 10_000)
64
+ }
65
+ ),
66
+
47
67
  # Latest news of an app => [NewsItem]
48
68
  # @see https://developer.valvesoftware.com/wiki/Steam_Web_API#GetNewsForApp_.28v0002.29
49
69
  Endpoint.new(
@@ -116,6 +136,20 @@ module SteamApiClient
116
136
  params: {appid: param.integer, steamid: param.integer}
117
137
  ),
118
138
 
139
+ # A player's badges and Steam level progress => PlayerBadges, or nil when the profile isn't public
140
+ # @see https://steamapi.xpaw.me/#IPlayerService/GetBadges
141
+ Endpoint.new(
142
+ :player_badges, "IPlayerService/GetBadges/v1/", returns: PlayerBadges, at: %i[response],
143
+ params: {steamid: param.integer}
144
+ ),
145
+
146
+ # Ban status of up to 100 players => [PlayerBan] (unknown IDs are left out)
147
+ # @see https://steamapi.xpaw.me/#ISteamUser/GetPlayerBans
148
+ Endpoint.new(
149
+ :player_bans, "ISteamUser/GetPlayerBans/v1/", returns: [PlayerBan], at: %i[players],
150
+ params: {steamids: param.integer_list}
151
+ ),
152
+
119
153
  # The apps a player follows in the store => [Integer] app IDs ([] when not public)
120
154
  # @see https://steamapi.xpaw.me/#IStoreService/GetGamesFollowed
121
155
  Endpoint.new(
@@ -0,0 +1,22 @@
1
+ module SteamApiClient
2
+ # Built first, then named AppList::App below
3
+ app = Model.define(
4
+ app_id: [:integer, from: :appid],
5
+ name: :string,
6
+ # In unix time
7
+ last_modified: [:integer, optional: true],
8
+ # Changes whenever the app's price changes
9
+ price_change_number: [:integer, optional: true]
10
+ )
11
+
12
+ # One page of the apps in the store, from `app_list`
13
+ # @see https://steamapi.xpaw.me/#IStoreService/GetAppList
14
+ AppList = Model.define(
15
+ apps: [[app], default: []],
16
+ # Steam leaves these out on the last page
17
+ have_more_results: [:boolean, default: false],
18
+ # Pass as `last_appid:` to get the next page
19
+ last_app_id: [:integer, from: :last_appid, optional: true]
20
+ )
21
+ AppList.const_set(:App, app)
22
+ end
@@ -0,0 +1,29 @@
1
+ module SteamApiClient
2
+ # Built first, then named PlayerBadges::Badge below
3
+ badge = Model.define(
4
+ badge_id: [:integer, from: :badgeid],
5
+ level: :integer,
6
+ # In unix time
7
+ completion_time: :integer,
8
+ xp: :integer,
9
+ # How many players have this badge
10
+ scarcity: :integer,
11
+ # Only for game badges (trading cards)
12
+ app_id: [:integer, from: :appid, optional: true],
13
+ community_item_id: [:integer, from: :communityitemid, optional: true],
14
+ # 1 for a foil badge
15
+ border_color: [:integer, optional: true]
16
+ )
17
+
18
+ # A player's badges and Steam level progress, from `player_badges`
19
+ # @see https://steamapi.xpaw.me/#IPlayerService/GetBadges
20
+ PlayerBadges = Model.define(
21
+ player_level: :integer,
22
+ player_xp: :integer,
23
+ # The XP where the current level starts, and what's left for the next one
24
+ player_xp_needed_current_level: :integer,
25
+ player_xp_needed_to_level_up: :integer,
26
+ badges: [[badge], default: []]
27
+ )
28
+ PlayerBadges.const_set(:Badge, badge)
29
+ end
@@ -0,0 +1,17 @@
1
+ module SteamApiClient
2
+ # A player's ban status, from `player_bans`. Steam names these keys in PascalCase.
3
+ # @see https://steamapi.xpaw.me/#ISteamUser/GetPlayerBans
4
+ PlayerBan = Model.define(
5
+ steam_id: [:integer, from: :SteamId],
6
+ # Banned from the Steam Community
7
+ community_banned: [:boolean, from: :CommunityBanned],
8
+ vac_banned: [:boolean, from: :VACBanned],
9
+ number_of_vac_bans: [:integer, from: :NumberOfVACBans],
10
+ # Days since the last VAC or game ban (0 when never banned)
11
+ days_since_last_ban: [:integer, from: :DaysSinceLastBan],
12
+ # Bans set by game developers
13
+ number_of_game_bans: [:integer, from: :NumberOfGameBans],
14
+ # Trade ban status: "none", "probation" or "banned"
15
+ economy_ban: [:string, from: :EconomyBan]
16
+ )
17
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SteamApiClient
4
- VERSION = "1.4.0"
4
+ VERSION = "1.6.0"
5
5
  end
@@ -23,6 +23,8 @@ require_relative "steam_api_client/errors/missing_api_token"
23
23
  require_relative "steam_api_client/errors/response_parse_error"
24
24
 
25
25
  require_relative "steam_api_client/models/player_summary"
26
+ require_relative "steam_api_client/models/player_ban"
27
+ require_relative "steam_api_client/models/player_badges"
26
28
  require_relative "steam_api_client/models/friend"
27
29
  require_relative "steam_api_client/models/game"
28
30
  require_relative "steam_api_client/models/player_achievements"
@@ -30,6 +32,7 @@ require_relative "steam_api_client/models/player_game_stats"
30
32
  require_relative "steam_api_client/models/news_item"
31
33
  require_relative "steam_api_client/models/global_achievement"
32
34
  require_relative "steam_api_client/models/app_schema"
35
+ require_relative "steam_api_client/models/app_list"
33
36
  require_relative "steam_api_client/models/app_details"
34
37
  require_relative "steam_api_client/models/package_details"
35
38
  require_relative "steam_api_client/models/app_dlc"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steam_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Pedro
@@ -55,6 +55,7 @@ files:
55
55
  - lib/steam_api_client/model/scalars.rb
56
56
  - lib/steam_api_client/models/app_details.rb
57
57
  - lib/steam_api_client/models/app_dlc.rb
58
+ - lib/steam_api_client/models/app_list.rb
58
59
  - lib/steam_api_client/models/app_schema.rb
59
60
  - lib/steam_api_client/models/featured.rb
60
61
  - lib/steam_api_client/models/featured_categories.rb
@@ -65,6 +66,8 @@ files:
65
66
  - lib/steam_api_client/models/news_item.rb
66
67
  - lib/steam_api_client/models/package_details.rb
67
68
  - lib/steam_api_client/models/player_achievements.rb
69
+ - lib/steam_api_client/models/player_badges.rb
70
+ - lib/steam_api_client/models/player_ban.rb
68
71
  - lib/steam_api_client/models/player_game_stats.rb
69
72
  - lib/steam_api_client/models/player_summary.rb
70
73
  - lib/steam_api_client/models/store_search_result.rb