Objects

The API has many objects that represent different parts of the Fortnite API. Below is a list of all the objects and their attributes and methods.

class fortnite_api.Account(*, data, http)
Attributes

Represents a Fortnite account.

This inherits from Hashable and ReconstructAble.

str(x)

Returns the account’s name.

repr(x)

Returns a representation of the account in the form of a string.

id

The id of the account.

Type:

str

name

The display name of the account.

Type:

str

class fortnite_api.Aes(*, data, http)

Represents the object given to the client from the AES endpoint. This inherits from ReconstructAble.

x == y

Checks if the two Aes objects are equal.

x != y

Checks if two Aes objects are not equal.

hash(x)

Returns the Aes main key and build’s hash.

repr(x)

Returns a representation of the Aes object in the form of a string.

Examples

Fetching the current AES main key and build.
aes = await client.fetch_aes()
print(aes.main_key, aes.build)
Fetching the current version of Fortnite.
aes = await client.fetch_aes()
major, minor = aes.version
print(f'Fortnite on version {major}.{minor}')
main_key

The main encryption key. Can be None if the current versions key is not available yet.

Type:

Optional[str]

build

The current build where the Aes key refers to.

Type:

str

version

The current version where the Aes key refers to. This will only be None in the case that the API returned an invalid build value.

Type:

Optional[fortnite_api.Version]

updated

The date where the Aes was updates.

Type:

datetime.datetime

dynamic_keys

All current dynamic keys

Type:

List[fortnite_api.DynamicKey]

class fortnite_api.Version(major, minor)
Attributes

Represents a version of a build of Fortnite.

repr(x)

Returns a representation of the account in the form of a string.

str(x)

Returns the version in the form of a string. “major.:attr:minor

iter(x)

Returns an iterator of the version. This will yield the major version and then the minor version.

major, minor = version
major

The major version.

Type:

int

minor

The minor version.

Type:

int

class fortnite_api.DynamicKey(*, data, http)

Represents a dynamic key.

x == y

Checks if the two dynamic keys are equal.

x != y

Checks if two dynamic keys are not equal.

str(x)

Returns the dynamic key’s pak filename.

hash(x)

Returns the dynamic key’s hash.

repr(x)

Returns a representation of the account in the form of a string.

pak_filename

The pak’s filename.

Type:

str

pak_guid

The pak’s guid.

Type:

str

key

The key.

Type:

str

class fortnite_api.CosmeticsAll(*, data, http)

A class that represents a request to fetch all cosmetics available in Fortnite. This inherits from ReconstructAble.

len(x)

Returns the total amount of cosmetics available.

iter(x)

Returns an iterator of the cosmetics, working through one unique cosmetic type before continuing onto the next. Works in the following order: CosmeticBr, CosmeticTrack, CosmeticInstrument, CosmeticCar, VariantLego, CosmeticLegoKit.

repr(x)

Returns a representation of the account in the form of a string.

Fetching all cosmetics in Fortnite and printing their IDs.
# (1) Fetch all the cosmetics using the client
all_cosmetics = await client.fetch_cosmetics_all()

# (2) Walk through each cosmetic
for cosmetic in all_cosmetics:
    # (3) Print out their metadata
    print(cosmetic.id)
br

A list of all battle royale cosmetics.

Type:

List[fortnite_api.CosmeticBr]

tracks

A list of all track cosmetics.

Type:

List[fortnite_api.CosmeticTrack]

instruments

A list of all instrument cosmetics.

Type:

List[fortnite_api.CosmeticInstrument]

cars

A list of all car cosmetics.

Type:

List[fortnite_api.CosmeticCar]

lego

A list of all lego cosmetic variants.

Type:

List[fortnite_api.VariantLego]

lego_kits

A list of all lego kit cosmetics.

Type:

List[fortnite_api.CosmeticLegoKit]

class fortnite_api.Asset(*, http, url, max_size=..., size=...)
Attributes
Methods

Represents an asset given to the client. An asset can represent any image or video that has been fetched from the API.

Examples

Fetching a cosmetic and reading the icon data:
cosmetic = await client.fetch_cosmetic_br('CID_028_Athena_Commando_F')
images = cosmetic.images
if images is not None and images.icon is not None:
    icon: bytes = await images.icon.read()
property url

The url of the asset.

Type:

str

property can_resize

returns: Whether this asset can be resized. :rtype: bool

property max_size

returns: The max size of the asset. If None, there is no max size. If -1, resizing is not allowed. :rtype: Optional[int]

resize(size)

Resizes the asset to the given size.

Parameters:

size (int) – The size to resize the asset to. This must be a power of 2.

Returns:

The resized asset.

Return type:

fortnite_api.Asset

Raises:

ValueError – This asset does not support resizing.

read()

This function could be a coroutine.

Retrieves the content of this asset as a bytes object. This is only a coroutine if the client is an async client, otherwise it is a regular method.

Returns:

The image bytes.

Return type:

bytes

class fortnite_api.Banner(*, data, http)

Represents a banner within the Fortnite game.

This inherits from Hashable and ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

Examples

Fetch all banners in Fortnite.
# (1) Fetch all the banners using the client
banners = await client.fetch_banners()

# (2) Walk through each banner
for banner in banners:
    # (3) Print out their metadata
    print(banner.id, banner.name, banner.description)
Fetch the images of all the banners in Fortnite.
# (1) Fetch all the banners using the client
banners = await client.fetch_banners()

# (2) Walk through each banner
for banner in banners:
    # (3) Print out the image URL of the banner
    print(banner.images.icon.url)
id

The id of the banner.

Type:

str

name

The name of the banner. Can be None if the banner is not named or no information is provided by the API.

Type:

Optional[str]

description

The description of the banner.

Type:

str

category

The category the banner belongs to. Can be None if this banner does not belong to any category.

Type:

Optional[str]

full_usage_rights

Denotes if the banner is full usage rights from Epic Games.

Type:

bool

dev_name

The developer name of the banner, this is used internally by the Epic Games team.

Type:

str

images

Preview images of the banner.

Type:

fortnite_api.Images

class fortnite_api.BannerColor(*, data, http)

Represents a color of a fortnite_api.Banner.

This inherits from Hashable and ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

id

The id of the color.

Type:

str

color

The color of the banner.

Type:

str

category

The category of the banner.

Type:

str

sub_category_group

The sub category group of the banner.

Type:

int

class fortnite_api.CreatorCode(*, data, http)
Attributes

Represents a Creator Code.

This inherits from ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

code

The creator code.

Type:

str

account

The account associated with the creator code. Ie, the account that owns the creator code.

Type:

fortnite_api.Account

class fortnite_api.Images(*, data, http)
Attributes

Represents image data passed from the API. This class is used to represent commonly provided assets for many API endpoints and object types.

This inherits from ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

small_icon

A smaller icon asset. Typically, this is a smaller version of the main image.

Type:

Optional[fortnite_api.Asset]

icon

An icon asset. Typically, this is the main image of the object.

Type:

Optional[fortnite_api.Asset]

class fortnite_api.Map(*, data, http)
Attributes

Represents a Fortnite map. This inherits from ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

