本文档主要介绍xbox UI层面相关的网络接口,如获取主机列表、用户信息、云游戏列表,云游戏详情等。
获取当前账号下已注册的主机
前置条件: 已经登录,可以获取 1.10.1的webToken:
{
IssueInstant: '2024-05-08T09:26:59.4788867Z',
NotAfter: '2024-05-09T01:26:59.4788867Z',
Token: 'eyJlbmMiOi...UT5BPqexEDHfhwk2upiNzw', // 用于本次获取控制台列表
DisplayClaims: {
"xui": [
{
"gtg": "Geocld",
"xid": "2535466257699046",
"uhs": "8920341548513246887", // 用于本次获取控制台列表
"agg": "Adult",
"usr": "195 234",
"prv": "184 185 186 187 188 190 191 193 196 198 199 200 201 203 204 205 206 208 211 217 220 224 227 228 235 238 245 247 249 252 254 255"
}
]
}
}API: https://xccs.xboxlive.com/lists/devices?queryCurrentDevice=false&includeStorageDevices=true
Method: GET
header:
{
'Authorization': 'XBL3.0 x='+ webTokens.DisplayClaims.xui[0].uhs + ';' + webTokens.Token,
'Accept-Language' : 'en-US',
'x-xbl-contract-version': '2',
'x-xbl-client-name': 'XboxApp',
'x-xbl-client-type': 'UWA',
'x-xbl-client-version': '39.39.22001.0',
}response:
{
status: { errorCode: 'OK', errorMessage: null },
result: [
{
id: 'F4001D0F950AA28A',
name: '客厅 Xbox',
locale: 'zh-Hans-SG',
powerState: 'ConnectedStandby',
consoleType: 'XboxSeriesS'
}
],
agentUserId: null
}返回控制台包含了控制台名称、电源状态、主机型号等信息,最重要的是id,这个id将是开启串流的钥匙。
API: https://achievements.xboxlive.com/users/xuid(<xuid>)/history/titles
xuid = webTokens.DisplayClaims.xui[0].xid
Method: GET
Headers:
{
'Authorization': 'XBL3.0 x='+ webTokens.DisplayClaims.xui[0].uhs + ';' + webTokens.Token,
'Accept-Language' : 'en-US',
'x-xbl-contract-version': 2,
'x-xbl-client-name': 'XboxApp',
'x-xbl-client-type': 'UWA',
'x-xbl-client-version': '39.39.22001.0',
}API: https://achievements.xboxlive.com/users/xuid(<xuid>)/achievements?titleId=<titleId>&continuationToken=0
xuid = webTokens.DisplayClaims.xui[0].xid
Method: GET
Headers:
{
'Authorization': 'XBL3.0 x='+ webTokens.DisplayClaims.xui[0].uhs + ';' + webTokens.Token,
'Accept-Language' : 'en-US',
'x-xbl-contract-version': 2,
'x-xbl-client-name': 'XboxApp',
'x-xbl-client-type': 'UWA',
'x-xbl-client-version': '39.39.22001.0',
}API: https://peoplehub.xboxlive.com/users/me/people/social/decoration/preferredcolor,detail,multiplayersummary,presencedetail
Method: GET
Headers:
{
'Authorization': 'XBL3.0 x='+ webTokens.DisplayClaims.xui[0].uhs + ';' + webTokens.Token,
'Accept-Language' : 'en-US',
'x-xbl-contract-version': 3,
'x-xbl-client-name': 'XboxApp',
'x-xbl-client-type': 'UWA',
'x-xbl-client-version': '39.39.22001.0',
}Response:
[
"people": [
{
"xuid": "2535458150",
"isFavorite": false,
"isFollowingCaller": false,
"isFollowedByCaller": true,
"isIdentityShared": false,
"addedDateTimeUtc": "2023-12-25T06:59:16.718994Z",
"displayName": "Geocld",
"realName": "",
"displayPicRaw": "https://images-eds-ssl.xboxlive.com/image?url=8Oaj9Ryq1G1_p3lLnXlsaZgGzAie6Mnu24_PawYuDYIoH77pJ.X5Z.MqQPibUVTcS9jr0n8i7LY1tL3U7SfULCXYl1glXjH1LLAW4kQmnl7A45In&format=png",
"showUserAsAvatar": "2",
"gamertag": "Geocld",
"gamerScore": "16040",
"modernGamertag": "Geocld",
"modernGamertagSuffix": "6084",
"uniqueModernGamertag": "Geocld#6084",
"xboxOneRep": "GoodPlayer",
"presenceState": "Offline",
"presenceText": "Offline",
"presenceDevices": null,
"isBroadcasting": false,
"isCloaked": null,
"isQuarantined": false,
"isXbox360Gamerpic": false,
"lastSeenDateTimeUtc": null,
"suggestion": null,
"recommendation": null,
"search": null,
"titleHistory": null,
"multiplayerSummary": {
"InMultiplayerSession": 0,
"InParty": 0
},
"recentPlayer": null,
"follower": null,
"preferredColor": {
"primaryColor": "107c10",
"secondaryColor": "102b14",
"tertiaryColor": "155715"
},
"presenceDetails": [],
"titlePresence": null,
"titleSummaries": null,
"presenceTitleIds": null,
"detail": {
"accountTier": "Gold",
"bio": "",
"isVerified": false,
"location": "",
"tenure": "2",
"watermarks": [
""
],
"blocked": false,
"mute": false,
"followerCount": 13,
"followingCount": 12,
"hasGamePass": false
},
"communityManagerTitles": null,
"socialManager": null,
"broadcast": null,
"tournamentSummary": null,
"avatar": null,
"linkedAccounts": [],
"colorTheme": "gamerpicblur",
"preferredFlag": "",
"preferredPlatforms": []
}
],
"recommendationSummary": null,
"friendFinderState": null,
"accountLinkDetails": null
]API: https://uks.core.gssv-play-prodxhome.xboxlive.com/v2/titles
Method: GET
headers:
{
'Content-Type': 'application/json',
'Authorization': 'Bearer '+ xCloudToken.GS_TOKEN,
}response:
[
eTag: '9EFED184',
totalItems: 421,
results: [
{
"titleId":"AGEOFEMPIRESIIDEFINITIVEEDITION",
"details":{
"productId":"9N2Z748SPMTM",
"xboxTitleId":2064168993,
"hasEntitlement":true,
"supportsInAppPurchases":true,
"supportedTabs":null,
"supportedInputTypes":[
"Controller",
"NativeTouch",
"GenericTouch"
],
"programs":[
"GPULTIMATE"
],
"userPrograms":[
"GPULTIMATE"
],
"userSubscriptions":[
"XGPULTIMATE"
],
"isFreeInStore":false,
"maxGameplayTimeInSeconds":null
}
}
]
]API: https://catalog.gamepass.com/v3/products?market=US&language=en-US&hydration=RemoteHighSapphire0
method: POST
headers:
'Content-Type': 'application/json',
'ms-cv': 0,
'calling-app-name': 'Xbox Cloud Gaming Web',
'calling-app-version': '21.0.0',body:
{
Products: [titleId1, titleId2, ...]
}response:
{
[titleId]: {
ProductTitle: '',
ProductDescription: ''
...
// 内容太多,见独立笔记
}
}url: https://catalog.gamepass.com/sigls/v2?id=f13cf6b4-57e6-4459-89df-6aec18cf0538&market=US&language=en-US
method: GET
公开API ,无需携带token
response:
[
{
"siglId": "f13cf6b4-57e6-4459-89df-6aec18cf0538",
"title": "Recently added",
"description": "With games added all the time, you'll always have something new to play",
"requiresShuffling": "False",
"imageUrl": "http://store-images.s-microsoft.com/image/global.47673.acentoprodimg.40520333-055e-420a-bd6e-39b85591ccd3.65c04579-754f-40be-a1f2-f0e983dba803"
},
{
"id": "9N1L0KL84B56" // productId
},
{
"id": "9P33X3C755SK"
},
]返回的只有游戏的id,需要结合2.4的列表集合来进行显示
API: https://uks.core.gssv-play-prodxhome.xboxlive.com/v2/titles/mru?mr=25
Method: GET
headers:
{
'Content-Type': 'application/json',
'Authorization': 'Bearer '+ xCloudToken.GS_TOKEN,
}response:
{"results":[{"titleId":"ANOTHERCRABSTREASURE","details":{"productId":"9P97ZTRTH25W","xboxTitleId":1682965706,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-06-12T10:09:31.1265541Z"}},{"titleId":"SENUASSAGAHELLBLADEII","details":{"productId":"9PMBB7NGHV95","xboxTitleId":1835926818,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":[{"id":"31f99a9d-6881-452b-9cd9-920f81d2ea4a","tabVersion":"1.0.0.0","layoutVersion":"4.0","manifestVersion":"2.0"}],"supportedInputTypes":["Controller","CustomTouchOverlay"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-06-11T05:00:18.9383006Z"}},{"titleId":"SWORDANDFAIRYTOGETHERFOREVER","details":{"productId":"9P8JHB7V4T5M","xboxTitleId":1931854950,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-06-08T05:11:13.6475698Z"}},{"titleId":"BATTLEFIELD2042XBOXSERIESXS","details":{"productId":"9P0T51BDDWVT","xboxTitleId":2106872096,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-06-06T09:31:00.0125272Z"}},{"titleId":"FORZAHORIZON5","details":{"productId":"9NKX70BBCDRN","xboxTitleId":2030093255,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-05-31T13:05:46.8542512Z"}},{"titleId":"LIESOFP","details":{"productId":"9PCM4CMTPPGC","xboxTitleId":2071061510,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-05-31T12:02:41.6829304Z"}},{"titleId":"GEARS5","details":{"productId":"9P4KMR76PLLQ","xboxTitleId":374923716,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":[{"id":"9543972f-cb37-477c-a46e-97cb0378be3b","tabVersion":"1.0.1.1","layoutVersion":"3.0.0.0","manifestVersion":"2.0.0.0"},{"id":"93ff071b-dd7d-4dc5-b84f-938d1cd1efa4","tabVersion":"1.0.2.0","layoutVersion":"3.0","manifestVersion":"2.0"}],"supportedInputTypes":["Controller","CustomTouchOverlay"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-05-31T12:01:32.7643391Z"}},{"titleId":"STARWARSJEDIFALLENORDER","details":{"productId":"C2CSDTSCBZ0C","xboxTitleId":680942588,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-05-23T15:49:11.8414772Z"}},{"titleId":"ITTAKESTWO","details":{"productId":"9NXVC0482QS5","xboxTitleId":2054716369,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-05-22T09:36:02.802124Z"}},{"titleId":"ORIANDTHEWILLOFTHEWISPS","details":{"productId":"9n8cd0xzklp4","xboxTitleId":1659804324,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-05-21T16:30:57.5503938Z"}},{"titleId":"HALOINFINITE","details":{"productId":"9NP1P1WFS0LB","xboxTitleId":2043073184,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller","MKB"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-05-17T14:03:03.7126612Z"}},{"titleId":"GEARSOFWAR4","details":{"productId":"9nblggh4pbbm","xboxTitleId":552499398,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-05-17T14:00:03.082444Z"}},{"titleId":"ASSASSINSCREEDVALHALLA","details":{"productId":"9P4NJFH17MRT","xboxTitleId":1728105232,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-05-17T11:35:35.6273833Z"}},{"titleId":"APLAGUETALEREQUIEM","details":{"productId":"9ND0JVB184XL","xboxTitleId":2089483628,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-05-06T22:27:11.4929641Z"}},{"titleId":"REMNANTIISTANDARDEDITION","details":{"productId":"9P9278ZMGQLJ","xboxTitleId":1995576035,"hasEntitlement":true,"supportsInAppPurchases":true,"supportedTabs":null,"supportedInputTypes":["Controller"],"programs":["GPULTIMATE"],"userPrograms":[],"userSubscriptions":[],"isFreeInStore":false,"maxGameplayTimeInSeconds":null},"titleHistory":{"lastTimePlayed":"2024-05-01T15:15:28.858937Z"}}]}
greenlight:Ipc:Send Sending event: [xCloud] {"action":"getRecentTitles","id":95,"data":["ANOTHERCRABSTREASURE","SENUASSAGAHELLBLADEII","SWORDANDFAIRYTOGETHERFOREVER","BATTLEFIELD2042XBOXSERIESXS","FORZAHORIZON5","LIESOFP","GEARS5","STARWARSJEDIFALLENORDER","ITTAKESTWO","ORIANDTHEWILLOFTHEWISPS","HALOINFINITE","GEARSOFWAR4","ASSASSINSCREEDVALHALLA","APLAGUETALEREQUIEM","REMNANTIISTANDARDEDITION"]}