A python wrapper for Fortnite-API.com
Project description
Sync/Async Python wrapper for Fortnite-API.com
This library offers a complete sync and async wrapper around the endpoints of Fortnite-API.com
Installation
pip install fortnite-api
- Get a API key on https://fortnite-api.com/profile
Documentation
Here is a quick overview how to start.
First we need to import the api and initialize client.
import fortnite_api
fortnite_client = fortnite_api.FortniteAPI()
Parameters
api_key
[str] - Insert your API key from https://fortnite-api.com/profilerun_async
[bool] (Optional) - Specify if the API should run async. Default is set tofalse
Attributes
cosmetics
- All cosmetic endpointsshop
- All shop endpointsnews
- All news endpoints
Now we can use the client:
Cosmetics
api.cosmetics.fetch_all()
Get all Br cosmetics.
Parameters
language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns
Returns a list of BrCosmetic
objects.
Raises
ServerOutage
when the servers are not availableRateLimted
when the rate limit has been hitUnauthorized
when no or a wrong API key has been provided
api.cosmetics.search_by_id()
Search one o multiple items by their id.
Parameters
*cosmetic_id
- One or multiple cosmetic ids.language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns
Returns a list of BrCosmetic
objects.
Raises
ServerOutage
if the servers are not availableRateLimted
when the rate limit has been hitUnauthorized
when no or a wrong API key has been providedNotFound
if the cosmetic with the given id wasn't foundMissingIDParameter
if no id was provided
api.cosmetics.search_all()
Search all cosmetics which fit to the search parameters
Parameters
**search_parameters
- All search parameters are listed on the Fortnite-API.com Docs. Remember that Python does not use a camel case. So e.g.searchLanguage
becomessearch_language
language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns
Returns a list of BrCosmetic
objects.
Raises
ServerOutage
if the servers are not availableRateLimted
when the rate limit has been hitUnauthorized
when no or a wrong API key has been providedMissingSearchParameter
if no search parameter was provided
api.cosmetics.search_first()
Search the first cosmetics which fit to the search parameters
Parameters
**search_parameters
(Optional) - All search parameters are listed on the Fortnite-API.com Docs. Remember that Python does not use a camel case. So e.g.searchLanguage
becomessearch_language
language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns
Returns a BrCosmetic
objects.
Raises
ServerOutage
if the servers are not availableRateLimted
when the rate limit has been hitUnauthorized
when no or a wrong API key has been providedMissingIDParameter
if no id was provided
Shop
api.shop.fetch()
Get the latest Fortnite shop.
Parameters
language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns
Returns a Shop
object.
Raises
Server Outage
if the servers are not availableRateLimted
when the rate limit has been hitUnauthorized
when no or a wrong API key has been provided
News
api.news.fetch()
Get the latest Fortnite news of all game modes.
Parameters
language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns
Returns a News
object.
Raises
ServerOutage
if the servers are not availableRateLimted
when the rate limit has been hitUnauthorized
when no or a wrong API key has been provided
api.news.fetch_by_type()
Get the latest Fortnite news of a specified game mode.
Parameters
news_type
[NewsType] - Specify the news type.language
[GameLanguage] (Optional) - Specify the language of the shop. Default is set to english
Returns
Returns a GameModeNews
object.
Raises
ServerOutage
if the servers are not availableRateLimted
when the rate limit has been hitUnauthorized
when no or a wrong API key has been provided
Creator Code
api.creator_code.fetch()
Get information about a creator code.
Parameters
creator_code
[str] - Specify a creator code.
Returns
Returns a CreatorCode
object.
Raises
ServerOutage
if the servers are not availableRateLimted
when the rate limit has been hitUnauthorized
when no or a wrong API key has been providedNotFound
if the creator code wasn't found
api.creator_code.exists()
Check if a creator code exists.
Parameters
creator_code
[str] - Specify a creator code.
Returns
Returns a bool
object.
Raises
ServerOutage
if the servers are not availableRateLimted
when the rate limit has been hitUnauthorized
when no or a wrong API key has been provided
aapi.creator_code.search_all()
Search a creator code by name. All results are provided.
Parameters
creator_code
[str] - Specify a creator code.
Returns
Returns a list
of CreatorCode
objects.
Raises
ServerOutage
if the servers are not availableRateLimted
when the rate limit has been hitUnauthorized
when no or a wrong API key has been providedNotFound
if the creator code wasn't found
aapi.creator_code.search_first()
Search a creator code by name. Only the first result is provided.
Parameters
creator_code
[str] - Specify a creator code.
Returns
Returns a CreatorCode
object.
Raises
ServerOutage
if the servers are not availableRateLimted
when the rate limit has been hitUnauthorized
when no or a wrong API key has been providedNotFound
if the creator code wasn't found
Contribute
Every type of contribution is appreciated!
License
Project details
Release history Release notifications
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size fortnite-api-1.0.2.tar.gz (9.9 kB) | File type Source | Python version None | Upload date | Hashes View hashes |