steam_api_client 1.2.0 → 1.3.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: '09f9edc74aff7de3fa4975dca173fd7a3388ea4a732671b67db45e09de6a06e5'
4
- data.tar.gz: 92bbc4d8b4214e32fb2c8d5e8e5a18a3e6844712b4cf916552f02a46a96ec82b
3
+ metadata.gz: 63721ffd174da8e4b24173f6507837633cf1930945bb2378228a04cced136099
4
+ data.tar.gz: 1f4d9e6348bff39b44d7c09289ce74083eebb74e620cbba9020efc1a413f9530
5
5
  SHA512:
6
- metadata.gz: 87a2e53bcd76c574b6f6389071a5156073ad893734ef79377fb34c48406f120652dd93e0a4d8f79b2bd54b5984c6415a5a55e618839ba330d7febb6415c76af8
7
- data.tar.gz: 3ee3b3c3059e76060a40f63a14bfabd9881983f077f438c8ea90a239d6efeb89602cfed40c7022dfec6225b8b6578508f8821abecae7b4e7287ba0dd261fc60b
6
+ metadata.gz: aa49878ef1061a3b417924c89a6a8453404a70db5e5287205c1c19b3427ac9c82028574fcbfbba58a739ae0549f73222c4e5246ddf65a93687ba0a7d05168e07
7
+ data.tar.gz: 65dd3ce130994fb54155f674347da656f61231c4b9025bcd84625540f19173c247a809a92a1eab223ae6daf2f5470b7e2c481a9778c7c1918189b1a9f447a5ba
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.3.0] - 2026-11-02
10
+
11
+ ### Added
12
+
13
+ - `featured` and `featured_categories` from the Storefront API: the apps on the store's front page, and its specials, top sellers, new releases and upcoming apps. No API key needed (#108).
14
+
9
15
  ## [1.2.0] - 2026-11-02
10
16
 
11
17
  ### Added
@@ -210,7 +216,8 @@ The versions below were bumped in `version.rb` during development but **never pu
210
216
 
211
217
  - Initial gem skeleton.
212
218
 
213
- [Unreleased]: https://github.com/jpechaves/steam_api/compare/v1.2.0...HEAD
219
+ [Unreleased]: https://github.com/jpechaves/steam_api/compare/v1.3.0...HEAD
220
+ [1.3.0]: https://github.com/jpechaves/steam_api/compare/v1.2.0...v1.3.0
214
221
  [1.2.0]: https://github.com/jpechaves/steam_api/compare/v1.1.0...v1.2.0
215
222
  [1.1.0]: https://github.com/jpechaves/steam_api/compare/v1.0.0...v1.1.0
216
223
  [1.0.0]: https://github.com/jpechaves/steam_api/compare/v0.10.0...v1.0.0
data/docs/USAGE.md CHANGED
@@ -281,6 +281,34 @@ client.store_search.retrieve(term: "portal").first
281
281
 
282
282
  `price` is `nil` for free apps, `metascore` when the app has no Metacritic score. No match is `[]`.
283
283
 
284
+ #### `featured`
285
+
286
+ The apps featured on the store's front page, per platform. Storefront API, no key needed. Takes `country_code:` and `locale:`.
287
+
288
+ ```ruby
289
+ featured = client.featured.retrieve(country_code: "DE", locale: "german")
290
+ featured.featured_win.first
291
+ # => #<data SteamApiClient::FeaturedItem id=3447280, type=0, name="Fantasy World Manager", discounted=true, discount_percent=10,
292
+ # original_price=1499, final_price=1349, currency="EUR", discount_expiration=1794416432, ...>
293
+ ```
294
+
295
+ `SteamApiClient::Featured` fields: `large_capsules`, `featured_win`, `featured_mac`, `featured_linux` (each a list of `FeaturedItem`, `[]` when empty), `layout`.
296
+
297
+ `SteamApiClient::FeaturedItem` fields: `id`, `type` (`0` for apps), `name`, `discounted`, `discount_percent`, `original_price` and `final_price` (in cents; `original_price` is `nil` for free apps), `currency`, `discount_expiration` (unix time, `nil` when not discounted), `large_capsule_image`, `small_capsule_image`, `header_image`, `windows_available`, `mac_available`, `linux_available`, `streaming_video_available`, `controller_support`.
298
+
299
+ #### `featured_categories`
300
+
301
+ The store front page's lists: specials, upcoming apps, top sellers and new releases. Storefront API, no key needed. Takes `country_code:` and `locale:`.
302
+
303
+ ```ruby
304
+ lists = client.featured_categories.retrieve
305
+ lists.specials
306
+ # => #<data SteamApiClient::FeaturedCategories::Category id="cat_specials", name="Specials", items=[#<data SteamApiClient::FeaturedItem ...>, ...]>
307
+ lists.top_sellers.items.map(&:name)
308
+ ```
309
+
310
+ `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
+
284
312
  #### `app_news`
285
313
 
286
314
  The latest news of an app. `count:` is required, `maxlength:` (default 300) shortens each item's contents.
@@ -389,7 +417,7 @@ Don't retry other 4xx errors: they won't succeed on their own.
389
417
 
390
418
  ## Limits and caveats
391
419
 
392
- - **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`) 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.
420
+ - **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.
393
421
  - **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.
394
422
  - **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.
395
423
  - **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.
@@ -57,6 +57,26 @@ module SteamApiClient
57
57
  }
