ropensci/aRxiv

Do we really need to wait 3 sec between API requests?

Closed this issue · 3 comments

The arXiv API user manual says to include a 3 second delay between API requests:

In cases where the API needs to be called multiple times in a row, we encourage you to play nice and incorporate a 3 second delay in your code. The detailed examples below illustrate how to do this in a variety of languages.

This seems unnecessarily long and will really slow down the package tests.

I'm using 3 seconds as the default, but then in the tests and examples I'm using a 0.5 second delay. Am I wrong to speed up the tests in this way?

No this seems fine to me. 3 seconds in unusually long between single requests. Most APIs have x requests per y time. Often it's like 300-1000 requests per minute. 20 requests per minute is ridiculously now. I say it's fine to go with something lower.

Cool. I'll stick with the 3 sec default, but will explain in the tutorial how to change it (with appropriate caveats) and will continue to use 0.5 sec in the tests.

(rplos::searchplos uses 6 sec.)

@kbroman PLOS imposes/suggests a time limit in between calls. See here http://api.plos.org/solr/faq/