How to use fortnite API

Hello Team,

I’m trying to build a web app that shows:

  1. Ranked/unranked data

  2. Season wise data

  3. Lifetime stats

  4. 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);
});

Hi @antoaravinth,

Unfortunately, we had to disable our public Fortnite APIs, you cannot make these requests anymore.

You can, however, send us an email if you have any ideas or concepts for partnership: [email protected].