Fork me on GitHub

Brisingr: Fortnite Tracker

I wanted to add a new module into Brisingr for anyone that wanted to pull their Fortnite stats. Started off with some Google searches to see if there was anything out there for an official API or one to call. I found an API through the Tracker Network, however, it appeared to be broken based on the API call responses I received.

There had to be some where where the Tracker Network was getting their stats from and I went search further.

I found in the Fortnite logs the following URLs which I have labeled as to what they appear to call and respond with data wise:

Login Tokens: https://account-public-service-prod03.ol.epicgames.com/account/api/oauth/token
Login Exchange: https://account-public-service-prod03.ol.epicgames.com/account/api/oauth/exchange
Player Info: https://persona-public-service-prod06.ol.epicgames.com/persona/api/public/account/lookup?q={}
Battle Royale Stats (All Time): https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/stats/accountId/{}/bulk/window/alltime
Server Status: https://lightswitch-public-service-prod06.ol.epicgames.com/lightswitch/api/service/bulk/status?serviceId=Fortnite
Friends List: https://friends-public-service-prod06.ol.epicgames.com/friends/api/public/friends/{}
The Shop: https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/storefront/v2/catalog?rvn={}
In Game News: https://fortnitecontent-website-prod07.ol.epicgames.com/content/api/pages/fortnite-game
Player Profile: https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/game/v2/profile/{}/client/QueryProfile?profileId=athena&rvn={}

Your account ID or profile ID can be found in the game client when you click on profile.

Most if not all of these API calls require you to first authenticate before being able to send requests. The only one on this list is the Server Status API call that does not involve authentication. 

In order to authenticate, one needs to obtain their Epic Games Launcher Token and their Fortnite In-Game Token. Based on what I found for this Python based library Python-Fortnite-API-Wrapper (Pfaw for short) I knew this was something that was required and how I originally found out about the proper tokens I need. These tokens are in HTTP headers sent by your client / game when they are launched.

You can use Fiddler 4 ( https://www.telerik.com/download/fiddler ) to view your HTTP header calls and get your tokens:

  • In Tools -> Options -> HTTPS, Select Capture HTTPS Connects
  • After that start your epic games launcher.
  • You will see a request with /account/api/oauth/token. Click on it and click after that on Inspectors get the header (Authorization header content and remove basic) => This header is your Client Launcher Token
  • Launch Fortnite
  • You will see again a request with /account/api/oauth/token. Click on it and click after that on Inspectors get the header (Authorization header content and remove basic) => This header is your Fortnite Client Token

What some of these other sites don't say though, is that you need to enable the "Decrypt HTTPS Header" feature in order to see this. It's located under Options -> HTTPS (check box just below first step above)

Now that I found all of the above and someone already created a Python library, I figured there's no point in writing my own. I decied to use PFAW (written for Python 3.X). Brisingr uses Python 2.7.X so I had to do some code conversions to make it work. Using 3to2 I was able to convert the code to work with Python 2 which is what Brisingr is currently using.

So we need the following to make this work

  • Epic Games Launcher Token
  • Fortnite In-Game Token
  • Fortnite Accout Email
  • Fortnite Account Password

It is recommended to create a new Epic Games account for this unless  you prefer to use your actual in-game credentials.

The code as of now and in the future for the Fortnite Stats can be found here: https://github.com/devzspy/Brisingr/blob/master/mod_fortnite.py

You will only need to configure the following lines:

account_email = 'Enter your Epic Games email here'
account_password = 'Enter your Epic Games password here'
launch_token = 'Enter your launcher token authorization'
game_token = 'Enter your game token authorization'