Robinhood是否仍支持其API。我不断收到登录失败错误。这是我尝试过的:
导入请求
def login():
u = "myusername"
p = "mypassword"
url = "https://api.robinhood.com/api-token-auth/"
data = {"username": u, "password": p}
r = requests.post(url, json=data)
return r.text
print login()
我也没有在Github上尝试大多数“ Python API包装器”。
答案 0 :(得分:1)
尝试一下:
import requests
def login():
username = 'username'
password = 'password'
header = {"Accept": "application/json"}
data = {"client_id": "c82SH0WZOsabOXGP2sxqcj34FxkvfnWRZBKlBjFS",
"expires_in": 86400,
"grant_type": "password",
"password": "pword",
"scope": "internal",
"username": "uname"}
url = "https://api.robinhood.com/oauth2/token/"
r = requests.post(url, data=data, headers=header)
return r.text
print(login())