Endpoint

class arez.Endpoint(url, dev_id, auth_key, *, loop=None)[source]

Represents a basic Hi-Rez endpoint URL wrapper, for handling response types and session creation.

Note

You can request your developer ID and authorization key here.

Warning

The main API and data cache classes use this class as base, so all of it’s methods are already available there. This class is listed here solely for documentation purposes. Instanting it yourself is possible, but not recommended.

Parameters
  • url (str) – The endpoint’s base URL.

  • dev_id (Union[int, str]) – Your developer’s ID (devId).

  • auth_key (str) – Your developer’s authentication key (authKey).

  • loop (Optional[asyncio.AbstractEventLoop]) –

    The event loop you want to use for this Endpoint.

    Default loop is used when not provided.

await close()[source]

Closes the underlying API connection.

Attempting to make a request after the connection is closed will result in a RuntimeError.

await request(method_name, /, *data)[source]

Makes a direct request to the HiRez API.

For all methods available (and their parameters), please see Hi-Rez API docs.

Parameters
  • method_name (str) – The name of the method requested. This shouldn’t include the reponse type as it’s added for you.

  • *data (Union[int, str]) – Method parameters requested to add at the end of the request, if applicable. These should be either integers or strings.

Returns

A raw server’s response as a string, list or a dictionary (depending on the endpoint).

Return type

Union[str, Dict[str, Any], List[Dict[str, Any]]]

Raises
  • HTTPException – Whenever it was impossible to fetch the data in a reliable manner. Check the HTTPException.cause attribute for the original exception (and reason) that lead to this.

  • Unauthorized – When the developer’s ID (devId) or the developer’s authentication key (authKey) are deemed invalid.

  • Unavailable – When the Hi-Rez API switches to emergency mode, and no data could be returned at this time.

  • LimitReached – Your daily limit of requests has been reached.