Requests throttling (suggested API call rate)
What is the suggested maximum OneNote API call rate (API requests per second) over thousands of API requests - in order to NOT get throttled by the service.
Or, put it in another way, that is the minimum suggested interval between single OneNote API requests, in order to avoid throttling - over thousands of requests needed to be made?
I would implement this throttling in my client-side code, but any reasonable call rate I've experimented with, currently still leads to throttling, beyond 1000 requests performed.
My use case is this: I need to mass-import data from OneNote notebooks under an account, to a proprietary system database - including sections, subsections, information on each page and also the documents linked in each page. There are typically 5-7 documents per page, so these make up the bulk of the requests.
For many notebooks, the number of API requests reaches thousands. To avoid flooding the API and prevent throttling, I am experiementing with different rate limits (throttling in my client-side code). I started with 1 request per 1.5 seconds, then 1.8sec and am now up to 1 request per 2.2 seconds.
My code had made 1010 requests within 2200 seconds (interval of 2.178secs) and then started getting throttling errors.
What can I do to mitigate this issue? Thank you in advance.
Denis Z commented
Or API can send a Retry-After header for 429 response. At the moment I get 429 without any idea when it is safe to send next request. I have experimented, and sometimes I was able to send new request in a few seconds, another time I was waiting more then 30 minutes before next 200 response.