First: is it needed/require/sudgested to sleep between API queries within a program loop ?
Second: is there a way to check how many queries of my daily budget I spent ?
For your first question, you got it. I also recently wrote some mock code to demonstrate an example loop that sleeps when it reaches the bucket limit. You can check it out here.
With regards to your second question, yes, the API stats page is a good insight into what's happening but there isn't really a "daily budget" so to speak. We really only enforce things 10 seconds at a time. As per the links above, you can inspect the bucket you are currently in by looking at the X-RateLimit-Remaining header.
LucaZetaからの返信
投稿:2018年11月25日 2:17 AM
Answering by myself:
First: 40 requests within 10 seconds are allowed. Since time to answer a request is averange grater than 0.5s no sleep is required. Source.
Second: hear it is
Travis Bellからの返信
投稿:2018年11月25日 11:28 AM
For your first question, you got it. I also recently wrote some mock code to demonstrate an example loop that sleeps when it reaches the bucket limit. You can check it out here.
With regards to your second question, yes, the API stats page is a good insight into what's happening but there isn't really a "daily budget" so to speak. We really only enforce things 10 seconds at a time. As per the links above, you can inspect the bucket you are currently in by looking at the
X-RateLimit-Remaining
header.