Skip to main content

A python wrapper for Fortnite-API.com

Project description

Sync/Async Python wrapper for Fortnite-API.com

GitHub issues PyPI - Downloads PyPI PyPI - Python Version Support

This library offers a complete sync and async wrapper around the endpoints of Fortnite-API.com

Installation

pip install fortnite-api

Documentation

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()
Parameters
  • api_key [str] (Optional) - Insert your API key from https://fortnite-api.com/profile
  • run_async [bool] (Optional) - Specify if the API should run async. Default is set to false
Attributes
  • cosmetics - All cosmetic endpoints
  • shop - All shop endpoints
  • news - All news endpoints



Now we can use the client:

Cosmetics

api.cosmetics.fetch_all()

Get all Br cosmetics.

Parameters
  • language [GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns

Returns a list of BrCosmetic objects.

api.cosmetics.fetch_new()

Get all new Br cosmetics.

Parameters
  • language [GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns

Returns a NewBrCosmetics object.


api.cosmetics.search_by_id()

Search one o multiple items by their id.

Parameters
  • *cosmetic_id - One or multiple cosmetic ids.
  • language [GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns

Returns a list of BrCosmetic objects.


api.cosmetics.search_all()

Search all cosmetics which fit to the search parameters

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 becomes search_language
  • language [GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns

Returns a list of BrCosmetic objects.


api.cosmetics.search_first()

Search the first cosmetics which fit to the search parameters

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 becomes search_language
  • language [GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns

Returns a BrCosmetic objects.


Playlist

api.playlists.fetch_all()

Get all Br playlists.

Parameters
  • language [GameLanguage] (Optional) - Specify the language of the playlists. Default is set to english
Returns

Returns a list of Playlist objects.

api.cosmetics.fetch_by_id()

Get a playlist by id.

Parameters
  • id [str] - Specify the playlist id.
  • language [GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns

Returns a Playlist object.


Shop

api.shop.fetch()

Get the latest Fortnite shop.

Parameters
  • language [GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
  • combined [bool] (Optional) - Enable that special_featured and special_daily are moved into featured and daily
Returns

Returns a Shop object.


AES

api.aes.fetch()

Get the latest Fortnite AES Key. This also include version and build information.

Parameters
  • key_format [KeyFormat] (Optional) - Specify the AES key format. Default is set to HEX
Returns

Returns a AES object.


News

api.news.fetch()

Get the latest Fortnite news of all game modes.

Parameters
  • language [GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns

Returns a News object.


api.news.fetch_by_type()

Get the latest Fortnite news of a specified game mode.

Parameters
  • news_type [NewsType] - Specify the news type.
  • language [GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns

Returns a GameModeNews object.


Creator Code

api.creator_code.fetch()

Get information about a creator code.

Parameters
  • name [str] - Specify a creator code.
Returns

Returns a CreatorCode object.


api.creator_code.exists()

Check if a creator code exists.

Parameters
  • name [str] - Specify a creator code.
Returns

Returns a bool object.


api.creator_code.search_all()

Search a creator code by name. All results are provided.

Parameters
  • name [str] - Specify a creator code.
Returns

Returns a list of CreatorCode objects.


api.creator_code.search_first()

Search a creator code by name. Only the first result is provided.

Parameters
  • name [str] - Specify a creator code.
Returns

Returns a CreatorCode object.


BR Stats

api.stats.fetch_by_name()

Returns stats of the requested player account.

Parameters
  • 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

Returns a BrPlayerStats object.


api.stats.fetch_by_id()

Returns stats of the requested player account by its account id.

Parameters
  • account_id [str] - Sets the account id.
  • time_window [TimeWindow] (Optional) - Sets the time window.
  • image [StatsImageType] (Optional) - Sets the image platform.
Returns

Returns a BrPlayerStats object.

Banner

api.cosmetics.fetch()

Get all banners.

Parameters
  • language [GameLanguage] (Optional) - Specify the language of the banners. Default is set to english
Returns

Returns a Banner object.


api.cosmetics.fetch_colors()

Get all banner colors.

Returns

Returns a list of BannerColor objects.

Map

api.map.fetch()

Get the current map information.

Parameters
  • language [GameLanguage] (Optional) - Specify the language of the map pois. Default is set to english.
Returns

Returns a Map object.


Contribute

Every type of contribution is appreciated!

License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fortnite-api-2.3.2.tar.gz (16.2 kB view details)

Uploaded Source

File details

Details for the file fortnite-api-2.3.2.tar.gz.

File metadata

  • Download URL: fortnite-api-2.3.2.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for fortnite-api-2.3.2.tar.gz
Algorithm Hash digest
SHA256 fe658ece9575af7f2f4314dcbbab87739c4149f72e231ebcc84f157b0b6badb9
MD5 f1a80b5065728e46295f78c17067df4f
BLAKE2b-256 19dc7fec17128db9de6ddeffcc7adc9fb8a1fd034357c43316fea89cdede5642

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page