
I wrote a simple bit of code to "throttle" my API calls (built into my API wrapper: I call it AFTER each API call. I know it's akward passing the URL of the last call. But using a getter for that would have been overly pedantic IMO.
// I set StartFrame in the objects' constructor.
$this->StartFrame = time() +1;
| public function throttle ($LastURL) {
| $this->getRateHeaders ($LastURL);
|
| if ($this->getRemaining() == 0) {
| $this->StartFrame += $this->getWindow() + 1;
| //time_sleep_until($this->StartFrame);
| }
| }
I have NOT yet tested this, because my allowed rate is 1, until they approve my app. Insha Allah today. It would have been nice if the API also returned how much time was left until the end of the frame...
Harald Tveit Alvestrand I've approved the app but given the content of what you're working on, I STRONGLY recommend you write a privacy policy and include its URL in your application configuration.
Michael Shalom Fagan I've approved your app, which increases its rate limit to 40 queries every 10 seconds.
Mike Stangel Aw sorry, it would have to be virtual. As a parent and full-time employee outside the genealogy field, that's not really an option for me :)