An npm package coded in javascript for The XYZ Network API which will wrap and allow you to use all of The XYZ Network API endpoints and easily get information from the specified endpoint!
npm install xyz-api-wrapper
const xyz = require("xyz-api-wrapper");
This function will set the authorization key for all the requests below this piece of code.
xyz.setAuthorization("XYZ API Key");
This function will set the server for all the requests below this piece of code.
xyz.setServer("Server ID");
This function will request all the XYZ Network API endpoints and get all the specified user information.
xyz.getUserFullInformation("SteamID64 / Discord ID", "Server ID", "XYZ API Key").then(result => {
console.log(result);
});
{
user: {
rpname: 'User',
wallet: 0,
usergroup: 'user',
total: 0,
last: 0000000000,
badges: [
{
badge: 'nolifer',
progress: '0',
complete: 'true'
},
{
badge: 'steam',
progress: '0',
complete: 'true'
},
{
badge: 'wiper',
progress: '0',
complete: 'true'
}
]
},
xsuite: {
name: 'User',
avatar: 'https://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/fe/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg',
background: 'https://imgur.com/0000000',
bio: 'This is my bio!'
},
xsuitelink: {
steam: '00000000000000000',
discord: '000000000000000000',
username: 'User',
tag: '0000',
booster: false
},
xadmin: {
punishments: [
{
adminid: '00000000000000000',
admin: 'Admin',
punishment: 'Mute',
reason: 'No reason given',
length: 0,
created: 0000000000
}
],
warns: [
{
adminid: '00000000000000000',
admin: 'Admin',
reason: 'No reason given',
time: 0000000000
}
],
bans: [
{
adminid: '00000000000000000',
admin: 'Admin',
reason: 'No reason given',
start: 0000000000,
end: 0000000000
}
]
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}
This function will request the DarkRP XYZ Network API endpoint and get the specified user's darkrp information.
xyz.getUserInformation("SteamID64 / Discord ID", "Server ID", "XYZ API Key").then(result => {
console.log(result);
});
{
user: {
rpname: 'User',
wallet: 0
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}
This function will request the xAdmin usergroup XYZ Network API endpoint and get the specified users usergroup.
xyz.getUsergroupInformation("SteamID64 / Discord ID", "Server ID", "XYZ API Key").then(result => {
console.log(result);
});
{
user: {
usergroup: 'user'
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}
This function will request the playtime XYZ Network API endpoint and get the specified user's playtime information.
xyz.getPlaytimeInformation("SteamID64 / Discord ID", "Server ID", "XYZ API Key").then(result => {
console.log(result);
});
{
user: {
total: 0,
last: 0000000000
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}
This function will request the badges XYZ Network API endpoint and get the specified user's badges.
xyz.getUserBadgesInformation("SteamID64 / Discord ID", "Server ID", "XYZ API Key").then(result => {
console.log(result);
});
{
user: {
badges: [
{
badge: 'nolifer',
progress: '0',
complete: 'true'
},
{
badge: 'steam',
progress: '0',
complete: 'true'
},
{
badge: 'wiper',
progress: '0',
complete: 'true'
}
]
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}
This function will request the xAdmin punishments XYZ Network API endpoint and get the specified user's punishments.
xyz.getUserPunishmentInformation("SteamID64 / Discord ID", "Server ID", "XYZ API Key").then(result => {
console.log(result);
});
{
xadmin: {
punishments: [
{
adminid: '00000000000000000',
admin: 'Admin',
punishment: 'Mute',
reason: 'No reason given',
length: 0,
created: 0000000000
}
]
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}
This function will request the xAdmin warns XYZ Network API endpoint and get the specified user's warns.
xyz.getUserWarnsInformation("SteamID64 / Discord ID", "Server ID", "XYZ API Key").then(result => {
console.log(result);
});
{
xadmin: {
warns: [
{
adminid: '00000000000000000',
admin: 'Admin',
reason: 'No reason given',
time: 0000000000
}
]
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}
This function will request the xAdmin bans XYZ Network API endpoint and get the specified user's bans.
xyz.getUserBansInformation("SteamID64 / Discord ID", "Server ID", "XYZ API Key").then(result => {
console.log(result);
});
{
xadmin: {
bans: [
{
adminid: '00000000000000000',
admin: 'Admin',
reason: 'No reason given',
start: 0000000000,
end: 0000000000
}
]
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}
This function will request the xSuite XYZ Network API endpoint and get the specified user's xsuite information.
xyz.getUserxSuiteInformation("SteamID64 / Discord ID", "XYZ API Key").then(result => {
console.log(result);
});
{
xsuite: {
name: 'User',
avatar: 'https://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/fe/fef49e7fa7e1997310d705b2a6158ff8dc1cdfeb_full.jpg',
background: 'https://imgur.com/0000000',
bio: 'This is my bio!'
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}
This function will request the xSuite Link XYZ Network API endpoint and get the specified user's xsuite link information.
xyz.getUserxSuiteLinkInformation("SteamID64 / Discord ID", "XYZ API Key").then(result => {
console.log(result);
});
{
xsuitelink: {
steam: '00000000000000000',
discord: '000000000000000000',
username: 'User',
tag: '0000',
booster: false
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}
This function will request the job tracker XYZ Network API endpoint and get the specified user's job tracker information.
xyz.getUserJobTrackerInformation("SteamID64 / Discord ID", "Department ID", "Server ID", "XYZ API Key").then(result => {
console.log(result);
});
{
jobtracker: {
entries: [
{
join: 0000000000,
leave: 0000000000,
job: 'Citizen'
}
]
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}
This function will request the whitelist XYZ Network API endpoint and get the specified job users.
xyz.getWhitelistUsersInformation("Job ID", "Server ID", "XYZ API Key").then(result => {
console.log(result);
});
{
whitelists: {
users: [
'00000000000000000'
]
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}
This function will request the statistics XYZ Network API endpoint and get the statistics.
xyz.getStatisticsInformation("XYZ API Key").then(result => {
console.log(result);
});
{
statistics: {
all_players: '0',
recent_players: '0',
today_players: '0',
total_discord: '0',
total_playtime: '0000000000',
total_steam: '0'
},
header: {
slowdownlimit: '1000',
slowdownremaining: '1000',
slowdownreset: '0000000000'
}
}