Steam trading cards API or achievements api

和自甴很熟 提交于 2021-02-04 19:46:05

问题


Is there an API to get a user's steam trading cards?

I'm not very familiar with steam but it doesn't seem to be on this page.

https://developer.valvesoftware.com/wiki/Steam_Web_API#GetPlayerSummaries_.28v0001.29

There's an achievements API would that get me the trading cards info as well?


回答1:


There is not an API for the trading cards (yet). You can, however, still find them. It does depend on the user's privacy settings though. I went into more detail on this question and believe it will help you out.

Achievements can be pulled via the GetPlayerAchievements API call using the following format:

http://api.steampowered.com/ISteamUserStats/GetPlayerAchievements/v0001/?appid=<APPID>&key=<APIKEY>&steamid=<PROFILEID>l=<LANG>

APPID is the application ID the achievements are associated with (ie. Team Fortress 2 is 440) APIKEY is the API key Valve assigned you PROFILEID is the 64bit player ID give to you when you sign up on steam LANG is the language you wish to return the descriptions in (this parameter is optional and not including it removes the name and description fields from the results). en is for English.

In the response is a listing of all of the achievements in the game.

{
    "apiname": "TF_MVM_PYRO_BOMB_RESET",
    "achieved": 0,
    "name": "Hard Reset",
    "description": "As a Pyro, reset the bomb 3 times in a single wave."
},
{
    "apiname": "TF_MVM_ENGINEER_ESCAPE_SENTRY_BUSTER",
    "achieved": 1,
    "name": "Real Steal",
    "description": "As an Engineer, escape with your sentry as a sentry buster is about to detonate."
},


来源:https://stackoverflow.com/questions/17411282/steam-trading-cards-api-or-achievements-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!