API Documentation

Apex Legends API

The ApexLegendsAPI wraps the api at: https://apexlegendsapi.com
Get your API Key Here: https://apexlegendsapi.com
class apex_legends_api.al_api.ApexLegendsAPI(api_key: str)

Main class that wraps the API calls

add_player_by_uid(player_uid: int, platform: apex_legends_api.al_base.ALPlatform)list

Adds the given player’s UUID to the list of tracked players

Parameters
  • player_uid (int) – UUID of the player to add

  • platform (ALPlatform) – ALPlatform of player to add

basic_player_stats(player_name: str, platform: apex_legends_api.al_base.ALPlatform, skip_tracker_rank=False)list

Query the server for the given player / platform and returns a dictionary of their stats. More here: https://apexlegendsapi.com/#basic

Parameters
  • player_name – Player Name to search for

  • platform – (see Platform enum for values)

  • skip_tracker_rank – if set to true, this will not fetch the legend’s tracker rank

Returns

List of player stats created from response json

basic_player_stats_by_uid(uid: str, platform: apex_legends_api.al_base.ALPlatform, skip_tracker_rank=False)list

Query the server for the given player / platform and returns a dictionary of their stats. More here: https://apexlegendsapi.com/#basic

Parameters
  • uid – Player UID to search for

  • platform – (see Platform enum for values)

  • skip_tracker_rank – if set to true, this will not fetch the legend’s tracker rank

Returns

List of player stats created from response json

events(player_name: str, platform: apex_legends_api.al_base.ALPlatform, action: apex_legends_api.al_base.ALAction)list

Query the server for the given player / platform and return a list of their events

NOTE:
  • Match history is only available for supporters

  • Match history must be tracked by the server otherwise this will return nothing

  • In order to add a player to be tracked, you need to call this passing ‘add’ action.

Parameters
  • player_name – Player Name for match history

  • platform – see Platform enum for values

  • action – see Action enum for values

Returns

List of history created from response json

events_by_uid(uid: str, platform: apex_legends_api.al_base.ALPlatform, action: apex_legends_api.al_base.ALAction)list

Query the server for the given player’s UID / platform and return a list of their events

NOTE:
  • Match history is only available for supporters

  • Match history must be tracked by the server otherwise this will return nothing

  • In order to add a player to be tracked, you need to call this passing ‘add’ action.

Parameters
  • uid – Player UID for match history

  • platform – see Platform enum for values

  • action – see Action enum for values

Returns

List of history created from response json

get_player(name: str, platform: apex_legends_api.al_base.ALPlatform, skip_tracker_rank=False)apex_legends_api.al_domain.ALPlayer

Retrieve the ALPlayer object populated with data from the api.

NOTE:

Player must exist, method will return None if the player cannot be found

Parameters
  • name (str) – Name of the player

  • platform – see ALPlatform for all types

  • skip_tracker_rank – if set to True, this will skip fetching the legend ranks

Returns

a single player or None if no player is found

get_player_by_uid(uid: str, platform: apex_legends_api.al_base.ALPlatform, skip_tracker_rank=False)apex_legends_api.al_domain.ALPlayer

Retrieve the ALPlayer object populated with data from the api.

NOTE:

Player must exist, method will return None if the player cannot be found

Parameters
  • uid – UID of the player

  • platform – see ALPlatform for all types

  • skip_tracker_rank – if set to True, this will skip fetching the legend ranks

Returns

a single player or None if no player is found

get_player_origin(player_name: str, show_all_hits: bool = False)list
Query the server for the origin user and returns Origin UID, real username, PID and avatar

for a given username

Parameters
  • player_name – Player Name for match history

  • show_all_hits – True to ‘search’ for player (show multiple hits), default False

Returns

list of results

match_history(player_name: str, platform: apex_legends_api.al_base.ALPlatform, action: apex_legends_api.al_base.ALAction)list

Deprecated since version 1.1.0: use events instead

nametouid(player: str, platform: apex_legends_api.al_base.ALPlatform)int

Retrieve a player’s uid given they’re name and platform

Parameters
  • player (str) – Name of the player

  • platform (ALPlatform) – see [ALPlatform] for all types