Dashboard
← 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 endpoints, data structures, and implementation tips.

tutorialplayer-statsreal-time

Why Track Player Stats?


Fortnite player stats are some of the most requested data points for gaming apps, Discord bots, and streaming overlays. With the Fortnite API, you can access detailed statistics for any player across all platforms.


The Player Stats Endpoint


The primary endpoint for player stats is:


GET /v1/stats/:platform/:username

Where :platform is one of pc, psn, xbl, or touch, and :username is the player's Epic Games display name.


Example Response


A typical response includes:


  • Overall stats — Total wins, kills, matches played, K/D ratio
  • Per-mode stats — Solo, Duo, Squad breakdowns
  • Season stats — Current and historical season performance
  • Account info — Account ID, platform, last updated timestamp

  • Building a Real-Time Tracker


    To track stats in real-time, you'll want to:


  • Poll at reasonable intervals — Every 5-10 minutes is sufficient for most use cases. Stats don't update instantly after a match.
  • Store historical data — Save snapshots to your own database to show trends and graphs over time.
  • Compare deltas — Calculate the difference between polls to show recent performance (e.g., "5 wins in the last hour").
  • Use caching — Cache responses with Redis to avoid hitting rate limits unnecessarily.

  • Implementation Example (JavaScript)


    const API_KEY = process.env.FORTNITE_API_KEY;
    const BASE_URL = "https://api-fortnite.com";
    
    async function getPlayerStats(platform, username) {
      const response = await fetch(
        `${BASE_URL}/v1/stats/${platform}/${encodeURIComponent(username)}`,
        { headers: { Authorization: API_KEY } }
      );
      return response.json();
    }
    
    // Fetch stats for a player
    const stats = await getPlayerStats("pc", "Ninja");
    console.log(`Wins: ${stats.data.overall.wins}`);

    Tips for Production


  • Handle 404 responses for players who have privacy settings enabled
  • Normalize usernames (trim whitespace, handle special characters)
  • Show loading states while fetching — stats lookup can take 1-2 seconds
  • Consider using our JavaScript SDK for type-safe access

  • Related Guides


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