0.0.2 • Published 3 years ago
@mattplays/apexlegends-api v0.0.2
ApexLegends-API
This package is a wrapper for the Apex Legends(Mozambiquehe) API
Apex Legends
This is an Unoffical API Unoffical Docs
Usage
const {ApexLegendsAPI} = require("@mattplays/apexlegends-api")
const API = new ApexLegendsAPI("DUMMYAPIKEY");
Functions
GetPlayerStatsByName
Inputs
Input | Type |
---|---|
platform | string |
players | string[] |
Output
The GetPlayerStatsByName function returns a Promise<Player[]>
type
Usage
const API = new ApexLegendsAPI("DUMMYAPIKEY");
API.GetPlayerStatsByName("PC", ["DUMMYPLAYER1", "DUMMYPLAYER2"]).then((data) => {
// Your Code Here :D
});
GetPlayerStatsByUID
Inputs
Input | Type |
---|---|
platform | string |
uids | string[] |
Output
The GetPlayerStatsByUID function returns a Promise<Player[]>
type
Usage
const API = new ApexLegendsAPI("DUMMYAPIKEY");
API.GetPlayerStatsByName("PC", ["1000575543540"]).then((data) => {
// Your Code Here :D
});
GetMapRotation
Output
The GetMapRotation function returns a Promise<MapRotation>
type
Usage
const API = new ApexLegendsAPI("DUMMYAPIKEY");
API.GetMapRotation().then((data) => {
// Your Code Here :D
})
GetNews
Output
The GetNews function returns a Promise<News[]>
type
Usage
const API = new ApexLegendsAPI("DUMMYAPIKEY");
API.GetNews().then((data) => {
// Your Code Here :D
});
GetServerStatus
Output
The GetServerStatus function returns a Promise<ServerStatusResponse>
type
Usage
const API = new ApexLegendsAPI("DUMMYAPIKEY");
API.GetServerStatus().then((data) => {
// Your Code Here :D
});
NameToUID
Inputs
Input | Type |
---|---|
name | string |
platform | string |
Output
The NameToUID function returns a Promise<NameToUIDResponse>
type
Usage
const API = new ApexLegendsAPI("DUMMYAPIKEY");
API.NameToUID("DUMMYPLAYER1", "PC").then((data) => {
// Your Code Here :D
});
Return Types
Player
Legend
export interface Legend {
data: [
{
name: string,
value: number,
key: string,
rank: {rankPos: number, topPercent: number},
rankPlatformSpecific: {rankPos: number, topPercent: number}
},
],
gameInfo: {
badges: {name: string, value: number}[]
}
ImgAssets: {icon: string, banner: string}
}
export interface Player {
global: {
name: string,
uid: number,
avatar: string,
platform: string,
level: number,
toNextLevelPercent: number,
internalUpdateCount: number,
bans: {
isActive: boolean,
remainingSeconds: number,
last_banReason: string
},
rank: {
rankScore: number,
rankName: string,
rankDiv: number,
ladderPosPosition: number,
rankImg: string,
rankedSeason: string
},
arena: {
rankScore: number,
rankName: string,
rankDiv: number,
ladderPosPosition: number,
rankImg: string,
rankedSeason: string
}
battlepass: {
level: string,
history: {
season1: number,
season2: number,
season3: number,
season4: number,
season5: number,
season6: number,
season7: number,
season8: number,
season9: number,
season10: number,
}
},
badges: [
{name: string, value: number}
]
},
realtime: {
lobbyState: string,
isOnline: number,
isInGame: number,
canJoin: number,
partyFull: number,
selectedLegend: string,
currentState: string,
currentStateSinceTimestamp: number,
currentStateAsText: string
},
legends: {
selected: {
LegendName: string,
data: [
{name: string, value: number, key: string}
],
gameInfo: {
skin: string,
skinRarity: string,
frame: string,
frameRarity: string,
pose: string,
poseRarity: string,
intro: string,
introRarity: string,
badges: [
{name: string, value: number, category: string},
]
},
ImgAssets: {
icon: string,
banner: string
}
},
all: {
Revenant: Legend,
Crypto: Legend,
Horizon: Legend,
Gibraltar: Legend,
Wattson: Legend,
Fuse: Legend,
Bangalore: Legend,
Wraith: Legend,
Octane: Legend,
Bloodhound: Legend,
Caustic: Legend,
Lifeline: Legend,
Pathfinder: Legend,
Mirage: Legend,
Rampart: Legend,
Valkyrie: Legend,
Seer: Legend
}
},
mozambiquehere_internal: {
isNewToDB: boolean,
claimedBy: string,
APIAccessType: string,
ClusterID: string,
rate_limit: {
max_per_second: number,
current_req: string
},
clusterSrv: string
},
total: {
// Unpredictable
// Would need a player who has done X of everything
}
}
MapRotation
export interface MapRotation {
battle_royale: {
current: {
start: number,
end: number,
readableDate_start: string,
readableDate_end: string,
map: string,
DurationInSecs: number,
DurationInMinutes: number,
remainingSecs: number,
remainingMins: number,
remainingTimer: string
},
next: {
start: number,
end: number,
readableDate_start: string,
readableDate_end: string,
map: string,
DurationInSecs: number,
DurationInMinutes: number
}
},
arenas: {
current: {
start: number,
end: number,
readableDate_start: string,
readableDate_end: string,
map: string,
DurationInSecs: number,
DurationInMinutes: number,
remainingSecs: number,
remainingMins: number,
remainingTimer: string
},
next: {
start: number,
end: number,
readableDate_start: string,
readableDate_end: string,
map: string,
DurationInSecs: number,
DurationInMinutes: number
}
},
ranked: {current: {map: string}, next: {map: string}},
arenasRanked: {
current: {
start: number,
end: number,
readableDate_start: string,
readableDate_end: string,
map: string,
DurationInSecs: number,
DurationInMinutes: number,
remainingSecs: number,
remainingMins: number,
remainingTimer: string
},
next: {
start: number,
end: number,
readableDate_start: string,
readableDate_end: string,
map: string,
DurationInSecs: number,
DurationInMinutes: number
}
}
}
News
export interface News {
title: string,
link: string,
img: string,
short_desc: string,
}
ServerStatusResponse
ServerStatus
interface ServerStatus {
Status: string,
HTTPCode: number,
ResponseTime: number,
QueryTimestamp: number
}
export interface ServerStatusResponse {
Message: string,
data: {
Origin_login: {
'EU-West': ServerStatus,
'EU-East': ServerStatus,
'US-West': ServerStatus,
'US-Central': ServerStatus,
'US-East': ServerStatus,
SouthAmerica: ServerStatus,
Asia: ServerStatus
},
EA_novafusin: {
'EU-West': ServerStatus,
'EU-East': ServerStatus,
'US-West': ServerStatus,
'US-Central': ServerStatus,
'US-East': ServerStatus,
SouthAmerica: ServerStatus,
Asia: ServerStatus
},
EA_accounts: {
'EU-West': ServerStatus,
'EU-East': ServerStatus,
'US-West': ServerStatus,
'US-Central': ServerStatus,
'US-East': ServerStatus,
SouthAmerica: ServerStatus,
Asia: ServerStatus
},
ApexOauth_Crossplay: {
'EU-West': ServerStatus,
'EU-East': ServerStatus,
'US-West': ServerStatus,
'US-Central': ServerStatus,
'US-East': ServerStatus,
SouthAmerica: ServerStatus,
Asia: ServerStatus
},
selfCoreTest: {
'Status-website': ServerStatus,
'Stats-API': ServerStatus,
'Overflow-#1': ServerStatus,
'Overflow-#2': ServerStatus,
'Origin-API': ServerStatus,
'Playstation-API': ServerStatus,
'Xbox-API': ServerStatus
},
otherPlatforms: {
'Playstation-Network': ServerStatus,
'Xbox-Live': ServerStatus
}
}
}
NameToUIDResponse
export interface NameToUIDResponse {
name: string,
uid: string,
pid: string,
avatar: string
}