diff --git a/skills/xbox-webapi-guide/SKILL.md b/skills/xbox-webapi-guide/SKILL.md new file mode 100644 index 0000000..07a1d53 --- /dev/null +++ b/skills/xbox-webapi-guide/SKILL.md @@ -0,0 +1,35 @@ +--- +name: "xbox-webapi-guide" +description: "Guide for using xbox-webapi in Node/TS. Invoke when integrating or debugging Xbox profile, achievements, presence, media APIs, or handling XSTS auth and pagination." +--- + +# Xbox WebAPI Provider Index + +This skill provides an index of providers. Detailed capabilities and method docs live in the references directory. Before using any provider, make sure you have: +- uhs: Xbox User Hash (from XSTS) +- token: XSTS token (XBL3.0) + +Create client: +- new XboxWebApi({ uhs, token }) + +## Providers + +> - [achievements (Achievements & title history, contract: 2)](references/achievements.md) +> - [catalog (Store catalog search/products, MS-CV: 1.0)](references/catalog.md) +> - [gameclips (Game clips, contract: 3)](references/gameclips.md) +> - [screenshots (Screenshots, contract: 3)](references/screenshots.md) +> - [gamepass (Game Pass products/lists)](references/gamepass.md) +> - [messages (Messaging)](references/messages.md) +> - [people (Friends/recent players)](references/people.md) +> - [pins (User lists: PINS/Saved for later)](references/pins.md) +> - [profile (User profile, contract: 3)](references/profile.md) +> - [social (Social summary/relationships)](references/social.md) +> - [titlehub (Title history & details)](references/titlehub.md) +> - [userpresence (Presence, contract: 3)](references/userpresence.md) +> - [usersearch (User search, contract: 1)](references/usersearch.md) +> - [userstats (User stats, contract: 2)](references/userstats.md) +> - [smartglass (Console remote control/status, contract: 4)](references/smartglass.md) +> - [xnotify (Xbox Live service status)](references/xnotify.md) +> - [rest (Generic GET proxy)](references/rest.md) + +See the corresponding docs under references for detailed endpoints, headers, contracts, and method signatures. diff --git a/skills/xbox-webapi-guide/references/achievements.md b/skills/xbox-webapi-guide/references/achievements.md new file mode 100644 index 0000000..d1e8910 --- /dev/null +++ b/skills/xbox-webapi-guide/references/achievements.md @@ -0,0 +1,86 @@ +# achievements + +- Endpoint: achievements.xboxlive.com +- Contract: x-xbl-contract-version = 2 +- Description: Query user achievements, title history, and achievement item details. Supports pagination. + +## Methods +- getAchievements(xuid, continuationToken?, maxItems?, skipItems?) + - GET /users/xuid({xuid})/history/titles +- getTitleId(xuid, titleId, continuationToken?, maxItems?, skipItems?) + - GET /users/xuid({xuid})/achievements?titleid={titleId} +- getItemDetail(xuid, serviceConfigId, achievementId, continuationToken?, maxItems?, skipItems?) + - GET /users/xuid({xuid})/achievements/{serviceConfigId}/{achievementId} + +## Parameters +- xuid: string — Target user XUID +- titleId: string — Xbox title ID (for per-title queries) +- serviceConfigId: string — SCID for a title/service +- achievementId: string — Achievement identifier within SCID +- continuationToken?: string — Token to continue pagination +- maxItems?: number — Page size +- skipItems?: number — Offset for pagination + +## 返回值 +- 返回类型:HttpResponse +- 分页:当支持分页时,响应头包含 x-continuation-token;可调用 response.next() 拉取下一页 +- 常见形态: + - /history/titles 返回包含 titles 数组的对象 + - /achievements?... 返回包含 achievements 数组的对象 + +示例(标题历史 /history/titles): + +```json +{ + "titles": [ + { + "titleId": 1292135258, + "name": "Halo Infinite", + "displayImage": "https://images-eds.xboxlive.com/image.png", + "platforms": ["XboxOne", "Scarlett"] + } + ] +} +``` + +示例(按 titleId 查询成就 /achievements): + +```json +{ + "achievements": [ + { + "id": "1", + "name": "First Steps", + "description": "Complete the tutorial", + "progressState": "Achieved", + "progression": { + "timeUnlocked": "2023-10-01T12:34:56Z" + }, + "mediaAssets": [], + "rewards": [] + } + ] +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function listAchievements(uhs: string, xsts: string, xuid: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const page = await api.providers.achievements.getAchievements(xuid, undefined, 20) + console.log(page.data) + + try { + const next = await page.next() + console.log(next.data) + } catch { + // no more pages + } +} +``` + +## Notes +- Returns HttpResponse +- Use response.next() to fetch the next page when continuationToken is present diff --git a/skills/xbox-webapi-guide/references/catalog.md b/skills/xbox-webapi-guide/references/catalog.md new file mode 100644 index 0000000..d1dde36 --- /dev/null +++ b/skills/xbox-webapi-guide/references/catalog.md @@ -0,0 +1,84 @@ +# catalog + +- Endpoint: displaycatalog.mp.microsoft.com +- Headers: MS-CV = 1.0 +- Description: Store catalog search and product info, supports market/language parameters. + +## Methods +- searchTitle(query, market='us', language='en-us', continuationToken?, maxItems?, skipItems?) + - GET /v7.0/productFamilies/autosuggest?… +- getProductId(query, market='us', language='en-us', continuationToken?, maxItems?, skipItems?) + - GET /v7.0/productFamilies/autosuggest?… +- getProductFromAlternateId(titleId, titleType, market='us', language='en-us', continuationToken?, maxItems?, skipItems?) + - GET /v7.0/productFamilies/autosuggest?… + +## Parameters +- query: string — Search keyword or product bigId +- titleId: string — Alternate identifier value +- titleType: string — Alternate identifier type +- market?: string — Region (default 'us') +- language?: string — Locale (default 'en-us') +- continuationToken?: string — Continue pagination +- maxItems?: number — Page size +- skipItems?: number — Offset + +## 返回值 +- 返回类型:HttpResponse +- 常见字段: + - Products:产品列表,包含 ProductId、LocalizedProperties、Images、DisplaySkuAvailabilities 等 + - Items:在 autosuggest 场景下为建议项数组,包含 Title/ProductId/ImageUrl 等 +- 分页:多数 autosuggest 接口一次性返回;若提供 max/skip,将以分页形式返回相应范围 + +示例(autosuggest 简化): + +```json +{ + "Items": [ + { + "Title": "Forza Horizon 5", + "ProductId": "9NKX70BBCDRN", + "ImageUrl": "https://store-images.microsoft.com/boxart.png" + } + ] +} +``` + +示例(产品信息简化): + +```json +{ + "Products": [ + { + "ProductId": "9NKX70BBCDRN", + "LocalizedProperties": [ + { "ProductTitle": "Forza Horizon 5" } + ], + "Images": [ + { "Uri": "https://store-images.microsoft.com/boxart.png", "ImagePurpose": "BoxArt" } + ], + "DisplaySkuAvailabilities": [ + { + "Sku": { "SkuId": "0000" }, + "Availabilities": [ + { "Actions": ["Purchase"], "Market": "US" } + ] + } + ] + } + ] +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function searchCatalog(uhs: string, xsts: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const res = await api.providers.catalog.searchTitle('Forza', 'us', 'en-us', undefined, 25) + console.log(res.data) +} +``` + +## Notes +- Calls resetDefaultHeaders() to remove default auth headers; this domain typically does not require XBL3 contract headers. diff --git a/skills/xbox-webapi-guide/references/gameclips.md b/skills/xbox-webapi-guide/references/gameclips.md new file mode 100644 index 0000000..02802de --- /dev/null +++ b/skills/xbox-webapi-guide/references/gameclips.md @@ -0,0 +1,62 @@ +# gameclips + +- Endpoint: mediahub.xboxlive.com +- Contract: x-xbl-contract-version = 3 +- Description: Query user game clips. Supports pagination. + +## Methods +- getGameclips(xuid, continuationToken?, maxItems?, skipItems?) +- - POST /gameclips/search (Body: { query: "OwnerXuid eq {xuid}", max?, skip? }) + +## Parameters +- xuid: string — Owner XUID +- continuationToken?: string — Continue pagination +- maxItems?: number — Page size (also used in body as max) +- skipItems?: number — Offset (also used in body as skip) + +## 返回值 +- 返回类型:HttpResponse +- 常见字段: + - gameClips:数组,每项代表一个录制片段 + - gameClips[].gameClipId:唯一标识 + - gameClips[].titleId / xuid / state / datePublished + - gameClips[].thumbnails[]:缩略图 uri 列表 + - gameClips[].gameClipUris[]:视频文件 uri 列表(含 fileType) +- 分页:响应头可包含 x-continuation-token;可通过 response.next() 获取下一页 + +示例: + +```json +{ + "gameClips": [ + { + "gameClipId": "3d6f9a0a-0000-0000-0000-000000000000", + "titleId": 1292135258, + "xuid": "2533274981234567", + "state": "Published", + "datePublished": "2023-10-01T12:34:56Z", + "thumbnails": [ + { "uri": "https://clips.xboxlive.com/thumb.jpg" } + ], + "gameClipUris": [ + { "uri": "https://clips.xboxlive.com/clip.mp4", "fileType": "mp4" } + ] + } + ] +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function listClips(uhs: string, xsts: string, xuid: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const clips = await api.providers.gameclips.getGameclips(xuid, undefined, 20) + console.log(clips.data) +} +``` + +## Notes +- Returns HttpResponse +- response.next() fetches the next page diff --git a/skills/xbox-webapi-guide/references/gamepass.md b/skills/xbox-webapi-guide/references/gamepass.md new file mode 100644 index 0000000..4c78b1a --- /dev/null +++ b/skills/xbox-webapi-guide/references/gamepass.md @@ -0,0 +1,76 @@ +# gamepass + +- Endpoint: catalog.gamepass.com +- Headers: MS-CV = 1.0, calling-app-name/version preset +- Description: Query Game Pass SIGL and product information. + +## Methods +- getSigl(siglId, market='us', language='en-us') + - GET /sigls/v2?id={siglId}&market={market}&language={language} +- getProducts(products: string[], market='us', language='en-us') +- - POST /v3/products?market={market}&language={language} (Body: { Products: [...] }) +- getProductsDetailed(products: string[]) +- - POST /v3/products (hydration = RemoteHighSapphire0; ≤ 20 products per request) + +## Parameters +- siglId: string — SIGL identifier +- products: string[] — Product IDs to hydrate +- market?: string — Region (default 'us') +- language?: string — Locale (default 'en-us') + +## 返回值 +- 返回类型:HttpResponse +- 常见形态: + - SIGL(/sigls/...):包含产品集合或清单的对象(如包含产品 ID 列表、分组/分区信息) + - Products(/v3/products):返回 Products 数组,含基本信息与可用性(Availabilities) +- 注:getProductsDetailed 会返回更完整的 hydration 字段(如 Offers、Media、Tags 等) + +示例(SIGL 简化): + +```json +{ + "Sigl": { + "Id": "f4c9b1e7-0000-0000-0000-000000000000", + "Market": "US", + "Language": "en-us", + "IncludedProductIds": ["9NKX70BBCDRN", "9P8CP1Q7PS4N"] + } +} +``` + +示例(Products 简化): + +```json +{ + "Products": [ + { + "ProductId": "9NKX70BBCDRN", + "LocalizedProperties": [ + { "ProductTitle": "Forza Horizon 5" } + ], + "DisplaySkuAvailabilities": [ + { + "Sku": { "SkuId": "0000" }, + "Availabilities": [ + { "Actions": ["Purchase"], "Market": "US" } + ] + } + ] + } + ] +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function getSigl(uhs: string, xsts: string, siglId: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const res = await api.providers.gamepass.getSigl(siglId, 'us', 'en-us') + console.log(res.data) +} +``` + +## Notes +- Returns HttpResponse diff --git a/skills/xbox-webapi-guide/references/messages.md b/skills/xbox-webapi-guide/references/messages.md new file mode 100644 index 0000000..31c22de --- /dev/null +++ b/skills/xbox-webapi-guide/references/messages.md @@ -0,0 +1,73 @@ +# messages + +- Endpoint: xblmessaging.xboxlive.com +- Description: Message inbox and conversations. + +## Methods +- getInbox() + - GET /network/Xbox/users/me/inbox +- getConversation(xuid, continuationToken?, maxItems?, skipItems?) + - GET /network/Xbox/users/me/conversations/users/xuid({xuid}) + +## Parameters +- xuid: string — Target user XUID +- continuationToken?: string — Continue pagination +- maxItems?: number — Page size +- skipItems?: number — Offset + +## 返回值 +- 返回类型:HttpResponse +- 形态: + - Inbox:包含会话摘要数组(会话 ID、参与者、最后一条消息、未读计数等) + - Conversation:包含消息数组(消息 ID、发送者 XUID、时间戳、内容等) +- 分页:会话消息支持分页,响应头可含 x-continuation-token;可调用 response.next() + +示例(Inbox 简化): + +```json +{ + "conversations": [ + { + "conversationId": "c-0000000000000001", + "participants": ["2533274981234567", "2533274987654321"], + "lastMessage": { + "messageId": "m-0001", + "senderXuid": "2533274987654321", + "sentDateTimeUtc": "2023-10-01T12:00:00Z", + "content": "Hi!" + }, + "unreadCount": 1 + } + ] +} +``` + +示例(Conversation 简化): + +```json +{ + "messages": [ + { + "messageId": "m-0001", + "senderXuid": "2533274987654321", + "sentDateTimeUtc": "2023-10-01T12:00:00Z", + "content": "Hi!" + } + ] +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function getInbox(uhs: string, xsts: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const res = await api.providers.messages.getInbox() + console.log(res.data) +} +``` + +## Notes +- Returns HttpResponse +- Conversation lists support pagination diff --git a/skills/xbox-webapi-guide/references/people.md b/skills/xbox-webapi-guide/references/people.md new file mode 100644 index 0000000..59c6b63 --- /dev/null +++ b/skills/xbox-webapi-guide/references/people.md @@ -0,0 +1,61 @@ +# people + +- Endpoint: peoplehub.xboxlive.com +- Description: Friends list and recently played with players. + +## Methods +- getFriends() + - GET /users/me/people/social/decoration/{preferredcolor,detail,multiplayersummary,presencedetail} +- recentPlayers(continuationToken?, maxItems?, skipItems?) + - GET /users/me/people/recentplayers + +## Parameters +- continuationToken?: string — Continue pagination +- maxItems?: number — Page size +- skipItems?: number — Offset + +## 返回值 +- 返回类型:HttpResponse +- 形态: + - getFriends:返回 people 列表,包含基础信息、偏好颜色、在线状态与多人游戏摘要等 + - recentPlayers:返回近期一起游玩的 people 列表,支持分页 +- 常见字段: + - people[].xuid / gamertag / displayName + - people[].preferredColor.primaryColor + - people[].presenceDetails[].state(Online/Offline),lastSeen 等 + - people[].multiplayerSummary(inMultiplayer/inParty 等) +- 分页:recentPlayers 响应头可含 x-continuation-token;可通过 response.next() 获取下一页 + +示例(简化): + +```json +{ + "people": [ + { + "xuid": "2533274981234567", + "gamertag": "PlayerOne", + "displayName": "Player One", + "preferredColor": { "primaryColor": "#107C10" }, + "presenceDetails": [ + { "state": "Online", "lastSeen": "2023-10-01T12:00:00Z" } + ], + "multiplayerSummary": { "inMultiplayer": false, "inParty": false } + } + ] +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function listFriends(uhs: string, xsts: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const res = await api.providers.people.getFriends() + console.log(res.data) +} +``` + +## Notes +- Returns HttpResponse +- recentPlayers supports pagination diff --git a/skills/xbox-webapi-guide/references/pins.md b/skills/xbox-webapi-guide/references/pins.md new file mode 100644 index 0000000..c7bd3af --- /dev/null +++ b/skills/xbox-webapi-guide/references/pins.md @@ -0,0 +1,59 @@ +# pins + +- Endpoint: eplists.xboxlive.com +- Description: User PINS lists (including default XBLPins and SaveForLater). + +## Methods +- getPins(xuid, listname='XBLPins') + - GET /users/xuid({xuid})/lists/PINS/{listname} +- getSavedForLater(xuid) + - Alias of getPins(xuid, 'SaveForLater') + +## Parameters +- xuid: string — Target user XUID +- listname?: string — List name (default 'XBLPins') + +## 返回值 +- 返回类型:HttpResponse +- 形态:顶层包含 Items 数组;每个 Item 含 Id、ItemType、ItemState 与 Properties +- 常见字段: + - Items[].Properties.TitleId / ContentId / ContentType / Name + - Items[].Properties.Images[](Uri/Purpose) +- 列表示例:XBLPins(默认)、SaveForLater + +示例(简化): + +```json +{ + "Items": [ + { + "Id": "pin-0001", + "ItemType": "Game", + "ItemState": "Active", + "Properties": { + "TitleId": 1292135258, + "ContentId": "9NKX70BBCDRN", + "ContentType": "Product", + "Name": "Halo Infinite", + "Images": [ + { "Uri": "https://images-eds.xboxlive.com/boxart.png", "Purpose": "BoxArt" } + ] + } + } + ] +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function listPins(uhs: string, xsts: string, xuid: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const res = await api.providers.pins.getPins(xuid) + console.log(res.data) +} +``` + +## Notes +- Returns HttpResponse diff --git a/skills/xbox-webapi-guide/references/profile.md b/skills/xbox-webapi-guide/references/profile.md new file mode 100644 index 0000000..14b6c90 --- /dev/null +++ b/skills/xbox-webapi-guide/references/profile.md @@ -0,0 +1,54 @@ +# profile + +- Endpoint: profile.xboxlive.com +- Contract: x-xbl-contract-version = 3 +- Description: User basic profile including display name, gamerpic, Gamerscore, and Gamertag. + +## Methods +- getCurrentUser() + - GET /users/me/profile/settings?settings=GameDisplayName,GameDisplayPicRaw,Gamerscore,Gamertag +- getUserProfile(xuid) + - GET /users/xuid({xuid})/profile/settings?settings=GameDisplayName,GameDisplayPicRaw,Gamerscore,Gamertag +- getByGamertag(gamertag) + - GET /users/gt({gamertag})/profile/settings?settings=GameDisplayName,GameDisplayPicRaw,Gamerscore,Gamertag + +## Parameters +- xuid: string — Target user XUID +- gamertag: string — Target user Gamertag + +## 返回值 +- 返回类型:HttpResponse +- 形态:顶层包含 profileUsers 数组;每个用户含 id 与 settings +- settings.id 对应请求的设置名,value 为字符串值 + +示例: + +```json +{ + "profileUsers": [ + { + "id": "2533274981234567", + "settings": [ + { "id": "GameDisplayName", "value": "Player One" }, + { "id": "GameDisplayPicRaw", "value": "https://images-eds.xboxlive.com/image.png" }, + { "id": "Gamerscore", "value": "12345" }, + { "id": "Gamertag", "value": "PlayerOne" } + ] + } + ] +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function getMe(uhs: string, xsts: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const res = await api.providers.profile.getCurrentUser() + console.log(res.data) +} +``` + +## Notes +- Returns HttpResponse diff --git a/skills/xbox-webapi-guide/references/rest.md b/skills/xbox-webapi-guide/references/rest.md new file mode 100644 index 0000000..88340cb --- /dev/null +++ b/skills/xbox-webapi-guide/references/rest.md @@ -0,0 +1,24 @@ +# rest + +- Endpoint: dynamic (parsed from the provided URL) +- Description: Generic GET proxy; optionally specify x-xbl-contract-version and pagination params. + +## Methods +- getRequest(url, xblContractVersion?, continuationToken?, maxItems?, skipItems?) + - Parses URL to set host/path; writes xblContractVersion to header if provided + +## Notes +- 返回类型:HttpResponse +- 分页:若目标端点支持分页,将在响应头返回 x-continuation-token;可通过 response.next() 继续获取 +- 通用字段:不同服务返回的 JSON 结构不同,请参考各对应 provider 文档 +- 建议:调试时配合 x-xbl-contract-version 与 maxItems/skipItems 参数便于观察结构 + +示例(调用任意受支持端点): + +```ts +const res = await api.providers.rest.getRequest( + 'https://titlehub.xboxlive.com/users/xuid(2533274981234567)/titles/titlehistory/decoration/achievement,image' +) +console.log(res.data) // JSON 对象 +console.log(res.headers['x-continuation-token']) // 分页令牌(如存在) +``` diff --git a/skills/xbox-webapi-guide/references/screenshots.md b/skills/xbox-webapi-guide/references/screenshots.md new file mode 100644 index 0000000..73759bb --- /dev/null +++ b/skills/xbox-webapi-guide/references/screenshots.md @@ -0,0 +1,62 @@ +# screenshots + +- Endpoint: mediahub.xboxlive.com +- Contract: x-xbl-contract-version = 3 +- Description: Query user screenshots. Supports pagination. + +## Methods +- getScreenshots(xuid, continuationToken?, maxItems?, skipItems?) +- - POST /screenshots/search (Body: { query: "OwnerXuid eq {xuid}", max?, skip? }) + +## Parameters +- xuid: string — Owner XUID +- continuationToken?: string — Continue pagination +- maxItems?: number — Page size (also used in body as max) +- skipItems?: number — Offset (also used in body as skip) + +## 返回值 +- 返回类型:HttpResponse +- 常见字段: + - screenshots:数组,每项代表一个截图 + - screenshots[].screenshotId:唯一标识 + - screenshots[].titleId / xuid / state / datePublished + - screenshots[].thumbnails[]:缩略图 uri 列表 + - screenshots[].screenshotUris[]:图片文件 uri 列表(含 fileType) +- 分页:响应头可包含 x-continuation-token;可通过 response.next() 获取下一页 + +示例: + +```json +{ + "screenshots": [ + { + "screenshotId": "7f4d2b1c-0000-0000-0000-000000000000", + "titleId": 1292135258, + "xuid": "2533274981234567", + "state": "Published", + "datePublished": "2023-09-30T11:22:33Z", + "thumbnails": [ + { "uri": "https://shots.xboxlive.com/thumb.jpg" } + ], + "screenshotUris": [ + { "uri": "https://shots.xboxlive.com/shot.jpg", "fileType": "jpg" } + ] + } + ] +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function listScreenshots(uhs: string, xsts: string, xuid: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const shots = await api.providers.screenshots.getScreenshots(xuid, undefined, 20) + console.log(shots.data) +} +``` + +## Notes +- Returns HttpResponse +- response.next() fetches the next page diff --git a/skills/xbox-webapi-guide/references/smartglass.md b/skills/xbox-webapi-guide/references/smartglass.md new file mode 100644 index 0000000..6ed918a --- /dev/null +++ b/skills/xbox-webapi-guide/references/smartglass.md @@ -0,0 +1,77 @@ +# smartglass + +- Endpoint: xccs.xboxlive.com +- Headers: x-xbl-contract-version = 4, skillplatform = RemoteManagement +- Description: Control console, query status, apps and storage devices. + +## Methods +- getConsolesList() + - GET /lists/devices?queryCurrentDevice=false&includeStorageDevices=true +- getInstalledApps(consoleId) + - GET /lists/installedApps?deviceId={consoleId} +- getStorageDevices(consoleId) + - GET /lists/storageDevices?deviceId={consoleId} +- getConsoleStatus(consoleId) + - GET /consoles/{consoleId} +- powerOn(consoleId?) + - POST /commands (Power: WakeUp) +- powerOff(consoleId?) + - POST /commands (Power: TurnOff) +- launchOneGuide(consoleId) + - POST /commands (TV: ShowGuide) + +## Parameters +- consoleId?: string — Target console ID (optional for power commands; uses default if configured) + +## 返回值 +- 返回类型:HttpResponse | ConsoleStatus | any> +- 形态: + - getConsolesList:返回 devices 数组(设备 ID、名称、电源状态、存储设备等) + - getConsoleStatus:返回单个主机状态(电源、网络、活动标题等) + - commands(powerOn/powerOff/launchOneGuide):返回命令受理/执行状态 +- 常见字段: + - devices[].deviceId / name / powerState + - devices[].storageDevices[](id/name/totalBytes/freeBytes) + - consoleStatus.powerState / activeTitles[] / inputSource + +示例(设备列表简化): + +```json +{ + "devices": [ + { + "deviceId": "Console:1234567890", + "name": "Living Room Xbox", + "powerState": "Connected", + "storageDevices": [ + { "id": "HDD", "name": "Internal", "totalBytes": 1000000000, "freeBytes": 500000000 } + ] + } + ] +} +``` + +示例(状态简化): + +```json +{ + "powerState": "On", + "activeTitles": [ + { "titleId": 1292135258, "name": "Halo Infinite" } + ], + "inputSource": "HDMI" +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function powerOn(uhs: string, xsts: string, consoleId: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + await api.providers.smartglass.powerOn(consoleId) +} +``` + +## Notes +- Returns HttpResponse | ConsoleStatus | any> diff --git a/skills/xbox-webapi-guide/references/social.md b/skills/xbox-webapi-guide/references/social.md new file mode 100644 index 0000000..c0a05df --- /dev/null +++ b/skills/xbox-webapi-guide/references/social.md @@ -0,0 +1,55 @@ +# social + +- Endpoint: social.xboxlive.com +- Description: Social summary (following/followers/relationship overview). + +## Methods +- getSummary() + - GET /users/me/summary +- getSummaryByXuid(xuid) + - GET /users/xuid({xuid})/summary +- getSummaryByGamertag(gamertag) + - GET /users/gt({gamertag})/summary + +## Parameters +- xuid: string — Target user XUID +- gamertag: string — Target user Gamertag + +## 返回值 +- 返回类型:HttpResponse +- 形态:顶层包含的汇总对象,含 following/followers 计数、最近互动、关系状态等 +- 常见字段: + - peopleCount.followers / following + - recentActivity / recommendationCount + - relationship:是否互相关注、是否被屏蔽等 + +示例(简化): + +```json +{ + "peopleCount": { + "followers": 120, + "following": 80 + }, + "relationship": { + "isFollowedByCaller": true, + "isFollowingCaller": false, + "isFavoriteByCaller": false + }, + "recommendationCount": 5 +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function getSocialSummary(uhs: string, xsts: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const res = await api.providers.social.getSummary() + console.log(res.data) +} +``` + +## Notes +- Returns HttpResponse diff --git a/skills/xbox-webapi-guide/references/titlehub.md b/skills/xbox-webapi-guide/references/titlehub.md new file mode 100644 index 0000000..bb9296c --- /dev/null +++ b/skills/xbox-webapi-guide/references/titlehub.md @@ -0,0 +1,68 @@ +# titlehub + +- Endpoint: titlehub.xboxlive.com +- Description: User title history and specific title details (with decoration fields). + +## Methods +- getTitleHistory(xuid) + - GET /users/xuid({xuid})/titles/titlehistory/decoration/{achievement,image,scid} +- getTitleId(xuid, titleId) + - GET /users/xuid({xuid})/titles/titleid({titleId})/decoration/{achievement,image,detail,scid,alternateTitleId} + +## Parameters +- xuid: string — Target user XUID +- titleId: string — Xbox title ID + +## 返回值 +- 返回类型:HttpResponse +- 形态:顶层包含 titles 数组;根据 decoration 携带成就、图片、细节等子字段 +- 常见字段: + - titleId:数值型 Title ID + - name:标题名称 + - type:Title 类型(Game/App 等) + - devices:支持设备 + - images:图片数组(type/url/width/height) + - achievement:当前/总成就与分数统计 + +示例(历史列表,含装饰字段): + +```json +{ + "titles": [ + { + "titleId": 1292135258, + "name": "Halo Infinite", + "type": "Game", + "devices": ["XboxOne"], + "images": [ + { + "type": "BoxArt", + "url": "https://images-eds.xboxlive.com/image.png", + "width": 1080, + "height": 1080 + } + ], + "achievement": { + "currentAchievements": 10, + "totalAchievements": 119, + "currentGamerscore": 200, + "totalGamerscore": 1600 + } + } + ] +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function history(uhs: string, xsts: string, xuid: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const res = await api.providers.titlehub.getTitleHistory(xuid) + console.log(res.data) +} +``` + +## Notes +- Returns HttpResponse diff --git a/skills/xbox-webapi-guide/references/userpresence.md b/skills/xbox-webapi-guide/references/userpresence.md new file mode 100644 index 0000000..8212b1f --- /dev/null +++ b/skills/xbox-webapi-guide/references/userpresence.md @@ -0,0 +1,78 @@ +# userpresence + +- Endpoint: userpresence.xboxlive.com +- Contract: x-xbl-contract-version = 3 +- Description: Presence for self, friends, or a specific user. + +## Methods +- getCurrentUser() + - GET /users/me?level=all +- getFriends() + - GET /users/me/groups/People?level=all +- getUser(xuid) + - GET /users/xuid({xuid})?level=all + +## Parameters +- xuid: string — Target user XUID + +## 返回值 +- 返回类型:HttpResponse +- 形态: + - getCurrentUser/getUser:返回单个用户的在线状态对象 + - getFriends:返回包含多个用户状态的数组 +- 常见字段: + - xuid:用户 XUID + - state:Online/Offline/Away + - devices:设备列表,含 type、titles 等 + - devices[].titles[].activity.richPresence:富状态文本 + +示例(单用户): + +```json +{ + "xuid": "2533274981234567", + "state": "Online", + "devices": [ + { + "type": "XboxOne", + "titles": [ + { + "id": 1292135258, + "name": "Halo Infinite", + "placement": "Full", + "state": "Active", + "activity": { + "richPresence": "In Menus" + } + } + ] + } + ] +} +``` + +示例(好友分组): + +```json +[ + { + "xuid": "2533274987654321", + "state": "Offline", + "devices": [] + } +] +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function friendsPresence(uhs: string, xsts: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const res = await api.providers.userpresence.getFriends() + console.log(res.data) +} +``` + +## Notes +- Returns HttpResponse diff --git a/skills/xbox-webapi-guide/references/usersearch.md b/skills/xbox-webapi-guide/references/usersearch.md new file mode 100644 index 0000000..3cc064f --- /dev/null +++ b/skills/xbox-webapi-guide/references/usersearch.md @@ -0,0 +1,49 @@ +# usersearch + +- Endpoint: usersearch.xboxlive.com +- Contract: x-xbl-contract-version = 1 +- Description: Suggest-based search for Xbox users by keyword. + +## Methods +- searchUsers(query) + - GET /suggest?q={query} + +## Parameters +- query: string — Search keyword + +## 返回值 +- 返回类型:HttpResponse +- 形态:返回建议用户列表 +- 常见字段: + - results[].xuid / gamertag / modernGamertag + - results[].displayPic / gamerscore + +示例(简化): + +```json +{ + "results": [ + { + "xuid": "2533274981234567", + "gamertag": "PlayerOne", + "modernGamertag": "PlayerOne", + "displayPic": "https://images-eds.xboxlive.com/gamerpic.png", + "gamerscore": 12345 + } + ] +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function suggest(uhs: string, xsts: string, keyword: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const res = await api.providers.usersearch.searchUsers(keyword) + console.log(res.data) +} +``` + +## Notes +- Returns HttpResponse diff --git a/skills/xbox-webapi-guide/references/userstats.md b/skills/xbox-webapi-guide/references/userstats.md new file mode 100644 index 0000000..9609599 --- /dev/null +++ b/skills/xbox-webapi-guide/references/userstats.md @@ -0,0 +1,46 @@ +# userstats + +- Endpoint: userstats.xboxlive.com +- Contract: x-xbl-contract-version = 2 +- Description: Query user statistics for a given title (example includes MinutesPlayed). + +## Methods +- getUserTitleStats(xuid, titleId) +- - POST /batch (Body example includes groups: Hero, stats: MinutesPlayed) + +## Parameters +- xuid: string — Target user XUID +- titleId: string — Xbox title ID + +## 返回值 +- 返回类型:HttpResponse +- 形态:统计结果按用户/标题分组,包含 stat 名称与值 +- 常见字段: + - xuid / scid(或 titleId)/ stats[] + - stats[].name / value / type(Number/String/Duration 等) + +示例(简化): + +```json +{ + "xuid": "2533274981234567", + "titleId": "1292135258", + "stats": [ + { "name": "MinutesPlayed", "value": 1234, "type": "Number" } + ] +} +``` + +## Example +```ts +import XboxWebApi from 'xbox-webapi' + +async function minutesPlayed(uhs: string, xsts: string, xuid: string, titleId: string) { + const api = new XboxWebApi({ uhs, token: xsts }) + const res = await api.providers.userstats.getUserTitleStats(xuid, titleId) + console.log(res.data) +} +``` + +## Notes +- Returns HttpResponse diff --git a/skills/xbox-webapi-guide/references/xnotify.md b/skills/xbox-webapi-guide/references/xnotify.md new file mode 100644 index 0000000..e43a409 --- /dev/null +++ b/skills/xbox-webapi-guide/references/xnotify.md @@ -0,0 +1,34 @@ +# xnotify + +- Endpoint: xnotify.xboxlive.com +- Description: Xbox Live service status. + +## Methods +- getLiveStatus() + - GET /servicestatusv6/GB/en-GB + +## 返回值 +- 返回类型:HttpResponse +- 形态:服务状态列表,含服务名、当前状态、影响范围与消息 +- 常见字段: + - services[].id / name / status(Up/Down/Degraded) + - services[].message / impactedPlatforms[] + +示例(简化): + +```json +{ + "services": [ + { + "id": "xbox-live-core-services", + "name": "Xbox Live Core Services", + "status": "Up", + "message": "All services are running normally", + "impactedPlatforms": ["XboxOne", "Windows10"] + } + ] +} +``` + +## Notes +- Returns HttpResponse