Examples

Getting the images of the Fortnite map.
map = await client.fetch_map()
print(map.images.pois.url)
print(map.images.blank.url)
images

The images of the map.

Type:

fortnite_api.MapImages

pois

The list of POIs in the map.

Type:

List[fortnite_api.POI]

class fortnite_api.MapImages(*, data, http)
Attributes

Represents the images of a given POI map. This inherits from ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

blank

The asset pointing to an image of the map that does not contain any POI names.

Type:

fortnite_api.Asset

pois

The asset pointing to an image of the map that contains the POI names.

Type:

fortnite_api.Asset

class fortnite_api.POI(*, data, http)
Attributes

Represents a specific POI in a Fortnite map.

This inherits from Hashable and ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

Examples

Getting all POIs in the Fortnite map.
# (1) Fetch the map
map = await client.fetch_map()

# (2) walk through all the POIs
for poi in map.pois:
    # (3) print the name & (x, y, z) coordinates
    print(poi.name, tuple(poi.location))
id

The ID of the POI.

Type:

str

name

The name of the POI.

Type:

str

location

The location of the POI.

Type:

fortnite_api.POILocation

class fortnite_api.POILocation(*, data, http)
Attributes

Holds the x, y, z coordinates of a POI in a Fortnite map. This inherits from ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

iter(x)

Returns an iter of the x, y, z coordinates.

Examples

Unpacking a POI location.
map = await client.fetch_map()
poi = map.pois[0]
x, y, z = poi.location
print(x, y, z)
x

The x coordinate.

Type:

float

y

The y coordinate.

Type:

float

z

The z coordinate.

Type:

float

class fortnite_api.NewCosmetic(*, type, hash=None, last_addition=None, items)

Represents a response from the new cosmetics endpoint for a given cosmetic type. You can use the type to help you determine what items will be. The items will be a list of the corresponding cosmetic type:

type

The type of new cosmetics displayed.

Type:

fortnite_api.CosmeticCategory

hash

The hash of the new cosmetics. Can be None if no new cosmetics have been given for the cosmetic type.

Type:

Optional[str]

last_addition

The last addition of new cosmetics.

Type:

datetime.datetime

items

The new cosmetics. This corresponds to the type of new cosmetics. Can be empty if no new cosmetics have been given.

Type:

List[fortnite_api.Cosmetic]

class fortnite_api.NewCosmetics(*, data, http)

Represents a response from the new cosmetics endpoint.

This class inherits from ReconstructAble.

Examples

Obtain all the new Battle Royale cosmetics.
new_cosmetics = await client.fetch_cosmetics_new()
new_br_cosmetics = new_cosmetics.br
for cosmetic in new_br_cosmetics.items:
    print(cosmetic.name)
build

The build of Fortnite that these cosmetics were added in.

Type:

str

previous_build

The previous build of Fortnite.

Type:

str

date

The date of the new cosmetics.

Type:

datetime.datetime

global_hash

The combined hash of all new cosmetics.

Type:

str

global_last_addition

The last time a new cosmetic was added.

Type:

datetime.datetime

br

The new BR cosmetics.

Type:

fortnite_api.NewCosmetic

tracks

The new track cosmetics.

Type:

fortnite_api.NewCosmetic

instruments

The new instrument cosmetics.

Type:

fortnite_api.NewCosmetic

cars

The new car cosmetics.

Type:

fortnite_api.NewCosmetic

lego

The new lego cosmetic variants.

Type:

fortnite_api.NewCosmetic

lego_kits

The new lego kit cosmetics.

Type:

fortnite_api.NewCosmetic

beans

The new bean cosmetic variants.

Type:

fortnite_api.NewCosmetic

class fortnite_api.RenderImage(*, data, http)

Represents a render image for a shop entry. A render image is an image used to visually represent a cosmetic item in the shop. This class inherits from ReconstructAble.

Changed in version v3.1.0: Renamed from ShopEntryRenderImage to a more generic RenderImage to reflect its usage across the API.

product_tag

The product tag of the render image.

Type:

fortnite_api.ProductTag

file_name

The internal file name of the rendered image. Refers to the name within the game files and not the :attr`image`. An example of this is T-Featured-Pickaxes-SleepyTimePickaxe.

Type:

str

image

The image of the render image.

Type:

fortnite_api.Asset

class fortnite_api.MaterialInstanceImages(*, data, http)
Attributes

Represents some images of a Material instance, as they are rendered in game. Although this class has concrete attributes, the API generates the keys dynamically. The most common keys are exposed as attributes, and all other keys are available through dictionary operations.

This class inherits from dict, and thus, supports all the operations that a normal dictionary does, such as indexing, iteration, etc.

Changed in version v3.1.0: Moved from the now-deleted fortnite_api.material to fortnite_api.new_display_asset.

offer_image

The offer image of the Material instance. This is the image that is shown in the item shop. Can be None if there is no offer image for the Material instance.

Type:

Optional[fortnite_api.Asset]

background

The background of the Material instance. This is the background gradient of the material instance. Can be None if there is no background for the Material instance.

Type:

Optional[fortnite_api.Asset]

class fortnite_api.MaterialInstanceColors(*, data)

Represents some metadata about the colors of a Material instance. Although the keys are dynamically generated in the API, the most common keys are exposed as attributes.

This class inherits from dict, and thus, supports all the operations that a normal dictionary does, such as indexing, iteration, etc.

Changed in version v3.1.0: Moved from the now-deleted fortnite_api.material to fortnite_api.new_display_asset.

background_color_a

The first background color of the Material instance, if any.

Type:

Optional[str]

background_color_b

The second background color of the Material instance, if any.

Type:

Optional[str]

fall_off_color

The fall off color of the Material instance, if any.

Type:

Optional[str]

class fortnite_api.MaterialInstance(*, data, http)

Material instancing is a way to create a parent Material that you can use as a base to make a wide variety of different looking children (Material instances).

Fortnite takes advantage of this concept for its cosmetics. This allows developers to create a single cosmetic and then create many different versions of it using Material instances. This is used across not just skins but also extended onto lego cosmetic variants as well.

This class represents a Material instance, which is said to be a child of a bigger parent Material.

This class inherits from Hashable and ReconstructAble.

Changed in version v3.1.0: Moved from the now-deleted fortnite_api.material to fortnite_api.new_display_asset.

id

The ID of the Material instance.

Type:

str

primary_mode

The primary mode of the Material instance. This denotes what the cosmetic material instance is compatible with.

Type:

fortnite_api.CosmeticCompatibleMode

product_tag

The product tag of the Material instance.

Type:

fortnite_api.ProductTag

images

Represents some images of the Material instance, as they are rendered in game.

Type:

fortnite_api.MaterialInstanceImages

colors

Holds some metadata about the colors of the Material instance, such as the background color A and B, if it exists.

Type:

Optional[fortnite_api.MaterialInstanceColors]

scalings

Some information about the scalings of the Material instance. This is a low level Unreal Engine 5 information dump that is not commonly used, but is available for those who need it. It can contain information about the material background, density, zoom, streak multipliers, and spotlights.

Type:

dict

flags

