Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.
Christian Cuevas edited this page Jul 16, 2017 · 14 revisions

What is the player function?

The player function allows for easy and simple retrieval of a player's Vainglory history with their id.

Usage:

The player function requires one parameter and has two optional parameters.

List of Parameters:

Parameters:

  • player_id

The player's id. Reference: https://developer.vainglorygame.com/docs#get-a-single-player

  • region

Default: "na"
Options: "na", "eu", "sg", "ea", "sa"
The player's region. Reference: https://developer.vainglorygame.com/docs#regions

  • toObject

Default: False
Options: True, False
If data should be returned as an object.

Examples:

Getting player's history with player_id:

   >>> import gamelocker
   >>> api = gamelocker.Vainglory(api_key)
   >>> player_id = "99b050b8-cd6b-11e5-b233-06eb725f8a76"  # Reference: https://developer.vainglorygame.com/docs#get-a-single-player
   >>> data = api.player(player_id)

Getting player's history from a specific region:

   >>> import gamelocker
   >>> api = gamelocker.Vainglory(api_key)
   >>> player_id = "99b050b8-cd6b-11e5-b233-06eb725f8a76"  # Reference: https://developer.vainglorygame.com/docs#get-a-single-player
   >>> data = api.player(player_id, "eu")

Getting player's history as an object:

   >>> import gamelocker
   >>> api = gamelocker.Vainglory(api_key)
   >>> player_id = "99b050b8-cd6b-11e5-b233-06eb725f8a76"  # Reference: https://developer.vainglorygame.com/docs#get-a-single-player
   >>> data = api.player(player_id, toObject=True)

Example Code

You can find example code here.

Data Samples

How data is received & given:

Before Wrapper

This is the JSON we get and process from gamelocker: open

After Wrapper

This is the dictionary you get from calling on player: open