app-xbox-live
app-xbox-live copied to clipboard
Powerful xbox live library for javascript
App Xbox Live Api
Install
npm i app-xbox-live
Getting started
- getting account token: First, have your account token, if you don't have a token, try it to get your token:
const axl = require("app-xbox-live");
const token = await axl.Token("<your email>", "<your password>");
//output: ["token", "uhs"]
Note: For 2-step accounts, authorization from the owner is required.
Security: never display your token to anyone.
authentication alternatives
- setup token:
const xl = new axl.Account(`XBL3.0 x=${token};${uhs});
- logging with credentials:
const xl = await axl.Login("<email>", "<password>");
Avaiable methods
Attention: the token, email and password must be kept secret, do not share or display it to anyone. The token is reset every 24 hours. Then you will need to obtain another token again after 24 hours. Microsoft does not allow to generate multiple tokens. Just generate 1 token and use it for 24 hours.Logging in with your token
const xl = new axl.Account(`XBL3.0 x=${token[1]};${token[0]}`);
Or if you want to login directly, see below:
Login directly
const xl = await axl.Login("<email>", "<password>");
this done, if there is no error, you can now manipulate data.
Manipulating data
Request
Make a custom request
const opts = {
url: "<request url>",
method: "<method>",
...
}
xl.request(opts).then(data =>{
console.log(data);
});
It is not necessary to add the authorization header because the method automatically adds it.
People
Finding user by gamertag
const amount = 15;
xl.people.find("<gamertag>", amount).then(console.log);
Getting user by xuid
xl.people.get("<xuid>").then(console.log);
Getting user profile
xl.people.profile.get("<xuid>").then(console.log);
// OR
xl.people.profile.get(["<xuids>"]).then(console.log);
Getting recommendation users
xl.people.recommendation.get().then(console.log);
Getting user setting
xl.people.setting.get("<xuid>").then(console.log);
Getting user summary
xl.people.summary.get("<xuid>").then(console.log);
Getting all the user achievement
xl.people.achievement.all.get("<xuid>").then(console.log);
Getting specific user achievement
xl.people.achievement.get("<xuid>", titleId, amount).then(console.log);
Getting user achievement stats
xl.people.achievement.stats.get("<xuid>", titleId).then(console.log);
// OR
xl.people.achievement.stats.get(["<xuids>"], titleId).then(console.log);
Getting user achievement titles
xl.people.achievement.titles.get("<xuid>").then(console.log);
Getting complete user achievement titles
xl.people.achievement.titles.complete.get("<xuid>").then(console.log);
Getting user achievement titles
xl.people.achievement.titles.get("<xuid>").then(user =>{
console.log(user);
});
Getting user activity
const amount = 100;
xl.people.activity.get("<xuid>", amount).then(console.log);
Getting user screenshot
const amount = 100;
xl.people.screenshot.get("<xuid>", amount).then(console.log);
Getting user games
xl.people.games.get("<xuid>").then(console.log);
Getting user presence
xl.people.presence.get("<xuid>").then(console.log);
// OR
xl.people.presence.get(["<xuids>"]).then(console.log);
Adding friend
xl.people.add("<xuid>").then(() =>{
console.log("success");
});
// OR
xl.people.add(["<xuids>"]).then(() =>{
console.log("success");
});
Removing friend
xl.people.remove("<xuid>").then(() =>{
console.log("success");
});
// OR
xl.people.remove(["<xuids>"]).then(() =>{
console.log("success");
});
Getting user gameclip
xl.people.gameclip.get("<xuid>", amount).then(console.log);
Getting user clubs
xl.people.clubs.get("<xuid>").then(console.log);
Getting user friends
xl.people.friends.get("<xuid>").then(console.log);
Getting gameclip
xl.people.gameclip.get("<xuid>", amount).then(console.log);
Club
Finding club by name
xl.club.find("<club name>").then(console.log);
Getting club by id
xl.club.get("<club id>").then(console.log);
Getting club feed
const amount = 50;
xl.club.feed.get("<club id>", amount).then(console.log);
Sending club feed
xl.club.feed.send("<club id>", "<message>").then(console.log);
Getting club chat
const amount = 50;
xl.club.chat.get("<club id>", amount).then(console.log);
Chat
Getting inbox
xl.chat.inbox.get().then(console.log);
Getting chat auth
xl.chat.auth.get("<xuid>").then(console.log);
Getting message
const amount = 100;
xl.chat.message.get("<xuid>", amount).then(console.log);
Sending message
xl.chat.message.send("<xuid>", "<message>").then(console.log);
title
Getting title by id
xl.title.get("<id>").then(console.log);
// OR
xl.title.get(["<ids>"]).then(console.log);
Me
Getting account privacy settings
xl.me.account.privacy.settings.get().then(console.log);
Getting profile
xl.me.profile.get().then(console.log);
Getting friends
xl.me.profile.friends.get().then(console.log);
Getting followers
xl.me.followers.get().then(console.log);
Getting family
xl.me.profile.family.get("<xuid>").then(console.log);
Getting groups
xl.me.groups.get().then(console.log);
Getting reports
xl.me.reports.get().then(console.log);
Getting games titles id
xl.me.games.titlesId.get().then(console.log);