Any flags on the material instance.

Warning

This is always an empty dict, as there are no flags used at this time.

Type:

dict

class fortnite_api.NewDisplayAsset(*, data, http)

Represents a new display asset for a shop entry. A display asset is an asset that is used to visually represent a cosmetic item in the shop. This class inherits from ReconstructAble and Hashable.

id

The ID of the display asset.

Type:

str

cosmetic_id

The ID of the cosmetic item associated with the display asset, if any.

Type:

Optional[str]

material_instances

A list of material instances used by the display asset.

Type:

List[fortnite_api.MaterialInstance]

render_images

A list of render images used by the display asset.

Type:

List[fortnite_api.RenderImage]

.. versionchanged:: v3.1.0

Renamed from ShopEntryNewDisplayAsset to a more generic NewDisplayAsset to better reflect its usage across the API.

class fortnite_api.News(*, data, http)
Attributes

Represents Game News. This class contains information on both Battle Royale and Save the World news.

This class inherits from ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

br

A list of Battle Royale news.

Type:

List[fortnite_api.GameModeNews]

stw

A list of Save the World news.

Type:

List[fortnite_api.GameModeNews]

class fortnite_api.GameModeNews(*, data, http)

Represents News of a specific game mode. This class is handed out from the News class.

This inherits from ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

hash

The hash of the news.

Type:

str

date

The date when the news was published.

Type:

datetime.datetime

image

The display image of the news, if available.

Type:

Optional[fortnite_api.Asset]

motds

A list of Message of the Day (MOTD) for the game mode.

Type:

List[fortnite_api.NewsMotd]

messages

A list of messages for the game mode.

Type:

List[fortnite_api.NewsMessage]

class fortnite_api.NewsMotd(*, data, http)

An object that represents a Message of The Day in a specific game mode. This class gets handed out from the GameModeNews.

This class inherits from Hashable and ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

id

The id of the motd.

Type:

str

title

The title of the motd.

Type:

str

tab_title

The tab title of the motd.

Type:

str

body

The body of the motd.

Type:

Optional[str]

image

The asset of the image that represents this news.

Type:

Asset

title_image

The asset of the title image that represents this news.

Type:

str

hidden

Whether the motd is hidden or not.

Type:

bool

class fortnite_api.NewsMessage(*, data, http)
Attributes

Represents a message in the news in a specific game mode. This class gets handed out by GameModeNews.

This inherits from ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

title

The title of the message.

Type:

str

body

The body contents of the message.

Type:

str

image

An image that is associated with the message.

Type:

Asset

adspace

The adspace of the message.

Type:

Optional[str]

class fortnite_api.PlaylistImages(*, data, http)
Attributes

Represents images that are associated with a Fortnite Playlist. This class inherits from ReconstructAble.

showcase

A showcase image for the playlist, if any.

Type:

Optional[fortnite_api.Asset]

mission_icon

A mission icon for the playlist, if any.

Type:

Optional[fortnite_api.Asset]

class fortnite_api.Playlist(*, data, http)

Represents a Fortnite Playlist. This class inherits from Hashable and ReconstructAble.

id

The ID of the playlist.

Type:

str

name

The playlist’s name.

Type:

str

sub_name

The playlist’s sub name, if any.

Type:

Optional[str]

description

A description of the playlist.

Type:

Optional[str]

game_type

The type of game the playlist is, if any.

Type:

Optional[str]

rating_type

The rating type of the playlist, if any.

Type:

Optional[str]

min_players

The minimum amount of players required. Will be -1 if there is no limit.

Type:

int

max_players

The maximum amount of players allowed. Will be -1 if there is no limit.

Type:

int

max_teams

The maximum amount of teams allowed. Will be -1 if there is no limit.

Type:

int

max_team_size

The maximum amount of players per team. Will be -1 if there is no limit.

Type:

int

max_squads

The maximum amount of squads allowed. Will be -1 if there is no limit.

Type:

int

max_squad_size

The maximum amount of players per squad. Will be -1 if there is no limit.

Type:

int

is_default

Whether the playlist is the default one.

Type:

bool

is_tournament

Whether this playlist is a tournament.

Type:

bool

is_limited_time_mode

Whether this playlist is a limited time mode.

Type:

bool

is_large_team_game

Whether this playlist is a large team game.

Type:

bool

accumulate_to_profile_stats

Whether this playlist accumulates to profile stats.

Type:

bool

images

The images associated with the playlist.

Type:

Optional[fortnite_api.PlaylistImages]

gameplay_tags

The gameplay tags for the playlist.

Type:

List[str]

path

The path of the playlist.

Type:

str

added

The time the playlist was added.

Type:

datetime.datetime

class fortnite_api.ShopEntryOfferTag(*, data, http)
Attributes

Represents a shop entry offer tag. This class inherits from ReconstructAble.

id

The ID of the offer tag.

Type:

str

text

The text of the offer tag.

Type:

str

class fortnite_api.ShopEntryBundle(*, data, http)
Attributes

Represents a shop entry bundle. This class inherits from ReconstructAble.

name

The name of the bundle.

Type:

str

info

The information of the bundle.

Type:

str

image

The image of the bundle.

Type:

fortnite_api.Asset

class fortnite_api.ShopEntryBanner(*, data, http)

A class to represent a shop entry banner. This class inherits from ReconstructAble.

value

The text of the banner.

Type:

str

intensity

The intensity of the banner.

Type:

fortnite_api.BannerIntensity

backend_value

The backend value of the banner.

Type:

str

class fortnite_api.ShopEntryLayout(*, data, http)

Represents the layout of a shop entry. This class inherits from ReconstructAble.

id

The ID of the layout.

Type:

str

name

The name of the layout.

Type:

str

category

The category of the layout, if any.

Type:

Optional[str]

index

The index of the layout.

Type:

int

rank

The rank of the layout used for sorting.

Type:

int

show_ineligible_offers

Whether ineligible offers are displayed in the layout or not.

Type:

str

background

The background asset of the layout, if any.

Type:

Optional[fortnite_api.Asset]

use_wide_preview

Whether the layout uses a wide preview or not.

Type:

bool

display_type

The display type of the layout, if any specified.

Type:

Optional[str]

class fortnite_api.ShopEntryColors(*, data, http)

Represents the colors of a shop entry. This class inherits from ReconstructAble.

color1

The first color of background gradient.

Type:

str

color2

The second color of background gradient. If not present, the gradient only consists of two colors.

Type:

Optional[str]

color3

The third color of background gradient.

Type:

str

text_background_color

The fade out overlaying gradient color on which the text is displayed.

Type:

Optional[str]

class fortnite_api.ShopEntry(*, data, http)

Represents an item shop entry. Each entry in the shop contains related cosmetics that are available in the shop. This class inherits from ReconstructAble.

len(x)

Returns the total amount of cosmetics in this entry.

shop = await client.fetch_shop()
for entry in shop.entries:
    print(f'Entry has {len(entry)} cosmetics.')
iter(x)

Returns an iterator of the cosmetics, working through one unique cosmetic type before continuing onto the next. Works in the following order: CosmeticBr, CosmeticTrack, CosmeticInstrument, CosmeticCar, CosmeticLegoKit.

