Python Forum

Full Version: API in Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,

I am starting with Python (previously i coded some in VBA) and I have a question about API. Is there any good book about that?

I need API to connect with Bloomberg and Reuters.


br
To connect to API's is Requests the best tool.
Today is most common that get JSON back from API,then can parse out wanted stuff as you get Python dictionary back.
Example:
>>> import requests
>>> 
>>> r = requests.get('https://api.github.com/users/defunkt')
>>> r.status_code
200
>>> data = r.json()
>>> data['company']
'@github '
>>> data['bio']
'? '
>>> data['updated_at']
'2018-02-25T19:53:23Z'
Many thanks,

I saw on youtube that there are many tutorials with JSON

br