58
58
  ),
59
59
 
60
+ # The apps featured on the store's front page => Featured
61
+ # @see https://wiki.teamfortress.com/wiki/User:RJackson/StorefrontAPI#featured
62
+ Endpoint.new(
63
+ :featured, "featured/", api: :store, key: false, returns: Featured,
64
+ params: {
65
+ country_code: param.string(as: :cc, default: "US"),
66
+ locale: param.string(as: :l, default: "en")
67
+ }
68
+ ),
69
+
70
+ # The store front page's specials, top sellers, new releases and upcoming apps => FeaturedCategories
71
+ # @see https://wiki.teamfortress.com/wiki/User:RJackson/StorefrontAPI#featuredcategories
72
+ Endpoint.new(
73
+ :featured_categories, "featuredcategories/", api: :store, key: false, returns: FeaturedCategories,
74
+ params: {
75
+ country_code: param.string(as: :cc, default: "US"),
76
+ locale: param.string(as: :l, default: "en")
77
+ }
78
+ ),
79
+
60
80
  # Number of players currently in a game => Integer
61
81
  # @see https://wiki.teamfortress.com/wiki/WebAPI/GetNumberOfCurrentPlayers
62
82
  Endpoint.new(
@@ -0,0 +1,12 @@
1
+ module SteamApiClient
2
+ # The apps featured on the store's front page, from `featured`
3
+ # @see https://wiki.teamfortress.com/wiki/User:RJackson/StorefrontAPI#featured
4
+ Featured = Model.define(
5
+ large_capsules: [[FeaturedItem], default: []],
6
+ featured_win: [[FeaturedItem], default: []],
7
+ featured_mac: [[FeaturedItem], default: []],
8
+ featured_linux: [[FeaturedItem], default: []],
9
+ # The front page's layout, e.g. "defcon1"
10
+ layout: [:string, optional: true]
11
+ )
12
+ end
@@ -0,0 +1,21 @@
1
+ module SteamApiClient
2
+ # Built first, then named FeaturedCategories::Category below
3
+ category = Model.define(
4
+ # e.g. "cat_specials"
5
+ id: :string,
6
+ name: :string,
7
+ items: [[FeaturedItem], default: []]
8
+ )
9
+
10
+ # The store front page's lists, from `featured_categories`. The spotlights,
11
+ # daily deal, genres and trailers Steam also sends vary in shape, so they're
12
+ # left to `retrieve_raw`.
13
+ # @see https://wiki.teamfortress.com/wiki/User:RJackson/StorefrontAPI#featuredcategories
14
+ FeaturedCategories = Model.define(
15
+ specials: [category, optional: true],
16
+ coming_soon: [category, optional: true],
17
+ top_sellers: [category, optional: true],
18
+ new_releases: [category, optional: true]
19
+ )
20
+ FeaturedCategories.const_set(:Category, category)
21
+ end
@@ -0,0 +1,28 @@
1
+ module SteamApiClient
2
+ # An app on the store's front page, from `featured` and `featured_categories`.
3
+ # Every field but the ID is nil when Steam leaves it out.
4
+ # @see https://wiki.teamfortress.com/wiki/User:RJackson/StorefrontAPI#featured
5
+ FeaturedItem = Model.define(
6
+ id: :integer,
7
+ # 0 for apps
8
+ type: [:integer, optional: true],
9
+ name: [:string, optional: true],
10
+ discounted: [:boolean, optional: true],
11
+ discount_percent: [:integer, optional: true],
12
+ # In cents. nil for free apps.
13
+ original_price: [:integer, optional: true],
14
+ final_price: [:integer, optional: true],
15
+ currency: [:string, optional: true],
16
+ # When the discount ends, in unix time. nil when not discounted.
17
+ discount_expiration: [:integer, optional: true],
18
+ large_capsule_image: [:string, optional: true],
19
+ small_capsule_image: [:string, optional: true],
20
+ header_image: [:string, optional: true],
21
+ windows_available: [:boolean, optional: true],
22
+ mac_available: [:boolean, optional: true],
23
+ linux_available: [:boolean, optional: true],
24
+ streaming_video_available: [:boolean, from: :streamingvideo_available, optional: true],
25
+ # "full", "partial", or nil
26
+ controller_support: [:string, optional: true]
27
+ )
28
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SteamApiClient
4
- VERSION = "1.2.0"
4
+ VERSION = "1.3.0"
5
5
  end
@@ -33,6 +33,9 @@ require_relative "steam_api_client/models/app_details"
33
33
  require_relative "steam_api_client/models/package_details"
34
34
  require_relative "steam_api_client/models/app_dlc"
35
35
  require_relative "steam_api_client/models/store_search_result"
36
+ require_relative "steam_api_client/models/featured_item"
37
+ require_relative "steam_api_client/models/featured"
38
+ require_relative "steam_api_client/models/featured_categories"
36
39
  require_relative "steam_api_client/models/wishlist_item"
37
40
 
38
41
  require_relative "steam_api_client/endpoints"
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.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Pedro
@@ -55,6 +55,9 @@ 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/featured.rb
59
+ - lib/steam_api_client/models/featured_categories.rb
60
+ - lib/steam_api_client/models/featured_item.rb
58
61
  - lib/steam_api_client/models/friend.rb
59
62
  - lib/steam_api_client/models/game.rb
60
63
  - lib/steam_api_client/models/global_achievement.rb