我使用Instagram API从标签列表中检索所有照片。从今天开始,我已经达到了API的速率限制(尤其是429错误)。为了调试这个,我一直在尝试如何获取每小时剩余的调用数,并将其合并到脚本中。在
InstagramAPI说,你可以通过HTTP头访问一小时内剩余的调用数,但我不确定如何在Python中访问它。在
The following fields are provided in the header of each response and their values are related to the type of call that was made (authenticated or unauthenticated):
X-Ratelimit-Remaining: the remaining number of calls available to your app within the 1-hour window
X-Ratelimit-Limit: the total number of calls allowed within the 1-hour window
http://instagram.com/developer/limits
如何在Python中访问这些数据?在
基于其他一些答案,我认为这是一个更奇特的解决方案,但经过一番研究,我找到了一个非常简单的解决方案!在
相关问题 更多 >
编程相关推荐