shop = await client.fetch_shop()
for entry in shop.entries:
    for cosmetic in entry:
        print(cosmetic.id, cosmetic.type)
regular_price

The regular price of the entry.

Type:

int

final_price

The final price of the entry. This is in case it is on sale.

Type:

int

in_date

The date when this entry was added to the shop.

Type:

datetime.datetime

out_date

The date when this entry will be removed from the shop.

Type:

datetime.datetime

offer_tag

The offer tag of this entry, if any.

Type:

Optional[fortnite_api.ShopEntryOfferTag]

bundle

The bundle that this entry belongs to, if any.

Type:

Optional[fortnite_api.ShopEntryBundle]

banner

The banner information for this shop entry, if any.

Type:

Optional[fortnite_api.ShopEntryBanner]

giftable

Whether this entry is able to be gifted.

Type:

bool

refundable

Whether this entry is refundable.

Type:

bool

sort_priority

The sort priority of this entry.

Type:

int

layout_id

The layout ID of this entry.

Type:

str

layout

The layout of this entry, if any.

Type:

Optional[fortnite_api.ShopEntryLayout]

dev_name

The internal dev name of this entry.

Type:

str

offer_id

The offer ID of this entry.

Type:

str

display_asset_path

The display asset path of this entry.

Type:

Optional[str]

tile_size

The tile size of this entry.

Type:

fortnite_api.TileSize

new_display_asset_path

The new display asset path of this entry.

Type:

Optional[str]

new_display_asset

The new display asset of this entry.

Type:

fortnite_api.NewDisplayAsset

colors

The colors of this entry.

Type:

fortnite_api.ShopEntryColors

br

The Battle Royale cosmetics in this entry.

Type:

List[fortnite_api.CosmeticBr]

tracks

The tracks in this entry.

Type:

List[fortnite_api.CosmeticTrack]

instruments

The instruments in this entry.

Type:

List[fortnite_api.CosmeticInstrument]

cars

The cars in this entry.

Type:

List[fortnite_api.CosmeticCar]

lego_kits

The LEGO kits in this entry.

Type:

List[fortnite_api.CosmeticLegoKit]

class fortnite_api.Shop(*, data, http)

Represents the Fortnite shop.

hash

A unique hash that represents this shop.

Type:

str

date

The date when this shop was last updated.

Type:

datetime.datetime

vbuck_icon

An asset of the V-Buck icon.

Type:

fortnite_api.Asset

entries

A list of shop entries. Each entry contains cosmetics that are available in the shop.

Type:

List[fortnite_api.ShopEntry]

class fortnite_api.TileSize(*, width, height, internal)
Attributes
Methods

Represents the size of a tile in the shop.

x == y

Checks if two tile sizes are equal.

x != y

Checks if two tile sizes are not equal.

Parameters:
  • width (int) – The width of the tile.

  • height (int) – The height of the tile.

  • internal (str) – The internal representation of the tile size. This can be the default Epic API value in the format Size_<width>_x_<height>.

width

The width of the tile. This value will be -1 if the tile size is invalid.

Type:

int

height

The height of the tile. This value will be -1 if the tile size is invalid.

Type:

int

internal

The internal representation of the tile size. This can be the default Epic API value in the format Size_<width>_x_<height>.

Type:

str

classmethod from_value(value, /)

Constructs a tile size from the value provided by the API. This method parses the passed value and ensures that it is in the correct format, Size_<width>_x_<height>. It has been exposed in the case that the user wants to construct a tile size from a custom value.

If an invalid value is passed, the tile size defaults to a width and height of -1.

Parameters:

value (str) – The value to parse.

Returns:

The constructed tile size.

Return type:

TileSize

class fortnite_api.BrPlayerStats(*, data, http)

Represents a Fortnite Battle Royale player’s stats. This class inherits from ReconstructAble.

Examples

Fetching a player’s total wins in the solo game mode across all input types.
# It's helpful to compute the data in a helper function, as many attributes
# will be ``None`` if the player has no stats in a given game mode or input type.
def get_total_wins(stats: fortnite_api.BrPlayerStats) -> int:
    # Get the stats for all input types.
    all_inputs = stats.inputs and stats.inputs.all
    if all_inputs is None:
        # This player has no stats.
        return 0

    # Get the stats for the solo game mode.
    solo = all_inputs.solo
    if solo is None:
        # This player has never played solos.
        return 0

    # Return the total number of wins in the solo game mode.
    return solo.wins

# Fetch the player's stats.
stats = await fortnite_api_client.fetch_br_stats(name="<username>")

# Compute the total wins.
total_wins = get_total_wins(stats)

# And print out the result.
print(f'{stats.user.name} has {total_wins} total wins in the solo game mode across all platforms.')
user

The account of the player whose stats are being represented.

Type:

fortnite_api.Account

battle_pass

The player’s battle pass level and progress, if available.

Type:

Optional[fortnite_api.BrBattlePass]

image

The requested statistics image, if requested.

Type:

Optional[fortnite_api.Asset]

inputs

The player’s stats for all input types. This is None if the player has no stats.

Type:

Optional[fortnite_api.BrInputs]

class fortnite_api.BrBattlePass(*, data, http)
Attributes

Represents a Fortnite Battle Royale player’s battle pass level and progress. This class inherits from ReconstructAble.

level

The player’s battle pass level.

Type:

int

progress

The progress through the current battle pass.

Type:

int

class fortnite_api.BrInputs(*, data, http)

Represents a Fortnite player’s stats for all input types. This class inherits from ReconstructAble.

Each input type has its own stats, which can be accessed through the attributes. Additionally, there is an all attribute which represents the player’s stats for all inputs. If the player has no stats for a specific input type, the attribute will be None. If the player has no stats at all, the all attribute will be None.

all

The player’s stats for all input types. This is None if the player has no stats.

Type:

Optional[BrInputStats]

keyboard_mouse

The player’s stats for keyboard and mouse input. This is None if the player has no stats.

Type:

Optional[BrInputStats]

gamepad

The player’s stats for gamepad input. This is None if the player has no stats.

Type:

Optional[BrInputStats]

touch

The player’s stats for touch input. This is None if the player has no stats.

Type:

Optional[BrInputStats]

class fortnite_api.BrInputStats(*, data, http)
Attributes

Represents a specific Fortnite player’s stats for a specific input type. This class inherits from ReconstructAble.

overall

The overall stats for the player. This is None if the overall stats are not available.

Type:

Optional[BrGameModeStats]

solo

The player’s stats for solo game modes. This is None if the player has no stats for solo game modes.

Type:

Optional[BrGameModeStats]

duo

The player’s stats for duo game modes. This is None if the player has no stats for duo game modes.

Type:

Optional[BrGameModeStats]

squad

The player’s stats for squad game modes. This is None if the player has no stats for squad game modes.

Type:

Optional[BrGameModeStats]

class fortnite_api.BrGameModeStats(*, data, http)

Represents the specific stats for a Fortnite player in a specific game mode on a specific input type. This class inherits from ReconstructAble.

score

The total score for the stats for a specific game mode.

