Patch 7.1.0 is live — Clean up of duplicated endpoints & improvement of Typescript SDK.
api-fortnite
← Back to Blog

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.

tutorialplayer-statsreal-time

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:


  • Resolve display name → account ID
  • Fetch stats with the account ID

  • 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 filter
  • endDate — ISO 8601 end date filter
  • stats — 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/bulk

    async 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:


  • Poll at reasonable intervals — Stats update after matches, typically with a 5–15 minute delay. Polling every 5 minutes is sufficient.
  • Store historical snapshots — Save results to your own database to show trends over time.
  • Compute deltas — Subtract the previous snapshot from the current one to show recent session performance.
  • Cache the account ID — Store the accountId alongside the display name so you don't need to resolve it every poll.

  • 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

    Related Guides


  • Getting Started with the Fortnite API
  • Item Shop API Complete Guide