1. Function categories

1.1. Accounts

Wrapper for WarGaming’s Console API

Search for a player by name

Parameters:
  • search (str) – Player name to search for. Maximum length is 24 symbols
  • application_id (str) – Your application key (generated by WG)
  • fields (list(str)) – Reponse fields to exclude or _only_ include. To exclude a field, use “-” in front of its name
  • limit (int or str) – Number of returned entries. Default is 100; values less than 1 or greater than 100 are ignored
  • stype (str) –

    Search type. Defines minimum length and type of search. Default value is “startswith”. Valid values:

    • “startswith” - search by initial characters of player name. Minimum length: 3 characters. Case-insensitive.
    • “exact” - Search by exact match of player name. Minimum length: 1 character. Case-insensitive
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.player_data(account_id, application_id, access_token=None, fields=None, language='en', api_realm='xbox', timeout=10)[source]

Retrieve information on one or more players, including statistics. Private data requires an access token from a valid, active login.

Parameters:
  • account_id (int str or iterable) – Player ID(s)
  • application_id (str) – Your application key (generated by WG)
  • access_token (str) – Authentication token from active session
  • fields (str) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • language (str) – Response language
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.player_achievements(account_id, application_id, fields=None, language='en', api_realm='xbox', timeout=10)[source]

View player’s achievements, such as mastery badges and battle commendations

Parameters:
  • account_id (int or str or iterable) – Player account ID(s). Max limit is 100
  • application_id (str) – Your application key (generated by WG)
  • fields (str) – Fields to filter or explicitly include. To exclude,

prepend the field with a “-” :param str language: Response language :param str api_realm: Platform API. “xbox” or “ps4” :param int timeout: Maximum allowed time to wait for response from servers :return: API response :rtype: WOTXResponse :raises WOTXResponseError: If the API returns with an “error” field

wotconsole.player_data_ps_uid(psnid, application_id, timeout=10)[source]

Retrieve player info using PlayStation UID

Parameters:
  • psnid (int or str or iterable) – Play Station UID(s). Max limit is 100
  • application_id (str) – Your application key (generated by WG)
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.player_data_xbox_uid(xuid, application_id, timeout=10)[source]

Retrieve player info using Microsoft XUID

Parameters:
  • xuid (int or str or iterable) – Player Microsoft XUID(s). Max limit is 100
  • application_id (str) – Your application key (generated by WG)
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

1.2. Authentication

wotconsole.player_sign_in(application_id, display=None, expires_at=None, nofollow=None, redirect_uri=None, language='en', api_realm='xbox', timeout=10)[source]

Log in a player, receiving an access token once completed successfully.

Parameters:
  • application_id (str) – Your application key (generated by WG)
  • display (str) –

    Layout for mobile applications. Valid values:

    • “page” - Page
    • “popup” - Popup window
    • “touch” - Touch
  • expires_at (int) – UNIX POSIX timestamp or delta in seconds. Maximum expiration time is 2 weeks
  • nofollow (int) – If set to 1, the user is not redirected. A URL is returned in response. Default is 0. Max is 1, Min is 0
  • redirect_uri (HTTP) – URL where user is redirected to
  • language (str) – Response language
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.extend_player_sign_in(access_token, application_id, expires_at=None, api_realm='xbox', timeout=10)[source]

Extend the active session of a user when the current session is about to expire

Parameters:
  • access_token (str) – Current user active session token
  • application_id (str) – Your application key (generated by WG)
  • expires_at (int) – UNIX POSIX timestamp or delta in seconds. Maximum expiration time is 2 weeks
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.player_sign_out(access_token, application_id, api_realm='xbox', timeout=10)[source]

Terminate the user’s active session. Once successful, the access token will no longer be valid

Parameters:
  • access_token (str) – Session token for the user
  • application_id (str) – Your application key (generated by WG)
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

1.3. Clans

Search for clan(s)

Specifying a clan is _optional._ If you do not specify one, the API will simply return a listing of clans in order of highest member count

Parameters:
  • application_id (str) – Your application key (generated by WG)
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • limit (int) – Maximum number of clans to return. Max is 100
  • page_no (int) – Page number to start listing on. Default is 1
  • search (str) – Clan name to search for
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.clan_details(clan_id, application_id, extra=None, fields=None, api_realm='xbox', timeout=10)[source]

Retrieve detailed information on a clan.

May also be used for retrieving a list of players in a clan.

