Tracking FNCS Tournament Data in Real-Time
How to build a live leaderboard for Fortnite competitive events using webhooks and the Cito API.
Building an FNCS Leaderboard
Fortnite Champion Series (FNCS) events are some of the most-watched esports competitions. In this tutorial, we'll build a real-time leaderboard that updates as games are played.
The Challenge
FNCS uses a points-based system across multiple games:
- Victory Royale: 25 points
- Eliminations: 1 point each
- Placement points based on finish position
Tracking this in real-time requires constant API polling or webhooks.
Setting Up Webhooks
Webhooks push data to your server instantly when events occur:
// Webhook handler (Express.js)
app.post('/webhook/fortnite', (req, res) => {
const { event, data } = req.body;
switch (event) {
case 'match.ended':
updateLeaderboard(data.results);
break;
case 'elimination':
incrementKills(data.player_id);
break;
}
res.status(200).send('OK');
});
The Leaderboard Component
function FNCSLeaderboard({ tournamentId }) {
const [standings, setStandings] = useState([]);
// Subscribe to real-time updates
useEffect(() => {
const ws = new WebSocket('wss://api.citoapi.com/ws');
ws.onmessage = (event) => {
const update = JSON.parse(event.data);
if (update.tournament_id === tournamentId) {
setStandings(update.standings);
}
};
return () => ws.close();
}, [tournamentId]);
return (
Rank
Player
Points
Elims
Wins
{standings.map((player, i) => (
{i + 1}
{player.name}
{player.points}
{player.eliminations}
{player.victories}
))}
);
}
Caching Strategy
For high-traffic events:
Conclusion
Real-time FNCS leaderboards are engaging for viewers and relatively simple to build with the right API. Check out our Fortnite API documentation for more details.
Ready to Build?
Get your API key and start building with esports data in minutes.