Sort defaults to ascending, you can use ascending=False for a descending sort matches = api. Offsetting 5 matches and limitting by 10 matches = api.
sleep ( sleep_seconds ) Limits and Offsets total_seconds () if sleep_seconds > 0 : print ( 'Reached my limit! sleeping for '. get () except RateLimitError as error : sleep_seconds = ( error. STEAM ) while True : try : print ( 'Processing samples.' ) api. The values available in the exception instance are rl_limit (integer) and rl_reset (datetime).Īn example snippet that would use this information in favor of processing something big: api = PUBG ( 'my-super-secret-key', Shard. In order to facilitate heavy tasks, it is possible to retrieve those values from the RateLimitError. The ratelimit is managed through HTTP headers ( X-Ratelimit-Limit, X-Ratelimit-Reset, etc.). matches > RatelimitsĮach application has a limited amount of requests allowed per minute. filter ( player_names = ) player = players player. The domain is all specified here players = api. Playing around with dataĪn example of how you can manipulate the data: Page is always required, even when querying the first leaderboard page. leaderboards ( game_mode = 'squad-fpp' ). Retrieving a leaderboard # Leaderboards stats are only available for PC players api. filter ( player_names = ) player = players wm = api. Retrieving a weapon mastery data players = api. seasons ( 'lifetime', player_id = 'epickitten' ). It's also possible to retrieve lifetime stats, instead of a season_id: season_data = api. filter ( player_ids = ) Retrieving season data for a specific player season_data = api. seasons ( season_id = 'lifetime', game_mode = 'solo' ). It's also possible to retrieve lifetime stats, instead of a season_id: players_seasons = api. seasons () Retrieving seasons information for a list of players players_seasons = api. Retrieving the list of seasons seasons = api. tournaments () for tournament in tournaments : print ( tournament ) Seasons get ( 'na-ppc' ) Retrieving a list of tournaments tournaments = api. Retrieving a single tournament tournament = api. Shard defaults to pc but you need to specify if you're loading a xbox telemetry file. from_json ( 'telemetry.json', shard = 'pc' )
Method to create a Telemetry object from it: from pubg_python import Telemetry telemetry = Telemetry. If you want to load a previously downloaded telemetry file, there is a helper events_from_type ( 'LogPlayerPosition' ) Loading a local Telemetry file events_from_type ( 'LogPlayerKill' ) player_position_events = telemetry. Sometimes you're interested in a set of very specific events, so there is a helper function to filter those for you: match = api. events )) > 16871 Filtering specific events in a telemetry object Processing a match Telemetry data match = api. filter ( match_ids = match_ids ) for match in matches : print ( match ) Telemetry Still unavailable in the API match_ids = matches = api. filter ( player_ids = ) for player in players : player_name = player. id Retrieving a list of players filtering by ids players = api. filter ( player_names = ) for player in players : player_id = player. id ) Retrieving a list of players filtering by names players = api. id ) Samples can also be filtered by a creation date sample = api. PC_NA )Ī list of shards can be found here and the wrapper constants here SamplesĪ sample of matches can be retrieved as a starting point sample = api. from pubg_python import PUBG, Shard api = PUBG ( '', Shard. The PUBG API shards data by platform and region, and therefore requires a shard to be specified in the URL for most requests.
#Pubg pc leaderboards install
To install the wrapper, simply use pip pip install pubg-python PUBG Developer API Official Documentation Installation A python wrapper for the PUBG Developer API