首页 » Python » python调用百度api的基本账户信息

python调用百度api的基本账户信息

 

参考:
http://dev2.baidu.com/newdev2/dist/index.html#/content/?pageType=1&productlineId=3&nodeId=401&pageId=295&url=
https://blog.csdn.net/weixin_41004350/article/details/78705415
https://blog.csdn.net/baidu_41871794/article/details/83904024

1
2
3
4
5
6
7
8
9
10
11
12
13
import requests,json
url = "https://api.baidu.com/json/sms/service/AccountService/getAccountInfo"
data = {"header":{
"username":"账户名",
"password":"密码",
"token":"你申请的token"
},
"body":{
"accountFields":["budget","balance"]
}
}
response = requests.post(url,json.dumps(data))
print(response.text)

原文链接:python调用百度api的基本账户信息,转载请注明来源!

1