In [1]:
from requests import session

credentials = {
    'action': 'login',
    'username': 'xxxxx',
    'password': 'xxxxxxxxx'
}

with session() as s:
    s.post('http://dataapi.tradermadepro.com/login', data=credentials)
    response = s.get('http://dataapi.tradermadepro.com/apikey')
    token = str(response.text)