Oh thank you, I love JSON. He was great in Transporter and The Expendables!
Comment has been collapsed.
Thank you for implementing JSON support, this it very anticipated feature!
However, I have some suggestions to make it more useful for developers.
Implement request to get all information about one particular giveaway, something like
https://www.steamgifts.com/giveaway/bPB69/?format=json
Result should include creator, winners, entries, groups, comments, actual game, cost in points. Would be great if it will also include additional information, such as: is game bundled/no value and/or steamID64's of groups (if any) and users (creator, winners, entries). Of course information returned should respect access rights, so if somebody can't get into GA - they won't get entries/groups (but will get the rest). This alone will allow to reduce requests greatly - instead of 5+ requests (main page, bundled page, groups page, winners page, entries page, resolve of group and user to steamID) it will be just one.
If for some reason you can't include additional information about game in request above, would be nice to have some special request to get game info: cost in points, bundled/no values status. Something like
https://www.steamgifts.com/appinfo/606880/?format=json
In all requests pagination should be user-defined, and optional. so, request
https://www.steamgifts.com/user/cg?format=json
should return ALL giveaways user created, and
https://www.steamgifts.com/user/cg?format=json&per_page=100
should return first page with 100 results.
Allow developers to get what they need without having to request it in parts, it will be both easier for them and less load on servers.
In addition to 3, it would be nice to have limits by certain dates, not by pages. For example,
https://www.steamgifts.com/user/cg?format=json&from_date=2020-01-01
should result in giveaways for this year, but not before. and
https://www.steamgifts.com/user/cg?format=json&from_date=2020-01-01&to_date=2020-01-31
should result in giveaways for January.
While to_date is optional, from_date is actually crucial. With this, tool developers can once request ALL giveaways, cache it, and then request only giveaways added since last check. Maybe this should be from_datetime, not just date, it will be even better. It may be even in unix time format, no need for it to be human readable, that's api after all.
In addition to 3 and 4, would be great to have another filter to get only active giveaways. It does not make any sense for main page of SG or won games by user, but it makes a lot of sense for user created game or group pages. For example
https://www.steamgifts.com/group/SJ7Bu/steamgifts?format=json&active=1
should return only active (not ended yet) giveaways. It many cases only this data is important, so there is no reason to return all data instead.
Comment has been collapsed.
Yes, you are right, IF there will be filter by end_timestamp
it will be possible to use it to get only active giveaways too.
Comment has been collapsed.
It's currently impossible to get to group info without knowing the full URL, which makes the whole API endpoint pointless. Please consider making https://www.steamgifts.com/group/SJ7Bu?format=json or https://www.steamgifts.com/group/SJ7Bu/?format=json possible to call.
Consider adding sg_name
to giveaways
response, it's stupid to extract it from the url. Also, I'd appreciate having internal ID of the Steam asset there, which is being used in request for hiding games on SG.
Comment has been collapsed.
That's a good idea.
Isn't the group name part the same one used in steam's group link? and since steam servers aren't rate limited, you can follow "http://www.steamcommunity.com/gid/103582791432125620" and get the group name from that, avoiding the additional request to SG.
Comment has been collapsed.
44 Comments - Last post 4 minutes ago by xvt
40 Comments - Last post 34 minutes ago by BSkorpion
291 Comments - Last post 1 hour ago by JX8
250 Comments - Last post 3 hours ago by McZero
795 Comments - Last post 5 hours ago by FranckCastle
364 Comments - Last post 5 hours ago by Zepy
44 Comments - Last post 6 hours ago by IronKnightAquila
803 Comments - Last post 6 minutes ago by Xiangming
128 Comments - Last post 11 minutes ago by PoeticKatana
91 Comments - Last post 12 minutes ago by 8urnout
2,321 Comments - Last post 24 minutes ago by NewbieSA
47 Comments - Last post 30 minutes ago by hbarkas
31 Comments - Last post 42 minutes ago by Moogal
602 Comments - Last post 48 minutes ago by ahmadismi
Hi everyone, I setup a few pages on our site to return data in JSON format to help out users developing add-ons and scripts. At the moment these pages are...
Homepage
https://www.steamgifts.com/?format=json
Profiles - Giveaways Created
https://www.steamgifts.com/user/cg?format=json
Profiles - Giveaways Won
https://www.steamgifts.com/user/cg/giveaways/won?format=json
Groups - Giveaways Created
https://www.steamgifts.com/group/SJ7Bu/steamgifts?format=json
Bundle Games
https://www.steamgifts.com/bundle-games?format=json
You can also use existing parameters with these requests. For example, if you wanted to view JSON data for recommended giveaways on our homepage, that have a release date in 2020 or later, you could use...
https://www.steamgifts.com/giveaways/search?format=json&type=recommended&release_date_min=2020-01-01
The previously discussed rate limits also apply to these JSON requests. However, a higher number of results are returned when requesting data in JSON format, so you'll be able to use a fewer number of requests.
All of the responses include page and per_page properties. As expected, these return the current page number and the number of results per page. At the moment 100 results are returned per page, except for the bundle list, which returns 1,000 results per page. These numbers may change in the future, so if you're writing a script don't hardcode the values but instead check if the number of results being returned equals per_page, and if so, request page + 1.
The following information will be returned for giveaways. If the "NULL" column in the below tables is "Yes", that means the property can be null. If the "Always Included" column is "Yes", that means the property will always be returned. For example, name, points, copies, app_id, and package_id will not be returned for open invite only giveaways that you do not have permission to view, and link will never be returned for invite only giveaways you do not have permission to view. The giveaway id is the internal SteamGifts ID for the giveaway. Likewise, the creator or winner id properties correspond to the internal SteamGifts user IDs. These can be useful when dealing with users that change usernames. You'll notice Steam IDs can be null, and that occurs when a user has deleted their account from SteamGifts.
If you're requesting a user's created or won giveaways, the response will include a user object containing properties for the profile. The id is the internal SteamGifts ID for the user.
If you're requesting a group's giveaways, the response will include a group object containing properties for the group. The id is the internal SteamGifts ID for the group and gid is the Steam group ID.
When requesting the JSON data for a user's won giveaways the response will include one additional property for each giveaway called received. This value will be true if the user has marked their gift as received and false when it's marked as not received.
There are a couple of additional parameters that can be assigned to requests. It's recommended you do not apply these parameters unless the information is required, since it requires more database queries and the responses are slightly slower. If you set include_feedback=1 in your requests, the response will include a feedback object containing the total number of winners that have marked each giveaway as received, not received, or awaiting feedback.
https://www.steamgifts.com/user/cg?format=json&include_feedback=1
If you set include_winners=1 in your requests, the response will include a winners array containing up to 50 winners for each giveaway. The received property will be true if the winner has marked their gift as received, false when it's marked as not received, and null when the winner has not provided feedback. The id, steam_id, and username may not be included in the response since winners on the site remain anonymous until feedback is provided.
https://www.steamgifts.com/user/cg?format=json&include_winners=1
Bundle Games
All of the below fields will be included in the results for bundle games, although any of the values can potentially be null when they don't apply to the game.
https://www.steamgifts.com/bundle-games?format=json
Comment has been collapsed.