Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Latest commit

 

History

History
86 lines (63 loc) · 2.95 KB

PlayersApi.md

File metadata and controls

86 lines (63 loc) · 2.95 KB

pybrawl.PlayersApi

All URIs are relative to https://api.brawlstars.com/v1

Method HTTP request Description
get_player GET /players/{playerTag} Get player information

get_player

Player get_player(player_tag)

Get player information

Get information about a single player by player tag. Player tags can be found either in game or by from club member lists. Note that player tags start with hash character '#' and that needs to be URL-encoded properly to work in URL, so for example player tag '#2ABC' would become '%232ABC' in the URL.

Example

  • Bearer (JWT) Authentication (JWT):
from __future__ import print_function
import time
import pybrawl
from pybrawl.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.brawlstars.com/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pybrawl.Configuration(
    host = "https://api.brawlstars.com/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): JWT
configuration = pybrawl.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)

# Enter a context with an instance of the API client
with pybrawl.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pybrawl.PlayersApi(api_client)
    player_tag = 'player_tag_example' # str | Tag of the player to retrieve.

    try:
        # Get player information
        api_response = api_instance.get_player(player_tag)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling PlayersApi->get_player: %s\n" % e)

Parameters

Name Type Description Notes
player_tag str Tag of the player to retrieve.

Return type

Player

Authorization

JWT

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Client provided incorrect parameters for the request. -
404 Resource was not found. -
429 Request was throttled, because amount of requests was above the threshold defined for the used API token. -
500 Unknown error happened when handling the request. -
503 Service is temporarily unavailable because of maintenance. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]