Sync/Async Python wrapper for Fortnite-API.com
This library offers a complete sync and async wrapper around the endpoints of Fortnite-API.com
pip install fortnite-api
- Get a API key on https://dash.fortnite-api.com/account
Here is a quick overview how to start.
First we need to import the api and initialize client.
import fortnite_api
api = fortnite_api.FortniteAPI()
api_key
[str] (Optional) - Insert your API key from https://dash.fortnite-api.com/accountrun_async
[bool] (Optional) - Specify if the API should run async. Default value isFalse
cosmetics
- All cosmetic endpointsshop
- All shop endpointsnews
- All news endpoints
Now we can use the client:
api.cosmetics.fetch_all()
Get all Br cosmetics.
language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns a list of BrCosmetic
objects.
api.cosmetics.fetch_new()
Get all new Br cosmetics.
language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns a NewBrCosmetics
object.
api.cosmetics.search_by_id()
Search one o multiple items by their id.
*cosmetic_id
- One or multiple cosmetic ids.language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns a list of BrCosmetic
objects.
api.cosmetics.search_all()
Search all cosmetics which fit to the search parameters
**search_parameters
- All search parameters are listed on the Fortnite-API.com Docs. Remember that Python does not use a camel case. So e.g.searchLanguage
becomessearch_language
language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns a list of BrCosmetic
objects.
api.cosmetics.search_first()
Search the first cosmetics which fit to the search parameters
**search_parameters
(Optional) - All search parameters are listed on the Fortnite-API.com Docs. Remember that Python does not use a camel case. So e.g.searchLanguage
becomessearch_language
language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns a BrCosmetic
objects.
api.playlists.fetch_all()
Get all Br playlists.
language
[GameLanguage] (Optional) - Specify the language of the playlists. Default is set to english
Returns a list of Playlist
objects.
api.cosmetics.fetch_by_id()
Get a playlist by id.
id
[str] - Specify the playlist id.language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns a Playlist
object.
api.shop.fetch()
Get the latest Fortnite shop.
language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to englishcombined
[bool] (Optional) - Enable thatspecial_featured
andspecial_daily
are moved intofeatured
anddaily
Returns a Shop
object.
api.aes.fetch()
Get the latest Fortnite AES Key. This also include version and build information.
key_format
[KeyFormat] (Optional) - Specify the AES key format. Default is set to HEX
Returns a AES
object.
api.news.fetch()
Get the latest Fortnite news of all game modes.
language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns a News
object.
api.news.fetch_by_type()
Get the latest Fortnite news of a specified game mode.
news_type
[NewsType] - Specify the news type.language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns a GameModeNews
object.
api.creator_code.fetch()
Get information about a creator code.
name
[str] - Specify a creator code.
Returns a CreatorCode
object.
api.creator_code.exists()
Check if a creator code exists.
name
[str] - Specify a creator code.
Returns a bool
object.
api.creator_code.search_all()
Search a creator code by name. All results are provided.
name
[str] - Specify a creator code.
Returns a list
of CreatorCode
objects.
api.creator_code.search_first()
Search a creator code by name. Only the first result is provided.
name
[str] - Specify a creator code.
Returns a CreatorCode
object.
api.stats.fetch_by_name()
Returns stats of the requested player account.
name
[str] - Sets the account name.account_type
[AccountType] (Optional) - Sets the account type.time_window
[TimeWindow] (Optional) - Sets the time window.image
[StatsImageType] (Optional) - Sets the image platform.
Returns a BrPlayerStats
object.
api.stats.fetch_by_id()
Returns stats of the requested player account by its account id.
account_id
[str] - Sets the account id.time_window
[TimeWindow] (Optional) - Sets the time window.image
[StatsImageType] (Optional) - Sets the image platform.
Returns a BrPlayerStats
object.
api.cosmetics.fetch()
Get all banners.
language
[GameLanguage] (Optional) - Specify the language of the banners. Default is set to english
Returns a Banner
object.
api.cosmetics.fetch_colors()
Get all banner colors.
Returns a list of BannerColor
objects.
api.map.fetch()
Get the current map information.
language
[GameLanguage] (Optional) - Specify the language of the map pois. Default is set to english.
Returns a Map
object.
Every type of contribution is appreciated!