我从我的python脚本调用github api。如果运行成功,它将进行大约3000次调用。但是,在成功调用50-60次之后,它会显示以下消息-
{'message': "API rate limit exceeded for 108.169.151.47. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", 'documentation_url': 'https://developer.github.com/v3/#rate-limiting'}我已经阅读了文档。我没有任何可以注册的应用程序来获取客户端id和客户端密钥。从我的github帐户,我生成了一个令牌。我想知道是否可以用它来发送经过身份验证的请求。我尝试使用一些curl命令在git bash中通过我的github配置文件登录,然后运行python脚本,但它仍然显示相同的消息。
你能建议一种我如何利用信息中的好消息的方法吗?
发布于 2017-09-23 03:29:22
您可能希望考虑对您的GitHub username和password仅使用基本身份验证。接收到的响应应该转换为JSON。
req = requests.get(url, auth=(USERNAME, PASSWORD))
req_json = req.json()https://stackoverflow.com/questions/46144587
复制相似问题