An unofficial .NET API Wrapper for the Fortnite API (http://fortniteapi.com) Documentation is found below!
Our stable build is available from NuGet through the FNAPI metapackage:
Once you have added the NuGet Package to your Project, you will need to add the using FortniteAPI; to your class header.
Then simply instance the FNAPI class with your API key, like so:
var API = new FNAPI("ENTER A VALID API KEY HERE");Now you can easily make calls to the API.
The base user class FNUser contains the UID and Username of a user.
If you already know a user's UID or Username, you can use the GetUser() method to return an FNUser object.
- Username:
var user = API.GetUser("username");- UID:
var user = API.GetUser(new UID("uid"));If you're wanting to get a user's BR stats, you can simply use .Stats.GetBRStatsAsync(); and it will return the requested stats.
var user = API.GetUser("username");
var stats = await user.Stats.GetBRStatsAsync();The current store is a breeze to get using GetStoreAsync().
This is an async method though, so it will need to be used with await.
var store = await API.BR.Store.GetStoreAsync();This will return an FNBRStore object - which holds all the current in-store items.
You can also use GetFeaturedStore() and GetDailyStore() on the FNBRStore to return the corresponding in-store items.
var daily = store.GetDailyStore();
var featured = store.GetFeaturedStore();The FNBRStore also has the ability to get any upcoming items available but not yet in stores.
var upcoming = await API.BR.Store.GetUpcomingItemsAsync();If you are looking for an item that isn't currently in-stores, you can search for it!
var item = await API.BR.Store.SearchItemAsync("ITEM NAME");This will return a list of FNBRSearchItem which can be used to get more details on the item.
For example, we can use it to get the occurrences of said item.
var searchItem = API.BR.Store.SearchItemAsync("ITEM NAME").First();
var item = await API.BR.Store.GetItemAsync(searchItem.ItemID);
var occurrences = item.Occurrences;NOTE: The
SearchItemAsynccall does not consume your call count.
NOTE: This won't expose any unreleased challenges.
This will return a list of FNChallengeItem. Which holds information about the challenge's name, stars required and difficulty.
You can check which the current week for challenges like so:
var challenges = API.BR.Challenges.GetChallengesAsync();In Battle Royale, there are Global Leaderboards. You can get these using the API, quick easily!
Using GetLeaderboardAsync() will return a list of FNLeaderboardItem.
var leaderboard = await API.BR.Leaderboard.GetLeaderboardAsync();This includes information about each leaderboard entry. However, from this, you can then use GetUser() to return a FNBRUser object based on the leaderboard entry - this can then be used to look up the players stats.
var leaderboardItem = await API.BR.Leaderboard.GetLeaderboardAsync().First();
var user = leaderboardItem.GetUser();
var userStats = await user.Stats.GetBRStatsAsync();This returns a list of FNNewsItem. This holds the Title, Body and Image for the BR MOTD.
var news = await API.BR.News.GetNewsAsync();This returns a list of FNNewsItem. This holds the Title, Body and Image for the STW MOTD.
var news = await API.STW.News.GetNewsAsync();Want the latest patchnotes? Use this simple call to get data from the Patchnotes. This includes: title,description, images and an ExternalLink to the patchnotes page.
var patchnotes = await API.Patchnotes.GetPatchnotesAsync();Returns the current Game Version.
var version = API.GetCurrentVersion();Need to check whether servers are up and running? Simply use the GetStatusAsync() method.
var status = await API.GetStatusAsync();Returns the current Week.
var week = API.GetCurrentWeek();Returns the current Season.
var season = API.GetCurrentSeason();