Skip to content

xMistt/FortniteAPIAsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

About

Fully Asynchronous Python wrapper for Fortnite-API.com.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages