API Reference¶
The following section outlines the API of HiRezPy.
Client¶
-
class
hirezpy.
Client
(dev_id, auth_key, *, loop=None, default_endpoint=None, default_language=None)[source]¶ Class for handling connections and requests to Hi Rez Studios’ APIs
Parameters: - dev_id (str) – Used for authentication. This is the developer ID that you receive from Hi-Rez Studios.
- auth_key (str) – Used for authentication. This is the authentication key that you receive from Hi-Rez Studios.
- loop ([optional] event loop) – The event loop used for async ops. If this is the default (None), the bot will use asyncio’s default event loop.
- default_endpoint ([optional]
Endpoint
) – The endpoint that will be used by default for outgoing requests. You can use different endpoints per request without changing this. Otherwise, this will be used. It defaults to Endpoint.smitepc. - default_language ([optional]
Language
) – The language that will be used by default when making requests. You can use different languages per request without changing this. Otherwise, this will be used. It defaults to Language.english.
-
get_characters
(*, language: hirezpy.language.Language=None, endpoint: hirezpy.endpoint.Endpoint=None)[source]¶ This function is a coroutine.
Returns information about the characters in the game. For Smite, this is the gods in the game. For Paladins, the champions.
Parameters: Returns: Returns the characters in the game. God objects will be reteurned if the game is Smite, else Champion objects.
Return type:
-
get_data_used
(*, endpoint: hirezpy.endpoint.Endpoint=None)[source]¶ This function is a coroutine.
Gets the data limits for the developer.
Parameters: endpoint ([optional] Endpoint
) – The endpoint to make the request with. If not specified, Client.default_endpoint is used.Returns: The developer limits. Return type: Limits
object
-
get_esports_details
(*, endpoint: hirezpy.endpoint.Endpoint=None)[source]¶ This function is a coroutine.
Returns the matchup information for each matchup for the current eSports Pro League season.
Parameters: endpoint ([optional] Endpoint
) – The endpoint to make the request with. If not specified, Client.default_endpoint is used.Returns: The matches in the current season. Return type: set of Match
objects
-
get_friends
(username, *, endpoint: hirezpy.endpoint.Endpoint=None)[source]¶ This function is a coroutine.
Returns information about a user’s friends.
Parameters: - username (str) – The username of the player to get information about
- endpoint ([optional]
Endpoint
) – The endpoint to make the request with. If not specified, Client.default_endpoint is used.
Returns: Represents the given user’s friends. Will return None if the user’s privacy settings do not allow, or the user given is invalid.
Return type: list of
Player
objects or None
-
get_ranks
(username, *, endpoint: hirezpy.endpoint.Endpoint=None)[source]¶ This function is a coroutine.
Returns information about a user’s god or champion ranks, depending on the endpoint that is being called (Smite/Paladins)
Parameters: - username (str) – The username of the player to get information about
- endpoint ([optional]
Endpoint
) – The endpoint to make the request with. If not specified, Client.default_endpoint is used.
Returns: Represents the given user’s ranks. Will return None if the user’s privacy settings do not allow, or the user given is invalid.
Return type: list of
Rank
objects or None
-
get_recommended_items
(characterid, *, language: hirezpy.language.Language=None, endpoint: hirezpy.endpoint.Endpoint=None)[source]¶ This function is a coroutine.
Return the recommended items for a character.
Parameters: - characterid (str) – The character to check against
- langauge ([optional]
Language
) – The language code to get the information with. If not specified, Client.default_language is used. - endpoint ([optional]
Endpoint
) – The endpoint to make the request with. If not specified, Client.default_endpoint is used.
Returns: Returns the recommended items for a character. Returns None if an invalid ID is given and no data is returned.
Return type: set of
Item
or None
-
get_skins
(characterid, *, language: hirezpy.language.Language=None, endpoint: hirezpy.endpoint.Endpoint=None)[source]¶ This function is a coroutine.
Return the skins for a character.
Parameters: - characterid (str) – The character to get skins for
- langauge ([optional]
Language
) – The language code to get the information with. If not specified, Client.default_language is used. - endpoint ([optional]
Endpoint
) – The endpoint to make the request with. If not specified, Client.default_endpoint is used.
Returns: Returns the skins for a character. Returns None if an invalid ID is given and no data is returned.
Return type: list of
GodSkin
,ChampionSkin
or None
-
ping
(*, endpoint: hirezpy.endpoint.Endpoint=None)[source]¶ This function is a coroutine.
Pings the API in order to establish connectivity
Parameters: endpoint ([optional] Endpoint
) – The endpoint to make the request with. If not specified, Client.default_endpoint is used.Returns: Return type: boolean equal to True
Enums¶
There are several enums used within HiRezPy to make it easier for you to configure the library for use how you like.
Data Classes¶
These are the classes created by API responses. You shouldn’t create these yourself. They hold the data that is responded from the API server in an easy to use way.
HrpObject¶
Limits¶
-
class
hirezpy.
Limits
(**kwargs)[source]¶ Represents developer usage limits.
This is a sub-class of
HrpObject
.-
total_requests
¶ int – The total requests that have been made to the API today
-
session_cap
¶ int – The total amount of sessions permitted today
-
active_sessions
¶ int – The total amount of active sessions
-
request_limit
¶ int – The total amount of requests permitted today
-
total_sessions
¶ int – The total sessions that have been created today
-
concurrent_sessions
¶ int – The amount of concurrent sessions permitted today
-
session_time_limit
¶ int – The amount of time sessions last for, in minutes
-
requests_left
¶ Returns the amount of requests left that can be made today as int
-
sessions_left
¶ Returns the amount of sessions left that can be created today as int
-
Match¶
-
class
hirezpy.
Match
(**kwargs)[source]¶ Represents an eSports match.
This is a sub-class of
HrpObject
.-
id
¶ int – The match ID. This is unique, and will always be different to another match.
-
number
¶ int – The match number
-
status
¶ str – The status of the match
-
region
¶ str – The region of the match
-
tournament_name
¶ str – The name of the tournament that the match is involved in
-
map_instance_id
¶ int – The map instance ID
-
date
¶ datetime or str – The date and time of the match. Only returns a str if the date and time can’t be parsed correctly by datetime.strptime, which should not happen
-
away_team_id
¶ int – The ID of the away team
-
away_team_name
¶ str – The name of the away team
-
away_team_tag
¶ str – The clan tag of the away team
-
home_team_id
¶ int – The ID of the home team
-
home_team_name
¶ str – The name of the home team
-
home_team_tag
¶ str – The clan tag of the home team
-
Player¶
-
class
hirezpy.
Player
(**kwargs)[source]¶ Represents a player.
This is a sub-class of
HrpObject
.-
id
¶ int – The player’s account ID. This is the ID of a player’s Hi-Rez account
-
player_id
¶ int – The player’s ID, based on the game that you are checking against
-
avatar_url
¶ str – The player’s avatar image URL. Could be an empty string if the user is using the default avatar.
-
username
¶ str – The player’s username
-
Rank¶
-
class
hirezpy.
Rank
(**kwargs)[source]¶ Represents a character rank.
This is a sub-class of
HrpObject
.-
id
¶ int – The character’s ID
-
player_id
¶ int – The player’s ID, based on the game that you are checking against
-
name
¶ str – The character’s name
-
assists
¶ int – The amount of assists made with this character
-
deaths
¶ int – The amount of deaths made with this character
-
kills
¶ int – The amount of kills made with this character
-
losses
¶ int – The amount of losses made with this character
-
minion_kills
¶ int – The amount of minion kills made with this character
-
rank
¶ int – The rank gained with this character
-
wins
¶ int – The amount of wins made with this character
-
xp
¶ int – The amount of XP gained with this character. For Smite, this will return the amount of worshippers. For Paladins, this will be the amount of experience.
-
Character¶
-
class
hirezpy.
Character
(**kwargs)[source]¶ Represents a character.
This is a sub-class of
HrpObject
.-
id
¶ int – The character’s ID
-
health
¶ int – The character’s health
-
name
¶ str – The character’s name
-
pantheon
¶ str – The character’s pantheon
-
speed
¶ int – The character’s speed
-
title
¶ str – The character’s title
-
roles
¶ str – The character’s roles
-
God¶
-
class
hirezpy.
God
(**kwargs)[source]¶ Represents a god in Smite.
This is a sub-class of
Character
.-
abilities
¶ list – List of GodAbility objects representing the god’s abilities
-
attack_speed
¶ int – The attack speed of the god
-
attack_speed_per_level
¶ int – The attack speed per level gained
-
cons
¶ str – The cons of the god
-
hp5_per_level
¶ int – The HP5 per level gained
-
health_per_five
¶ int – The god’s health per five
-
health_per_level
¶ int – The god’s health per level
-
lore
¶ str – The god’s lore
-
mp5_per_level
¶ int – The MP5 per level gained
-
magic_protection
¶ int – The god’s magic protection
-
magic_protection_per_level
¶ int – The god’s magic protection per level gained
-
magical_power
¶ int – The god’s magical power
-
magical_power_per_level
¶ int – The god’s magical power per level gained
-
mana
¶ int – The god’s mana
-
mana_per_five
¶ int – The god’s mana per five
-
mana_per_level
¶ int – The god’s mana per level
-
physical_power
¶ int – The god’s physical power
-
physical_power_per_level
¶ int – The god’s physical power per level
-
physical_protection
¶ int – The god’s physical protection
-
physical_protection_per_level
¶ int – The god’s physical protection per level
-
pros
¶ str – The god’s pros
-
type
¶ str – The god’s type
-
latest
¶ bool – Indicates if the god was recently added to the game
-
basic_attack
¶ GodAbility – The god’s basic attack
-
god_icon_url
¶ str – The URL of the god’s icon
-
god_card_url
¶ str – The URL of the god’s card
-
Ability¶
GodAbility¶
-
class
hirezpy.
GodAbility
(**kwargs)[source]¶ Represents a god’s ability in Smite.
This is a sub-class of
Ability
.Parameters: - type (str) – The type of ability
- affects (str) – Who the ability affects
- damage (str) – What type of damage the ability does. If it is a basic attack, this will instead be how much damage the attack does.
- radius (str) – The radius of the ability
- attributes (list) – A list of the ability’s attributes