Skip to main content

The Python Fortnite API Wrapper

Discord PyPI

Installation

pip install fortnite

Usage

Setup

Obtaining fortnite and launcher tokens
Looking for an asynchronous client? Check out JakeMakesStuff/aiofortnite

from pfaw import Fortnite, Platform, Mode

fortnite = Fortnite(fortnite_token='FORTNITE_TOKEN', launcher_token='LAUNCHER_TOKEN',
                    password='PASSWORD', email='EMAIL')

Player

Return an object containing the attributes name and id.

player = fortnite.player(username='Smitty Werbenjagermanjensen')

print(player.name)
print(player.id)

# prints:
# Smitty Werbenjagermanjensen
# 9c9212603304472d831c03d0978d2bc1

Battle Royale Stats

Creates an object containing various stats for a given player.

stats = fortnite.battle_royale_stats(username='Smitty Werbenjagermanjensen', platform=Platform.pc)

print(f'Solo Wins: {stats.solo.wins}')
print(f'Duo Wins: {stats.duo.wins}')
print(f'Squad Wins: {stats.squad.wins}')
print(f'Lifetime Wins: {stats.all.wins}')


# prints:
# Solo Wins: 1051
# Duo Wins: 1005
# Squad Wins: 210
# Lifetime Wins: 2266

Server Status

Check the status of the Fortnite servers. Return True if up or False if down.

status = fortnite.server_status()

if status:
    print('Servers are UP!')
else:
    print('Servers are DOWN.')

Friends

Return a list of player IDs

smittys_pals = fortnite.friends(username='Smitty Werbenjagermanjensen')

for friend in smittys_pals:
    print(friend)

News

Return an object containing the attributes common, br, and login.

news = fortnite.news()

for br_news in news.br:
    print(br_news.image)
    print(br_news.title)
    print(br_news.body)

Store

store = fortnite.store()

print(store.refresh_interval_hrs)
print(store.daily_purchase_hrs)
print(store.expiration)

for front in store.storefronts:
    print(front.name)

    for entry in front.catalog_entries:
        print(entry.offer_id)
        print(entry.dev_name)
        print(entry.offer_type)
        print(entry.title)
        print(entry.description)
        print(entry.refundable)

        for price in entry.prices:
            print(price.currency_type)
            print(price.regular_price)
            print(price.final_price)
            print(price.sale_expiration)
            print(price.base_price)

Leaderboard

leaderboard = fortnite.leaderboard(count=10, platform=Platform.pc, mode=Mode.solo)

for player in leaderboard:
    print(f'{player.id} - {player.name} - {player.rank} - {player.value}')

# prints:
# 385c4d9ab7e3498db533ff4d2d9f4c5b - twitch_bogdanakh - 1 - 909
# 155234bbadaa4e8199a7b2d413722290 - TwitchTV.lavak3_ - 2 - 805
# c083d2200d654b25a87c0c48cb76c902 - Agares29_Twitch - 3 - 781
# 0041d08bedc548d9a2230c4a28550594 - Myboosting.com2 - 4 - 736
# 6f5c77adef1c4e47bc33f1f0c8b4b263 - Twitch_DutchHawk - 5 - 728
# e94c3e05284443398803285171550b45 - twitchtvLIKANDOO - 6 - 675
# 13b3c77420da4101a213e1f646b316a9 - Twitch APEXENITH - 7 - 675
# b94176db4c254f9099fb2bd8e8ae0f94 - VaxitylolMIXERtv - 8 - 624
# cfd16ec54126497ca57485c1ee1987dc - SypherPK - 9 - 608
# a9467569462d4149bc438550c03a45c9 - RuralKTmixer.com - 10 - 607

Contributors

A thank you to those who have helped out with this project.

Metadata

Release files for fortnite 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fortnite 0.0.8
File Size Uploaded Provenance Actions
fortnite-0.0.8.tar.gz 6.7 kB Without provenance Details for fortnite-0.0.8.tar.gz

Release files / fortnite-0.0.8.tar.gz

Download URL fortnite-0.0.8.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
eead3f9f15162a6dfdd57767aa16109a735d9a91e5a88f85b9a59e8a0c66c578
BLAKE2b-256 checksum
How to use checksums
9dedf6334aee3d0ff43d3b7068dd9dd1f6c79f04dcf4389fff187418ac44e7ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

Security for fortnite 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page