Hello Team,
I’m trying to build a web app that shows:
-
Ranked/unranked data
-
Season wise data
-
Lifetime stats
-
Battle Royale, Zero Builds stats
for the fortnite game. I can see all this information on the tracker gg site. I saw we can use the API to get these data and created an app. However using the below creds, I always get 403. Here is the code I’m using:
// Include the axios library
const axios = require(‘axios’);
// Set the API endpoint and parameters
const API_ENDPOINT = ‘https://api.fortnitetracker.com/v1/profile’;
const headers = {
‘TRN-Api-Key’: ‘code’,
};
const username = ‘Ninja’;
const platform = ‘pc’;
// Make the request
axios.get(${API_ENDPOINT}/${platform}/${username}
, { headers })
.then((response) => {
const stats = response.data.lifeTimeStats;
console.log(${username} has ${stats[7].value} total kills
);
})
.catch((error) => {
console.error(“errorrrrrr”, error);
});