Parameters:
  • clan_id (int) – Clan ID. Min value is 1
  • application_id (str) – Your application key (generated by WG)
  • extra (list(str)) – Extra fields to be included in the response
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.player_clan_data(clan_id, application_id, extra=None, fields=None, api_realm='xbox', timeout=10)[source]

Retrieve player’s clan relationship

Parameters:
  • account_id (str) – Player ID number
  • application_id (str) – Your application key (generated by WG)
  • extra (list(str)) – Additional fields to retrieve
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.clan_glossary(application_id, fields=None, language='en', api_realm='xbox', timeout=10)[source]

Retrieve general information regarding clans (_not_ clan-specific info)

Parameters:
  • application_id (str) – Your application key (generated by WG)
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • language (str) – Response language
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

1.4. Tankopedia

wotconsole.crew_info(application_id, fields=None, language='en', api_realm='xbox', timeout=10)[source]

Retrieve information about crews

Parameters:
  • application_id (str) – Your application key (generated by WG)
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • language (str) – Response language
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.vehicle_info(application_id, fields=None, language='en', nation=None, tank_id=None, tier=None, api_realm='xbox', timeout=10)[source]

Retrieve information on one or more tanks

Parameters:
  • application_id (str) – Your application key (generated by WG)
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • language (str) – Response language
  • nation (list(str)) – Nation(s) to filter tanks to
  • tank_id (list(int or str)) – All desired tanks (limit 100)
  • tier (list(int)) – Tiers to filter to
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

Tank information

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.packages_info(tank_id, application_id, fields=None, language='en', api_realm='xbox', timeout=10)[source]

Retrieve package characteristics and their interdependence

Parameters:
  • tank_id (list(int)) – Vehicle(s) to retireve information for
  • application_id (str) – Your application key (generated by WG)
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • language (str) – Response language
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.equipment_consumable_info(tank_id, application_id, fields=None, language='en', api_realm='xbox', timeout=10)[source]

Retrieve vehicle equipment and consumables

Parameters:
  • tank_id (list(int)) – Vehicle(s) to retireve information for
  • application_id (str) – Your application key (generated by WG)
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • language (str) – Response language
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.achievement_info(application_id, category=None, fields=None, language='en', api_realm='xbox', timeout=10)[source]

Retrieve list of awards, medals, and ribbons

Parameters:
  • application_id (str) – Your application key (generated by WG)
  • category (list(str)) –

    Filter by award category. Valid values:

    • “achievements” - Achievements
    • “ribbons” - Ribbons

    Max limit is 100

  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • language (str) – Response language
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.tankopedia_info(application_id, fields=None, language='en', api_realm='xbox', timeout=10)[source]

Retrieve information regarding the Tankopeida itself

Parameters:
  • application_id (str) – Your application key (generated by WG)
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • language (str) – Response language
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

1.5. Player ratings

wotconsole.types_of_ratings(application_id, fields=None, language='en', platform=None, api_realm='xbox', timeout=10)[source]

Retrieve dictionary of rating periods and ratings details

Parameters:
  • application_id (str) – Your application key (generated by WG)
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • language (str) – Response language
  • platform (str) –

    Console platform. Default is “default” (all consoles). Valid responses:

    • “default” - All platforms (default)
    • “xbox” - XBOX
    • “ps4” - PlayStation 4
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.dates_with_ratings(rating, application_id, account_id=None, fields=None, language='en', platform=None, api_realm='xbox', timeout=10)[source]

Retrieve dates with available rating data

Parameters:
  • rating (str) – Rating period
  • application_id (str) – Your application key (generated by WG)
  • account_id (list(int)) – Player account ID. Max limit is 100
  • language (str) – Response language
  • platform (str) –

    Console platform. Default is “default” (all consoles). Valid responses:

    • “default” - All platforms (default)
    • “xbox” - XBOX
    • “ps4” - PlayStation 4
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.player_ratings(rating, account_id, application_id, date=None, fields=None, language='en', platform=None, api_realm='xbox', timeout=10)[source]

Retrieve player ratings by specified IDs

