In this quick start we provide a quick walkthrough of how to:
For both types of request you will need to start off by getting an API key. You can do this by:
# $API_KEY holds the API key obtained above
# $HOST is the domain where this API is hosted
curl "https://api.busmethodology.org.uk/api/partners" -H "Authorization: Bearer $API_KEY"
Start off by installing the buslib library, preferably in a virtualenv, using pip install buslib
Now in a python terminal (we recommend jupyter notebook)
>> # API_KEY holds the API key obtained above
>> # PROXIES contains any proxy settings you need for your network
>> # For ARUP this is "{'https' : 'https://proxy.ha.arup.com:80'}" - which is the default
>> import buslib
>> client = buslib.Client(API_KEY, host='%s/api' % "https://api.busmethodology.org.uk", proxies=PROXIES)
>> client.partners.get()
You have successfully fetched all the partners you are allowed access to!