Type:

int

score_per_min

The score per minute for the stats for a specific game mode. This is the score divided by the minutes played.

Type:

float

score_per_match

The score per match for the stats for a specific game mode. This is the score divided by the matches played.

Type:

float

wins

The total number of wins in this specific game mode.

Type:

int

top3

The number of times the player has placed in the top 3 (10 players left remaining) in this specific game mode. This is only available when the game mode for these stats is a fortnite_api.BrInputStats.squad game mode or fortnite_api.BrInputStats.overall.

Type:

Optional[int]

top5

The number of times the player has placed in the top 5 (10 players left remaining) in this specific game mode. This is only available when the game mode for these stats is a fortnite_api.BrInputStats.duo game mode or fortnite_api.BrInputStats.overall.

Type:

Optional[int]

top6

The number of times the player has placed in the top 6 (25 players left remaining) in this specific game mode. This is only available when the game mode for these stats is a fortnite_api.BrInputStats.squad game mode or fortnite_api.BrInputStats.overall.

Type:

Optional[int]

top10

The number of times the player has placed in the top 10 (10 players left remaining) in this specific game mode. This is only available when the game mode for these stats is a fortnite_api.BrInputStats.solo game mode or fortnite_api.BrInputStats.overall.

Type:

Optional[int]

top12

The number of times the player has placed in the top 12 (25 players left remaining) in this specific game mode. This is only available when the game mode for these stats is a fortnite_api.BrInputStats.duo game mode or fortnite_api.BrInputStats.overall.

Type:

Optional[int]

top25

The number of times the player has placed in the top 25 (25 players left remaining) in this specific game mode. This is only available when the game mode for these stats is a fortnite_api.BrInputStats.solo game mode or fortnite_api.BrInputStats.overall.

Type:

Optional[int]

kills

The total number of kills in this specific game mode.

Type:

int

kills_per_min

The kills per minute for the stats for a specific game mode. This is the kills divided by the minutes played.

Type:

float

kills_per_match

The kills per match for the stats for a specific game mode. This is the kills divided by the matches played.

Type:

float

deaths

The total number of deaths in this specific game mode.

Type:

int

kd

The kill/death ratio for this specific game mode. This is the kills divided by the deaths.

Type:

float

matches

The total number of matches played in this specific game mode.

Type:

int

win_rate

The win rate for this specific game mode. This is the wins divided by the matches played.

Type:

float

minutes_played

The total number of minutes played in this specific game mode.

Type:

int

players_outlived

The total number of players outlived in this specific game mode.

Type:

int

last_modified

The date when this stat data was last updated within the Epic Games API.

Type:

datetime.datetime

Cosmetic Objects

class fortnite_api.Cosmetic(*, data, http)
Attributes

Represents a base cosmetic. Every cosmetic type inherits from this class and adds additional attributes. View documentation for the specific cosmetic type for more information.

This class inherits from Hashable and ReconstructAble.

id

The ID of the cosmetic.

Type:

str

added

When the cosmetic was added.

Type:

datetime.datetime

class fortnite_api.CosmeticTypeInfo(*, data, http)

A class that holds cosmetic type information passed from the API for a given Cosmetic.

This class inherits from ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

value

The value of the cosmetic type.

Type:

fortnite_api.CosmeticType

raw_value

The raw value of the cosmetic type. This value is used to construct the value attribute, but, is exposed through this attribute due to how commonly it is used.

Type:

str

display_value

The display value of the cosmetic type. This is the value that is displayed to the user.

Type:

str

backend_value

The internal marker of the cosmetic type.

Type:

str

class fortnite_api.CosmeticRarityInfo(*, data, http)

Represents a cosmetic rarity. This class is used to hold information about the rarity of a cosmetic.

This class inherits from ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

value

The rarity of the cosmetic.

Type:

fortnite_api.CosmeticRarity

display_value

The display value of the cosmetic rarity. This is the value that is displayed to the user.

Type:

str

backend_value

The internal marker of the cosmetic rarity.

Type:

str

class fortnite_api.CosmeticSeriesInfo(*, data, http)

Represents information about the series a Cosmetic belongs to. This class inherits from ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

value

The value of the cosmetic series.

Type:

str

backend_value

The internal marker of the cosmetic series.

Type:

str

image

The image of the cosmetic series. Will be None if the cosmetic series has no image.

Type:

Optional[fortnite_api.Asset]

colors

A list of colors that are associated with the cosmetic series.

Type:

List[str]

class fortnite_api.CosmeticImages(*, data, http)

Represents the images of a cosmetic.

This inherits from fortnite_api.Images.

repr(x)

Returns a representation of the account in the form of a string.

featured

The featured image of the cosmetic, if available. Typically available off of fortnite_api.CosmeticBr objects.

Type:

Optional[fortnite_api.Asset]

lego

The LEGO image of the cosmetic, if available. Typically available off of fortnite_api.CosmeticBr objects.

Type:

Optional[fortnite_api.Asset]

bean

The bean image of the cosmetic, if available. Typically available off of fortnite_api.CosmeticBr objects.

Type:

Optional[fortnite_api.Asset]

small

The small image of the cosmetic. Typically available off of fortnite_api.CosmeticInstrument, fortnite_api.CosmeticCar, fortnite_api.CosmeticLegoKit, and fortnite_api.VariantLego objects.

Type:

Optional[fortnite_api.Asset]

large

The large image of the cosmetic. Typically available off of fortnite_api.CosmeticInstrument, fortnite_api.CosmeticCar, fortnite_api.CosmeticLegoKit, and fortnite_api.VariantLego objects.

Type:

Optional[fortnite_api.Asset]

wide

The wide image of the cosmetic. Typically available off of fortnite_api.VariantLego objects.

Type:

Optional[fortnite_api.Asset]

property background

The background image of the cosmetic, if available.

Type:

Optional[Asset]

property coverart

The cover art image of the cosmetic, if available.

Type:

Optional[Asset]

property decal

The decal image of the cosmetic, if available.

Type:

Optional[Asset]

class fortnite_api.CosmeticBrSet(*, data, http)
Attributes

Represents a set that a given cosmetic belongs to. This class inherits from fortnite_api.ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

value

The value of the set, also known as the name, if available.

Type:

Optional[str]

text

The display text of this set. In the form, "Part of the {{value}} set."

Type:

str

backend_value

The backend value of this set.

Type:

str

class fortnite_api.CosmeticBrIntroduction(*, data, http)

Holds some metadata about when a cosmetic was introduced. This class inherits from fortnite_api.ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

chapter

The chapter the cosmetic was introduced in.

Type:

int

season

The season the cosmetic was introduced in. Can be “OG” if the cosmetic was introduced before seasons.

Type:

str

text

The display text of this introduction. In the form, "Introduced in Chapter {{chapter}}, Season {{season}}."

Type:

str

backend_value

The backend value of this introduction.

Type:

int

class fortnite_api.CosmeticBrVariant(*, data, http)
Attributes

Represents a variant for a cosmetic. This class inherits from fortnite_api.ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

channel

The channel of the variant.

Type:

str

type

The type of the variant.

Type:

Optional[str]

