Python wrapper for https://apexlegendsapi.com
Project description
apex-legends-api
Python wrapper for https://apexlegendsapi.com
Installation
You can install it from source, or pip (recommended)
Requirements
python >= 3.9
Source installation
python ./setup.py install
Pip installation
pip install apex-legends-api
Usage
- Register for an API Key at Apex Legends API
- Here's a quick snippet to get started
- All method calls return a dictionary representing the JSON in the response.
import sys
from apex_legends_api import ApexLegendsAPI,\
ALPlatform,\
ALPlayer,\
ALAction,\
ALHTTPExceptionFromResponse
from apex_legends_api.al_base import print_description
api = ApexLegendsAPI(api_key='<api_key>')
player_name = str("PlayerName")
player_uid = str("1234567890")
platform = ALPlatform.PC
action = ALAction.GET
# Example 1:
# straight API calls
try:
basic = api.basic_player_stats(player_name=player_name, platform=platform)
# or query by UID
# basic = api.basic_player_stats_by_uid(uid=player_uid, platform=platform)
history = api.events(player_name=player_name, platform=platform, action=action)
origin_player = api.get_player_origin(player_name=player_name, show_all_hits=True)
except ALHTTPExceptionFromResponse as exception:
print(exception)
sys.exit()
print(basic)
print(history)
print(origin_player)
# Example 2:
# retrieve an 'ALPlayer' object
player: ALPlayer = api.get_player(name=player_name, platform=platform)
print_description(player)
Notes
- See detailed documentation at ReadTheDocs
- See https://apexlegendsapi.com for complete documentation.
- See CHANGELOG.md for history of changes
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
apex-legends-api-2.0.2.tar.gz
(10.2 kB
view hashes)
Built Distribution
Close
Hashes for apex_legends_api-2.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af6c217e73b079ee74e0c56baf591342385141189adea76dc9776bf89cea3a22 |
|
MD5 | 28b2c4348e2f6e31359d0b31791f2491 |
|
BLAKE2b-256 | 4408e2d1a52f00b6d1b736e6644c1d9e3b82454692bdb0e5156de08748c07b9e |