Parameters:
  • rating (str) – Rating period
  • account_id (list(int)) – Player account ID. Max limit is 100
  • application_id (str) – Your application key (generated by WG)
  • date – Ratings calculation date. Up to 7 days before the current date. Default value: yesterday. Date in UNIX timestamp or ISO 8601 format. E.g. 1376542800 or 2013-08-15T00:00:00
  • language (str) – Response language
  • platform (str) –

    Console platform. Default is “default” (all consoles). Valid responses:

    • “default” - All platforms (default)
    • “xbox” - XBOX
    • “ps4” - PlayStation 4
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.adjacent_positions_in_ratings(account_id, rank_field, rating, application_id, date=None, fields=None, language='en', limit=None, platform=None, api_realm='xbox', timeout=10)[source]

Retrieve list of adjacent positions in specified rating

Parameters:
  • account_id (list(int)) – Player account ID. Max limit is 100
  • rank_field (str) – Rating category
  • rating (str) – Rating period
  • application_id (str) – Your application key (generated by WG)
  • date – Ratings calculation date. Up to 7 days before the current date. Default value: yesterday. Date in UNIX timestamp or ISO 8601 format. E.g. 1376542800 or 2013-08-15T00:00:00
  • language (str) – Response language
  • limit (int) – Number of returned entries. Default is 5. Max limit is 50
  • platform (str) –

    Console platform. Default is “default” (all consoles). Valid responses:

    • “default” - All platforms (default)
    • “xbox” - XBOX
    • “ps4” - PlayStation 4
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.top_players(rank_field, rating, application_id, date=None, fields=None, language='en', limit=None, page_no=None, platform=None, api_realm='xbox', timeout=10)[source]

Retrieve the list of top players by specified parameter

Parameters:
  • rank_field (str) – Rating category
  • rating (str) – Rating period
  • application_id (str) – Your application key (generated by WG)
  • date – Ratings calculation date. Up to 7 days before the current date. Default value: yesterday. Date in UNIX timestamp or ISO 8601 format. E.g. 1376542800 or 2013-08-15T00:00:00
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • language (str) – Response language
  • limit (int) – Number of returned entries. Default is 10. Max limit is 1000
  • page_no (int) – Result page number. Default is 1. Min is 1
  • platform (str) –

    Console platform. Default is “default” (all consoles). Valid responses:

    • “default” - All platforms (default)
    • “xbox” - XBOX
    • “ps4” - PlayStation 4
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

1.6. Player’s vehicles

wotconsole.player_tank_statistics(account_id, application_id, access_token=None, in_garage=None, fields=None, api_realm='xbox', language='en', tank_id=None, timeout=10)[source]

Retrieve information on all tanks that a player has owned and/or used

Parameters:
  • account_id (int) – target player ID
  • application_id (str) – Your application key (generated by WG)
  • access_token (str) – Authentication token from player login (if accessing private data)
  • in_garage (str) – Filter (‘0’) for tanks absent from garage, or (‘1’) available
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • language (str) – Response language
  • tank_id (list(int)) – Limit statistics to vehicle(s). Max limit is 100
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

wotconsole.player_tank_achievements(account_id, application_id, access_token=None, fields=None, in_garage=None, tank_id=None, api_realm='xbox', language='en', timeout=10)[source]

Retrieve players’ achievement details

Parameters:
  • account_id (int) – target player ID
  • application_id (str) – Your application key (generated by WG)
  • access_token (str) – Authentication token from player login (if accessing private data)
  • fields (list(str)) – Fields to filter or explicitly include. To exclude, prepend the field with a “-“
  • in_garage (str) – Filter (‘0’) for tanks absent from garage, or (‘1’) available
  • tank_id (list(int)) – Limit statistics to vehicle(s). Max limit is 100
  • api_realm (str) – Platform API. “xbox” or “ps4”
  • language (str) – Response language
  • timeout (int) – Maximum allowed time to wait for response from servers
Returns:

API response

Return type:

WOTXResponse

Raises:

WOTXResponseError – If the API returns with an “error” field

2. Classes and Exceptions

2.1. WOTXResponse Class

class wotconsole.WOTXResponse(response)[source]

Response wrapper for WG’s API

Variables:
  • data – Values returned by the API servers
  • meta – Additional metadata, typically just a count of returned values
  • raw – Response object returned from the requests library
  • status – Usually just the message ‘ok’

2.2. WOTXResponseError Exception

exception wotconsole.WOTXResponseError(response, raw)[source]

Error(s) in interaction with WG’s API

Variables:
  • error – Metadata on the error
  • message – HTTP response message
  • raw – Response object returned from the requests library
  • status – Ususally just the message ‘error’