options

The options for the variant, if any.

Type:

List[fortnite_api.CosmeticBrVariantOption]

class fortnite_api.CosmeticBrVariantOption(*, data, http)

Represents a variant option for a cosmetic. This class inherits from fortnite_api.ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

tag

The tag of the variant option.

Type:

str

name

The option’s name.

Type:

Optional[str]

unlock_requirements

The unlock requirements of the variant option, if available.

Type:

Optional[str]

image

The image of the variant option.

Type:

fortnite_api.Asset

class fortnite_api.CosmeticBr(*, data, http)

Represents a Battle Royale cosmetic.

This class inherits from fortnite_api.Cosmetic.

repr(x)

Returns a representation of the account in the form of a string.

name

The name of the cosmetic.

Type:

str

description

The description of the cosmetic.

Type:

str

exclusive_description

The exclusive description of the cosmetic, if available.

Type:

Optional[str]

unlock_requirements

The unlock requirements of the cosmetic, if available.

Type:

Optional[str]

custom_exclusive_callout

The custom exclusive callout of the cosmetic, if available.

Type:

Optional[str]

type

The type of the cosmetic.

Type:

Optional[fortnite_api.CosmeticTypeInfo]

rarity

The cosmetic’s rarity.

Type:

Optional[fortnite_api.CosmeticRarityInfo]

series

The series of the cosmetic, if any.

Type:

Optional[fortnite_api.CosmeticSeriesInfo]

set

The set that the cosmetic belongs to, if any.

Type:

Optional[fortnite_api.CosmeticBrSet]

introduction

Metadata about when the cosmetic was introduced, if available.

Type:

Optional[fortnite_api.CosmeticBrIntroduction]

images

The images of the cosmetic.

Type:

Optional[fortnite_api.CosmeticImages]

variants

The variants of the cosmetic, if any.

Type:

List[fortnite_api.CosmeticBrVariant]

built_in_emote_ids

The built-in emote IDs of the cosmetic.

Type:

List[str]

search_tags

The search tags of the cosmetic.

Type:

List[str]

gameplay_tags

The gameplay tags of the cosmetic.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_GAMEPLAY_TAGS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

List[str]

meta_tags

The meta tags of the cosmetic.

Type:

List[str]

showcase_video_id

The showcase YouTube video ID of the cosmetic, if available.

Type:

Optional[str]

dynamic_pak_id

The dynamic pak ID of the cosmetic, if available.

Type:

Optional[str]

item_preview_hero_path

The item preview hero path of the cosmetic, if available.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_PATHS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

Optional[str]

display_asset_path

The display asset path of the cosmetic, if available.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_PATHS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

Optional[str]

definition_path

The definition path of the cosmetic, if available.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_PATHS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

Optional[str]

path

The path of the cosmetic, if available.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_PATHS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

Optional[str]

shop_history

The shop history of the cosmetic.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_SHOP_HISTORY flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

List[datetime.datetime]

property showcase_video_url

The URL of the YouTube showcase video of the cosmetic, if any.

Type:

Optional[str]

classmethod from_dict(data, *, client)

Reconstructs this class from a raw dictionary object. This is useful for when you store the raw data and want to reconstruct the object later on.

Parameters:
  • data (Dict[Any, Any]) – The raw data to reconstruct the object from.

  • client (Union[fortnite_api.Client, fortnite_api.SyncClient]) – The currently used client to reconstruct the object with. Can either be a sync or async client.

to_dict()

Turns this object into a raw dictionary object. This is useful for when you want to store the raw data and reconstruct the object later on.

Returns:

The raw data of this object. Note that this is a deep copy of the raw data, and not a reference to the underlying raw data this object was constructed with.

Return type:

Dict[Any, Any]

class fortnite_api.CosmeticCar(*, data, http)

Represents a car cosmetic in Fortnite.

This class inherits from fortnite_api.Cosmetic.

repr(x)

Returns a representation of the account in the form of a string.

vehicle_id

The ID of the vehicle.

Type:

str

name

The name of the car.

Type:

str

description

The description of the car.

Type:

str

type

The type of the car.

Type:

Optional[fortnite_api.CosmeticTypeInfo]

rarity

The rarity of the car.

Type:

Optional[fortnite_api.CosmeticRarityInfo]

images

Any car images.

Type:

Optional[fortnite_api.CosmeticImages]

series

The series of the car.

Type:

Optional[fortnite_api.CosmeticSeriesInfo]

gameplay_tags

The gameplay tags of the car.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_GAMEPLAY_TAGS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

List[str]

path

The path of the car.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_PATHS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

Optional[str]

showcase_video_id

The showcase YouTube video ID of the cosmetic, if available.

Type:

Optional[str]

shop_history

A list of datetimes representing the shop history of the car.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_SHOP_HISTORY flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

List[datetime.datetime]

property showcase_video_url

The URL of the YouTube showcase video of the cosmetic, if any.

Type:

Optional[str]

classmethod from_dict(data, *, client)

Reconstructs this class from a raw dictionary object. This is useful for when you store the raw data and want to reconstruct the object later on.

Parameters:
  • data (Dict[Any, Any]) – The raw data to reconstruct the object from.

  • client (Union[fortnite_api.Client, fortnite_api.SyncClient]) – The currently used client to reconstruct the object with. Can either be a sync or async client.

to_dict()

Turns this object into a raw dictionary object. This is useful for when you want to store the raw data and reconstruct the object later on.

Returns:

The raw data of this object. Note that this is a deep copy of the raw data, and not a reference to the underlying raw data this object was constructed with.

Return type:

Dict[Any, Any]

class fortnite_api.CosmeticInstrument(*, data, http)

Represents an instrument cosmetic in Fortnite.

This class inherits from fortnite_api.Cosmetic.

repr(x)

Returns a representation of the account in the form of a string.

name

The name of the instrument.

Type:

str

description

The description of the instrument.

Type:

str

type

The type of the instrument.

Type:

Optional[fortnite_api.CosmeticTypeInfo]

rarity

The rarity of the instrument.

Type:

Optional[fortnite_api.CosmeticRarityInfo]

images

Any instrument images.

Type:

Optional[fortnite_api.CosmeticImages]

series

The series of the instrument.

Type:

Optional[fortnite_api.CosmeticSeriesInfo]

gameplay_tags

The gameplay tags of the instrument.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_GAMEPLAY_TAGS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

List[str]

path

The path of the instrument.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_PATHS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

Optional[str]

showcase_video_id

The showcase YouTube video ID of the cosmetic, if available.

Type:

Optional[str]

shop_history

The shop history of the instrument.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_SHOP_HISTORY flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

List[datetime.datetime]

property showcase_video_url

The URL of the YouTube showcase video of the cosmetic, if any.

Type:

Optional[str]

classmethod from_dict(data, *, client)

Reconstructs this class from a raw dictionary object. This is useful for when you store the raw data and want to reconstruct the object later on.

Parameters:
  • data (Dict[Any, Any]) – The raw data to reconstruct the object from.

  • client (Union[fortnite_api.Client, fortnite_api.SyncClient]) – The currently used client to reconstruct the object with. Can either be a sync or async client.

