Request public map data from Travian 5 API more convenient with t5apy
.
This [official thread] explain on how to use Travian 5 API.
it's recommended to use virtualenv.
- git clone this repo
(venv)$ git clone https://github.com/didadadida93/t5apy.git
- change directory to t5apy.
(venv)$ cd t5apy
- install it
(venv)$ pip install .
Based on [official thread] first we need API key.
After that we can request public map data.
>>> import t5apy
>>>
>>> api_key = t5apy.request_api_key(
... email='[email protected]',
... site_name='your-tools',
... site_url='https://example.com',
... public='false',
... gameworld='com1'
... )
>>>
>>> # once we get api key, we can request public map data
... map_data = t5apy.request_map_data(
... private_api_key=api_key['privateApiKey'],
... gameworld='com1'
... )
>>> map_data.keys()
dict_keys(['gameworld', 'players', 'kingdoms', 'map'])
>>>