Sync/Async Python wrapper for Fortnite-API.com
Welcome to the Fortnite API Python wrapper! This library offers a complete async and sync wrapper around the endpoints of Fortnite-API.com
The library's focus is to provide a simple and easy-to-use interface to interact with the API. The library is designed to be as user-friendly as possible, and it is easy to get started with. If you have any questions or need help, feel free to join the official Discord server.
Installation
Note that Python 3.10 or higher is required.
# Linux/macOS
python3 -m pip install fortnite-api
# Windows
py -3 -m pip install fortnite-api
To install the developer version, you can use the following command:
git clone https://github.com/Fortnite-API/py-wrapper
cd py-wrapper
python3 -m pip install .
Optional Dependencies
speed: An optional dependency that installsorjsonfor faster JSON serialization and deserialization.
# Linux/macOS
python3 -m pip install fortnite-api[speed]
# Windows
py -3 -m pip install fortnite-api[speed]
API Key
For most endpoints, you do not need an API key. However, some endpoints, such as fetching statistics, require an API key. To use these endpoints, you need to set the api_key parameter in the constructor.
import asyncio
import fortnite_api
async def main():
async with fortnite_api.Client(api_key="your_api_key") as client:
stats = await client.fetch_br_stats(name='some_username')
print(stats)
if __name__ == "__main__":
asyncio.run(main())
Generating an API Key
You can generate an API key on https://dash.fortnite-api.com/account by logging in with your Discord account.
Quick Example
Asynchronous Example
import asyncio
import fortnite_api
async def main() -> None:
async with fortnite_api.Client() as client:
all_cosmetics: fortnite_api.CosmeticsAll = await client.fetch_cosmetics_all()
for br_cosmetic in all_cosmetics.br:
print(br_cosmetic.name)
if __name__ == "__main__":
asyncio.run(main())
Synchronous Example
import fortnite_api
def main() -> None:
client = fortnite_api.SyncClient()
all_cosmetics: fortnite_api.CosmeticsAll = client.fetch_cosmetics_all()
for br_cosmetic in all_cosmetics.br:
print(br_cosmetic.name)
if __name__ == "__main__":
main()
More examples can be found in the examples/ directory of the repository.
Links
Contribute
Every type of contribution is appreciated.
Licenses
Metadata
Release files for fortnite-api 3.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fortnite_api-3.3.0.tar.gz | 59.1 kB | Without provenance | Details for fortnite_api-3.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fortnite_api-3.3.0-py3-none-any.whl | Python 3 | none | any | Details for fortnite_api-3.3.0-py3-none-any.whl |
Total release size: 145.7 kB
Release files / fortnite_api-3.3.0.tar.gz
| Download URL | fortnite_api-3.3.0.tar.gz |
|---|---|
| Size | 59.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f3655557dab8e7d08729122305b58c19538e65644f11923819b9901b1c472a28
|
|
BLAKE2b-256 checksum How to use checksums |
ad89c6e4c4cb292ec82c20220e28d3e36b52e5f9ac86677b04bb2f3dfb9d2138
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.7
|
Release files / fortnite_api-3.3.0-py3-none-any.whl
| Download URL | fortnite_api-3.3.0-py3-none-any.whl |
|---|---|
| Size | 86.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
166439ee36bbdbf1043b708fc3989197a9a954bbbaadc1d6b9be1c886f15785b
|
|
BLAKE2b-256 checksum How to use checksums |
8c0ba4b331359d37d2dc7a983d591ba2f84799285760cf566b44bc0c3b3cf55e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.7
|
Security for fortnite-api 3.3.0
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.