to_dict()

Turns this object into a raw dictionary object. This is useful for when you want to store the raw data and reconstruct the object later on.

Returns:

The raw data of this object. Note that this is a deep copy of the raw data, and not a reference to the underlying raw data this object was constructed with.

Return type:

Dict[Any, Any]

class fortnite_api.CosmeticLegoKit(*, data, http)

Represents a LEGO kit cosmetic in Fortnite.

This class inherits from fortnite_api.Cosmetic.

repr(x)

Returns a representation of the account in the form of a string.

name

The name of the LEGO kit.

Type:

str

type

The type of the LEGO kit.

Type:

Optional[fortnite_api.CosmeticTypeInfo]

gameplay_tags

The gameplay tags of the LEGO kit.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_GAMEPLAY_TAGS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

List[str]

images

Any LEGO kit images.

Type:

Optional[fortnite_api.CosmeticImages]

path

The path of the LEGO kit.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_PATHS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

Optional[str]

shop_history

The shop history of the LEGO kit.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_SHOP_HISTORY flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

List[datetime.datetime]

classmethod from_dict(data, *, client)

Reconstructs this class from a raw dictionary object. This is useful for when you store the raw data and want to reconstruct the object later on.

Parameters:
  • data (Dict[Any, Any]) – The raw data to reconstruct the object from.

  • client (Union[fortnite_api.Client, fortnite_api.SyncClient]) – The currently used client to reconstruct the object with. Can either be a sync or async client.

to_dict()

Turns this object into a raw dictionary object. This is useful for when you want to store the raw data and reconstruct the object later on.

Returns:

The raw data of this object. Note that this is a deep copy of the raw data, and not a reference to the underlying raw data this object was constructed with.

Return type:

Dict[Any, Any]

class fortnite_api.CosmeticTrackDifficulty(*, data, http)

Represents the difficulty of a track cosmetic in Fortnite. This class inherits from fortnite_api.ReconstructAble.

repr(x)

Returns a representation of the account in the form of a string.

vocals

The vocals difficulty of the track.

Type:

int

guitar

The guitar difficulty of the track.

Type:

int

bass

The bass difficulty of the track.

Type:

int

plastic_bass

The plastic bass difficulty of the track.

Type:

int

drums

The drums difficulty of the track.

Type:

int

plastic_drums

The plastic drums difficulty of the track.

Type:

int

class fortnite_api.CosmeticTrack(*, data, http)

Represents a track cosmetic in Fortnite.

This class inherits from fortnite_api.Cosmetic.

repr(x)

Returns a representation of the account in the form of a string.

dev_name

The developer name of the track.

Type:

str

title

The title of the track.

Type:

str

artist

The artist of the track.

Type:

str

album

The album of the track.

Type:

Optional[str]

release_year

The release year of the track.

Type:

int

bpm

The BPM of the track.

Type:

int

duration

The duration of the track, in seconds.

Type:

int

difficulty

The difficulty of the track.

Type:

fortnite_api.CosmeticTrackDifficulty

gameplay_tags

The gameplay tags of the track.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_GAMEPLAY_TAGS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

List[str]

genres

The genres of the track.

Type:

List[str]

album_art

The album art of the track.

Type:

fortnite_api.Asset

shop_history

The shop history of the track.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_SHOP_HISTORY flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

List[datetime.datetime]

classmethod from_dict(data, *, client)

Reconstructs this class from a raw dictionary object. This is useful for when you store the raw data and want to reconstruct the object later on.

Parameters:
  • data (Dict[Any, Any]) – The raw data to reconstruct the object from.

  • client (Union[fortnite_api.Client, fortnite_api.SyncClient]) – The currently used client to reconstruct the object with. Can either be a sync or async client.

to_dict()

Turns this object into a raw dictionary object. This is useful for when you want to store the raw data and reconstruct the object later on.

Returns:

The raw data of this object. Note that this is a deep copy of the raw data, and not a reference to the underlying raw data this object was constructed with.

Return type:

Dict[Any, Any]

Cosmetic Variants

class fortnite_api.VariantLego(*, data, http)

Represents a Lego cosmetic variant.

This class inherits from fortnite_api.Cosmetic.

repr(x)

Returns a representation of the account in the form of a string.

cosmetic_id

The ID of the cosmetic that this lego cosmetic variant is based on.

Type:

str

sound_library_tags

The sound library tags of the lego cosmetic variant.

Type:

List[str]

images

The images of the lego cosmetic variant.

Type:

Optional[fortnite_api.CosmeticImages]

path

The path of the lego cosmetic variant. Will be None if the API response does not contain a path.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_PATHS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

Optional[str]

classmethod from_dict(data, *, client)

Reconstructs this class from a raw dictionary object. This is useful for when you store the raw data and want to reconstruct the object later on.

Parameters:
  • data (Dict[Any, Any]) – The raw data to reconstruct the object from.

  • client (Union[fortnite_api.Client, fortnite_api.SyncClient]) – The currently used client to reconstruct the object with. Can either be a sync or async client.

to_dict()

Turns this object into a raw dictionary object. This is useful for when you want to store the raw data and reconstruct the object later on.

Returns:

The raw data of this object. Note that this is a deep copy of the raw data, and not a reference to the underlying raw data this object was constructed with.

Return type:

Dict[Any, Any]

fetch_cosmetic_br(*, language=None)

This function is a coroutine.

Fetches the Battle Royale cosmetic that this lego cosmetic variant is based on.

Parameters:

language (Optional[fortnite_api.GameLanguage]) – The language to fetch the cosmetic in.

Returns:

The Battle Royale cosmetic that this lego cosmetic variant is based on.

Return type:

fortnite_api.CosmeticBr

class fortnite_api.VariantBean(*, data, http)

This class represents the Bean variant of a cosmetic item. This stems from the Fortnite x Fall Guys collaboration, where Fortnite cosmetics were transformed into Fall Guys beans.

This class inherits from fortnite_api.Cosmetic.

cosmetic_id

The ID of the cosmetic that this bean represents, if any.

Type:

Optional[str]

name

The name of this bean.

Type:

str

gender

Denotes the gender of this bean.

Type:

fortnite_api.CustomGender

gameplay_tags

The gameplay tags associated with this bean.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_GAMEPLAY_TAGS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

List[str]

images

Any display images of this bean in the game. Will be None if there are no images.

Type:

Optional[fortnite_api.CosmeticImages]

path

The game path of this bean. Will be None if there is no path in the API response.

Important

This attribute is opt-in, meaning it will be unavailable by default. You must enable the INCLUDE_PATHS flag on the client to have access to this attribute.

See the response flags documentation for more information on what response flags are and how to use them.

Type:

Optional[str]

classmethod from_dict(data, *, client)

Reconstructs this class from a raw dictionary object. This is useful for when you store the raw data and want to reconstruct the object later on.

Parameters:
  • data (Dict[Any, Any]) – The raw data to reconstruct the object from.

  • client (Union[fortnite_api.Client, fortnite_api.SyncClient]) – The currently used client to reconstruct the object with. Can either be a sync or async client.

to_dict()

