How to connect to the API with Python

Connecting to our API with our Python package is a little tricky due to Swagger bugs in bearer auth.

First, find your API token in your dashboard as explained here.



Finally the tricky part. Normally you would instance your api client like this
configuration = swagger_client.Configuration()
configuration.access_token = '<your_api_token_here>'
api_instance = swagger_client.HistoricalApi(swagger_client.ApiClient(Configuration))
This won't work. Force the authorization in the instantiation like this:
api_instance = swagger_client.HistoricalApi(swagger_client.ApiClient(None, 'Authorization', 'Bearer <your_api_token_here>'))
In this case we are not using the Configuration but forcing the Authorization header in the Swagger request to our API.