How to Track Fortnite Player Stats in Real-Time
Learn how to use the Fortnite API to build a real-time player stats tracker. Covers account resolution, stat endpoints, data structures, and implementation tips.
Why Track Player Stats?
Fortnite player stats are among the most requested data points for gaming apps, Discord bots, and streaming overlays. The Fortnite API gives you programmatic access to detailed statistics for any player.
Important: Stats Use Account IDs
The stats endpoint works with Epic account IDs, not display names. A display name like "Ninja" maps to a unique account ID (e.g. 4735ce9132924caf8a5b17789b40f79c). Your flow is always two steps:
Step 1 — Resolve the Account ID
GET /api/v1/account/displayName/{displayName}const BASE_URL = "https://prod.api-fortnite.com";
const HEADERS = { "x-api-key": process.env.FORTNITE_API_KEY };
async function resolveAccountId(displayName) {
const res = await fetch(
`${BASE_URL}/api/v1/account/displayName/${encodeURIComponent(displayName)}`,
{ headers: HEADERS }
);
if (!res.ok) throw new Error("Player not found");
const data = await res.json();
return data.id; // Epic account ID
}Step 2 — Fetch Stats
GET /api/v2/stats/{accountId}Optional query parameters:
startDate — ISO 8601 start date filterendDate — ISO 8601 end date filterstats — Comma-separated stat keys to include (e.g. br_kills_total,br_wins_total)async function getPlayerStats(accountId, statKeys) {
const params = new URLSearchParams();
if (statKeys) params.set("stats", statKeys);
const res = await fetch(
`${BASE_URL}/api/v2/stats/${accountId}?${params}`,
{ headers: HEADERS }
);
return res.json();
}Putting It Together
async function lookupPlayer(displayName) {
const accountId = await resolveAccountId(displayName);
const stats = await getPlayerStats(accountId);
return stats;
}
const result = await lookupPlayer("Ninja");
console.log(result);Bulk Stats
Need stats for multiple players at once? Use the bulk endpoint instead of looping:
POST /api/v2/stats/bulkasync function getBulkStats(accountIds) {
const res = await fetch(`${BASE_URL}/api/v2/stats/bulk`, {
method: "POST",
headers: { ...HEADERS, "Content-Type": "application/json" },
body: JSON.stringify(accountIds),
});
return res.json();
}Building a Real-Time Tracker
To track stats in real time:
Ranked Progress
For ranked/arena progress (level, XP, battle pass tier), use the profile endpoints — these accept a display name directly and require a Starter plan or above:
GET /api/v1/profile/progress?displayName=Ninja
GET /api/v1/profile/ranked?displayName=Ninja