为了进行学校研究,我需要从这个API获取数据。但当我尝试使用它时,我得到错误代码401(未经授权),你们知道我做错了什么吗?
我正在使用Python3.6来实现这一点。
代码:
import clearbit
import urllib.request
from requests import session
payload = {
'action':'Login',
'Email': '<login mail>',
'Password': '<passwd>'
}
clearbit.key = '<My key>'
with session() as c:
c.post('https://dashboard.clearbit.com', data=payload)
response = c.get('https://company.clearbit.com/v1/domains/find?name=bseni')
print(response.text)
希望你们能帮我解决这个问题。 文档:https://clearbit.com/docs#name-to-domain-api
您需要设置API密钥,您可以在clearbit网站上获得您的配置文件(您需要注册,它是免费的)。 应该是这样的:
相关问题 更多 >
编程相关推荐