Turns this object into a raw dictionary object. This is useful for when you want to store the raw data and reconstruct the object later on.

Returns:

The raw data of this object. Note that this is a deep copy of the raw data, and not a reference to the underlying raw data this object was constructed with.

Return type:

Dict[Any, Any]

fetch_cosmetic_br(*, language=None)

This function is a coroutine.

Fetches the Battle Royale cosmetic that this bean variant is based on.

Parameters:

language (Optional[fortnite_api.GameLanguage]) – The language to fetch the cosmetic in.

Returns:

The Battle Royale cosmetic that this bean variant is based on.

Return type:

fortnite_api.CosmeticBr

Raises:

ValueError – The bean variant does not have a corresponding Battle Royale cosmetic. I.e. :attr`cosmetic_id` is None.

Flags

class fortnite_api.ResponseFlags(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Denotes a “response flag” in the Fortnite API. These are toggle-able options that denote how a response from the API should be formatted and which data should be included.

INCLUDE_NOTHING

Include nothing special in the response. This will only include standard data in all responses, ie, any data fields in this class prefixed with INCLUDE_.

Type:

int

INCLUDE_PATHS

Denotes if the response should include the paths field in the response, if the endpoint contains it.

Type:

int

INCLUDE_GAMEPLAY_TAGS

Denotes if the response should include the gameplay_tags field in the response, if the endpoint contains it.

Type:

int

INCLUDE_SHOP_HISTORY

Denotes if the response should include the shop_history field in the response, if the endpoint contains it.

Type:

int

classmethod all()

ResponseFlags: Returns a flag that includes all flags.

Enumerations

class fortnite_api.KeyFormat(value)

Represents a return format type for the AES endpoint.

HEX

Return the AES keys in hexadecimal format.

BASE64

Return the AES keys in base64 format.

class fortnite_api.GameLanguage(value)

Represents a language that Fortnite supports. This can be used to change the return language of many API calls.

ARABIC

Arabic language.

GERMAN

German language.

ENGLISH

English language.

SPANISH

Spanish language.

SPANISH_LATIN

Latin Spanish language.

FRENCH

French language.

ITALIAN

Italian language.

JAPANESE

Japanese language.

KOREAN

Korean language.

POLISH

Polish language.

PORTUGUESE_BRASIL

Portuguese (Brasil) language.

RUSSIAN

Russian language.

TURKISH

Turkish language.

CHINESE_SIMPLIFIED

Simplified Chinese language.

CHINESE_TRADITIONAL

Traditional Chinese language.

class fortnite_api.MatchMethod(value)

Represents a string matching method for some search methods in the API.

FULL

Match the full string.

CONTAINS

Match if the string contains the search string.

STARTS

Match if the string starts with the search string.

ENDS

Match if the string ends with the search string.

class fortnite_api.CosmeticCategory(value)

Represents the internal names for the types of a cosmetics in Fortnite.

BR

Type of a fortnite_api.CosmeticBr cosmetic.

TRACKS

Type of a fortnite_api.CosmeticTrack cosmetic.

INSTRUMENTS

Type of a fortnite_api.CosmeticInstrument cosmetic.

CARS

Type of a fortnite_api.CosmeticCar cosmetic.

LEGO

Type of a fortnite_api.VariantLego cosmetic variant.

LEGO_KITS

Type of a fortnite_api.CosmeticLegoKit cosmetic.

BEANS

Type of a fortnite_api.VariantBean cosmetic variant.

class fortnite_api.CosmeticRarity(value)

Represents a rarity of a Cosmetic object.

FROZEN
LAVA
LEGENDARY
GAMING_LEGENDS
DARK
STARWARS
MARVEL
DC
ICON_SERIES
SHADOW
SLURP
EPIC
LAMBORGHINI
RARE
UNCOMMON
COMMON
class fortnite_api.CosmeticType(value)

Represents a type of a fortnite_api.CosmeticBr cosmetic.

OUTFIT
BACKPACK
PET
PET_CARRIER
PICKAXE
SHOES
GLIDER
CONTRAIL
AURA
EMOTE
EMOJI
SPRAY
TOY
WRAP
BANNER
MUSIC
LOADING_SCREEN
GUITAR
BASS
DRUMS
MICROPHONE
KEYTAR
CAR_BODY
DECAL
WHEELS
TRAIL
BOOST
JAM_TRACK
LEGO_BUILD
LEGO_DECOR_BUNDLE
SHOUT
class fortnite_api.AccountType(value)

Represents the type of a fortnite_api.account.Account.

EPIC

Epic Games account.

PSN

PlayStation Network account.

XBL

Xbox Live account.

class fortnite_api.TimeWindow(value)

Represents a time window for statistics in the API.

SEASON

Denotes that the results should only be for the current season.

LIFETIME

Denotes that the results should be for the lifetime of an account.

class fortnite_api.StatsImageType(value)

Represents the type of image that should be returned from the stats image endpoint.

ALL

Return an image that has statistics for all input types.

KEYBOARD_MOUSE

Return an image that has statistics for only keyboard and mouse input types.

GAMEPAD

Return an image that has statistics for only gamepad (controller) input types.

TOUCH

Return an image that has statistics for only touch input types.

NONE

No image should be returned.

class fortnite_api.CosmeticCompatibleMode(value)

A class that represents the compatibility of a cosmetic fortnite_api.MaterialInstance with other modes.

BATTLE_ROYALE

The material instance is compatible with Battle Royale.

LEGO

The material instance is compatible with LEGO.

ROCKET_RACING

The material instance is compatible with Rocket Racing.

FESTIVAL

The material instance is compatible with Festival.

ALL

The material instance is compatible with all modes.

class fortnite_api.BannerIntensity(value)

Denotes the intensity of a fortnite_api.ShopEntryBanner.

LOW

Low intensity.

HIGH

High intensity.

class fortnite_api.CustomGender(value)

Denotes the gender of a character in Fortnite.

At the moment, this is only used on the fortnite_api.VariantBean class.

FEMALE

A female character.

MALE

A male character.

class fortnite_api.ProductTag(value)

A class that represents the tag of a product.

BATTLE_ROYALE

The product is for Battle Royale.

LEGO

The product is for LEGO.

ROCKET_RACING

The product is for Rocket Racing.

FESTIVAL

The product is for Festival.

ALL

The product is for all modes.

Helper Utilities

class fortnite_api.proxies.TransformerListProxy(raw_data, /, transform_data)
Methods

A proxy for a list that allows for half-created type T objects to be stored in the list. This is an internal optimization that allows objects to be created only as-needed when the list is accessed.

This class has been exposed to the documentation because it may be useful for some high level users. However, you can consider this as just a List[T] unless needed otherwise.

It is important to note that this class is not thread-safe, so it should not be accessed concurrently from multiple threads. If you wish to access this class concurrently, you should use a lock to ensure that only one thread is accessing the class at a time.

This class holds the invariant that when any public method is called, the list will be transformed into a list of type T. This means that when the list is accessed, the data will be transformed into the correct type. This is done to ensure that the data is always in a consistent state.

transform_all()

A method that transforms all the data in the list to type T.