用于访问信息并与用户交互。
参见
IPlayerService,了解其他方法。
请参见
Web API 概览,了解更多有关使用 Steamworks Web API 的信息。
CheckAppOwnership
GET https://partner.steam-api.com/ISteamUser/CheckAppOwnership/v4/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 发行商验证密钥。 |
| steamid | uint64 | ✔ | 用户的 SteamID。 |
| appid | uint32 | ✔ | 要查询其所有权的 AppID。 |
查看指定用户是否拥有该应用。 要检查用户是否拥有有效许可,您只需检查 ownsapp 字段是否为 true 即可。 其他字段适用于仅授予游戏购买者某些内容(如授予游戏内货币)的情况。
JSON 格式的响应将包含以下字段:
| 名称 | 类型 | 描述 |
|---|
| ownsapp | bool | 指明用户是否拥有此应用的有效许可。 |
| permanent | bool | 用户是否永久拥有您的应用。 通过家庭共享、免费周末、网吧计划获得的所有权则不为 true。 |
| timestamp | string | 获取该应用的时间。 |
| timeexpires | string | 应用许可失效的时间。 永久许可被标记为“never”。 |
| ownersteamid | uint64 | 如果用户是通过“家庭共享”访问此应用,则指明真正的拥有者。 否则,将会是传入的同一个 steamID。 |
| sitelicense | bool | 指明用户是否通过网吧计划访问此应用。 |
| usercanceled | bool | 指明是否用户自行取消了此应用的许可。 |
此方法有官方不再支持的旧版。 旧版可以继续使用,但我们强烈建议您使用最新版本。
变更历史:
- 第 2 版 - 将元素 siteliense 添加至响应。
- 第 3 版 - 将元素 usercanceled 添加至响应。
- 第 4 版 - 将元素 timeexpires 添加至响应。
注意: 此调用要求拥有指定 App ID 的发行商 API 密钥以使用此方法。 因此,此 API
必须通过安全服务器调用,且绝不能由客户端直接调用!
GetAppPriceInfo
GET https://partner.steam-api.com/ISteamUser/GetAppPriceInfo/v1/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 发行商验证密钥。 |
| steamid | uint64 | ✔ | 用户的 SteamID。 |
| appids | string | ✔ | 逗号分隔的 appid 列表(最多 100 个)。 |
注意: 此调用需要发行商 API 密钥以使用此方法。 因此,此 API
必须通过安全服务器调用,且绝不能由客户端直接调用!
响应示例:{
"price_info": {
"220": {
"packageid": 36,
"currency": "USD",
"initial_price": 999,
"final_price": 999,
"discount_percent": 0
}
}
}
GetDeletedSteamIDs
GET https://partner.steam-api.com/ISteamUser/GetDeletedSteamIDs/v1/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 发行商验证密钥。 |
| rowversion | uint64 | ✔ | 一个未签名 64 位值,用来浏览已删除的帐户。 首次调用此 API 时传入 0,然后为每次的额外请求传入上次调用返回的值。 该值将需要存储在您的服务器上,以供将来调用使用。 |
您可以使用 GetDeletedSteamIDs 来获取曾拥有您游戏的已删除帐户列表。 创建此 API 是为了允许删除与用户相关的数据,以便遵守欧盟数据保护条例(GDPR),并服务于其他与个人信息有关的目的。
所提供的 Steamworks 发行商密钥可用于验证及生成用于核对的 appid 列表。
GetFriendList
GET https://partner.steam-api.com/ISteamUser/GetFriendList/v1/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 用户验证密钥。 |
| steamid | uint64 | ✔ | 用户的 SteamID。 |
| relationship | string | | 关系类型(如:好友)。 |
如果用户的好友列表被设为私密,则调用 GetFriendList 时将返回 HTTP 401 Unauthorized(未授权)。
GetPlayerBans
GET https://partner.steam-api.com/ISteamUser/GetPlayerBans/v1/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 用户验证密钥。 |
| steamids | string | ✔ | 逗号分隔的 SteamID 列表。 |
GetPlayerSummaries
GET https://partner.steam-api.com/ISteamUser/GetPlayerSummaries/v2/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 用户验证密钥。 |
| steamids | string | ✔ | 逗号分隔的 SteamID 列表(最多 100 个)。 |
注意: 仅当您的网站需要显示有关用户的信息时,才应使用此调用。 如果您的游戏客户端需要此类信息,请改用客户端 API。
此方法有官方不再支持的旧版。 旧版可以继续使用,但我们强烈建议您使用最新版本。
变更历史:
以下为调用的响应示例:
"response":{
"players":[
{
"steamid":"77561198355051011",
"communityvisibilitystate":1,
"profilestate":1,
"personaname":"Mister Manager",
"lastlogoff":1556305001,
"profileurl":"https://steamcommunity.com/profiles/77561198355051011/",
"avatar":"https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/32/32f70a383a437d03af91d2f01a0776adf75201b5.jpg",
"avatarmedium":"https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/32/32f70a383a437d03af91d2f01a0776adf75201b5_medium.jpg",
"avatarfull":"https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/32/32f70a383a437d03af91d2f01a0776adf75201b5_full.jpg",
},
{
"steamid":"77561197978236369",
"communityvisibilitystate":3,
"profilestate":1,
"personaname":"Olive The Dog",
"lastlogoff":1556239336,
"profileurl":"https://steamcommunity.com/id/olive_the_dog/",
"avatar":"https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/41/555d2fbb879593c0565ce0489428a09c019feffa.jpg",
"avatarmedium":"https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/41/555d2fbb879593c0565ce0489428a09c019feffa_medium.jpg",
"avatarfull":"https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/41/555d2fbb879593c0565ce0489428a09c019feffa_full.jpg",
}
]
}
GetPublisherAppOwnership
获取 https://partner.steam-api.com/ISteamUser/GetPublisherAppOwnership/v4/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 发行商验证密钥。 |
| steamid | uint64 | ✔ | 用户的 SteamID。 |
此方法有官方不再支持的旧版。 旧版可以继续使用,但我们强烈建议您使用最新版本。
变更历史:
- 第 3 版 - 将元素 siteliense 添加至响应。
- 第 4 版 - 将元素 usercanceled 添加至响应。
- 第 5 版 - 将元素 timeexpires 添加至响应。
以下为调用的响应示例:
"appownership":{
"apps":[
{
"appid": 60,
"ownsapp": true,
"permanent": true,
"timestamp": "2005-04-03T17:50:29Z",
"timeexpires": "never",
"ownersteamid": "76561197978236369",
"sitelicense": false,
"usercanceled": false
},
{
"appid": 220,
"ownsapp": false,
"permanent": false,
"timestamp": "2024-09-17T22:27:02Z",
"timeexpires": "never",
"ownersteamid": "0",
"sitelicense": false,
"usercanceled": true,
"timedtrial": false
}
]
}
在上方的示例中,steamID 76561197978236369 购买了 appID 60, 此外还购买了 appID 220,但通过 Steam 客服站点自行取消了购买。 该响应将只包含已拥有的或用户取消的(usercanceled)应用。 如果未拥有任何应用,则响应会包含空的应用字段。
JSON 格式的响应将包含以下字段:
| 名称 | 类型 | 描述 |
|---|
| appid | uint32 | 与您的 WebAPI 密钥相关联的 AppID |
| ownsapp | bool | 用户当前是否拥有您的应用。 通过购买、序列号、免费周末、网吧计划获得的所有权将为 true。 |
| permanent | bool | 用户是否永久拥有您的应用。 通过家庭共享、免费周末、网吧计划获得的所有权则不为 true。 |
| timestamp | string | 用户首次获得 appID 的时间,以 GMT 表示 |
| timeexpires | string | 应用许可失效的时间。 永久许可被标记为“never”。 |
| ownersteamid | uint64 | 如果用户是通过“家庭共享”访问此应用,则指明真正的拥有者。 否则,将会是传入的同一个 steamID。 |
| sitelicense | bool | 指明用户是否通过网吧计划访问此应用。 |
| usercanceled | bool | 指明是否用户自行取消了其持有的此应用的许可。 |
注意: 此调用需要发行商 API 密钥才能使用此方法。 因此,此 API
必须通过安全服务器调用,且绝不能由客户端直接调用!
GetUserGroupList
GET https://partner.steam-api.com/ISteamUser/GetUserGroupList/v1/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 发行商验证密钥。 |
| steamid | uint64 | ✔ | 用户的 SteamID。 |
ResolveVanityURL
GET https://partner.steam-api.com/ISteamUser/ResolveVanityURL/v1/
| 名称 | 类型 | 是否必需 | 描述 |
| key | string | ✔ | Steamworks Web API 用户验证密钥。 |
| vanityurl | string | ✔ | 为其获取 SteamID 的虚 URL。 |
| url_type | int32 | | 虚 URL 类型。 1(默认):个人资料;2:组;3:官方游戏组。 |