Skip to main content

Asynchronous Python wrapper for Fortnite-API.com.

Project description

FortniteAPIAsync

Python wrapper for Fortnite-API.com.

Downloads Python FortniteAPIAsync Version: 2.0.0 PEP-8 Compliant Last Commit Docs

Installation

# windows
py -3 -m pip install -U FortniteAPIAsync

# linux/macos
python3 -m pip install -U FortniteAPIAsync

Examples

Standard example

import FortniteAPIAsync
import asyncio


async def get_current_aes() -> None:
    client = FortniteAPIAsync.APIClient()
    
    aes = await client.get_aes()
    print(f'AES key for {aes.build} - {aes.main_key}')
    # outputs: AES key for ++Fortnite+Release-39.40-CL-50341043 - 67e127d5c846a0d426be...
    
    await client.close()


asyncio.run(get_current_aes())

rebootpy example

import rebootpy
import FortniteAPIAsync

from rebootpy.ext import commands


bot = commands.Bot(
    command_prefix='!',
    auth=rebootpy.AuthorizationCodeAuth(
        code=input('Enter authorization code: ')
    )
)


@bot.command()
async def skin(ctx: rebootpy.ext.commands.Context, *, content: str) -> None:
    try:
        async with FortniteAPIAsync.APIClient() as client:
            cosmetic = await client.get_cosmetic(
                matchMethod="contains",
                name=content,
                backendType="AthenaCharacter"
            )

        await bot.party.me.set_outfit(asset=cosmetic.id)
        await ctx.send(f'Skin set to {cosmetic.id}.')
    except FortniteAPIAsync.exceptions.NotFound:
        await ctx.send(f"Failed to find a skin with the name: {content}.")


bot.run()

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

fortniteapiasync-2.0.1.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fortniteapiasync-2.0.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file fortniteapiasync-2.0.1.tar.gz.

File metadata

  • Download URL: fortniteapiasync-2.0.1.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for fortniteapiasync-2.0.1.tar.gz
Algorithm Hash digest
SHA256 07a7f2b48471c2cf041a30a6bf7aace204ed2a99648522f64e85ca6eb2c0b5d1
MD5 875eb00655de2c8b88d96d309e666d1a
BLAKE2b-256 ea7ff7368453ecbc47184a5d090e53db56e6b92527c39ad6aeeadbf8536f4471

See more details on using hashes here.

File details

Details for the file fortniteapiasync-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fortniteapiasync-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea63ad4d74b33af73cc1bbde8aa98e0ae7ac872aacac07f740216d4c70dc03d5
MD5 1c9763a5bc9424642097716256fd33e6
BLAKE2b-256 d899dd52a2cd1b1032cc387aa5865041cf43ac0fca07fa0323b4b41488730643

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