Has anyone worked with the XBRL API for financial data (https://xbrlus.github.io/xbrl-api/)? I am able to use the interactive demo but not able to recreate it on my own and successfully access the API using the python requests library when accessing the oauth2.
This is what I am trying now, which returns an "invalid request" error. Appreciate any support.
import requests
body_auth = {'username' : 'email@domain',
'client_id': 'generated from the XBRL API demo',
'client_secret' : 'generated from the XBRL API demo',
'password' : 'password',
'grant_type' : 'password'}
payload = urlencode(body_auth)
url = 'https://api.xbrl.us/oauth2/token'
headers = {"Content-Type": "application/x-www-form-urlencoded"}
res = requests.request("POST", url, data=payload, headers=headers)
auth_json = res.json()
auth_json