You need to create EpicGames account and download EpicGames Launcher here. After this you will need to install Fortnite.
Gradle:
dependencies {
implementation 'com.whiskermrr:rxjava-fortnite-api:0.3.7'
}
Maven:
<dependency>
<groupId>com.whiskermrr</groupId>
<artifactId>rxjava-fortnite-api</artifactId>
<version>0.3.6</version>
<type>pom</type>
</dependency>
Follow these steps to get your launcher and fortnite tokens:
- Install Fiddler or other application for capturing HTTPS requests.
- Start EpicGames Launcher and Login (wrapper does not support 2-step verification).
- Look for request to
/account/api/oauth/token
endpoint and go to Authorization Header. - Copy the value of header without 'basic'. This is Launcher Token.
- Launch Fortnite.
- Check for another request to
/account/api/oauth/token
endpoint and go to Authorization Header. - Once again copy the new value of header without 'basic'. This is Fortnite Token.
FortniteApi fortniteApi = new FortniteApi(retrofit, EMAIL, PASSWORD, LAUNCHER_TOKEN, FORTNITE_TOKEN);
fortniteApi.authenticate();
fortniteApi.getUserBattleRoyaleStats("whiskermrr")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SingleObserver<BattleRoyaleStats>() {
@Override
public void onSubscribe(Disposable d) {
// e.g. disposables.add(d);
}
@Override
public void onSuccess(BattleRoyaleStats stats) {
// e.g. update view
}
@Override
public void onError(Throwable e) {
// e.g. notify view about error
}
});
Example of how to get 10 News with offset 0:
fortniteApi.getBlogs(FortniteApiConstants.PATCH_NOTES, 10, 0, Locale.US.toString())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new SingleObserver<BlogHolder>() {
@Override
public void onSubscribe(Disposable d) {
// e.g. disposables.add(d);
}
@Override
public void onSuccess(BlogHolder news) {
// e.g. update recyclerview
}
@Override
public void onError(Throwable e) {
// e.g. notify view about error
}
});
If You have installed Python on your computer You can check fortnite_weapons.py file which is in the root directory of repo.
Script is getting data about all weapons in Battle Royale Mode from Gamepedia and save them in json file.
It is also capable to download all images of weapons when -img argument of the script is specified.
-img values:
0 - do not download images
1 - download images (120px)
2 - download images (240px)
3 - download images (360px)
Open terminal/cmd and go to directory where fornite_weapons.py is located than execute this command:
python fortnite_weapons.py -img 2
Just me :) Feel free to join me.