Jump to content

API Rate Limit String


AndrewFerrara

Recommended Posts

Alight, I'm trying to figure out the error string for an api

http://www.haloreachapi.net/wiki/API_rate_limits

 

The wiki says the limit is 300rpm

 

I tried to run this in two tabs on my browser still won't give me the error string, how can it be done faster?

 

P.s. Api key will be changed in the near future don't waste your time..

 


<?php

$gamertag = "l RaH l";
$url = "http://www.bungie.net/api/reach/reachapijson.svc/game/metadata/30cRxVA9J73esG388CzmOXUVRo5VjYhSfI2qBaqcMzs=";

$t_start = microtime(true);
for($i = 0; $i < 301; $i++) {
$file = file_get_contents($url);
echo "Iteration ".($i + 1)."<br>\n";
}

$exectime = microtime(true) - $t_start;
echo "Execution time: " . round($exectime, 4) . "<br><br>\n\n";
$json = json_decode($file, 1);
print_r($json);


?>

 

Link to comment
https://forums.phpfreaks.com/topic/226177-api-rate-limit-string/
Share on other sites

How about three tabs?  How long does each request take?  Eg if each request takes 0.5 seconds on average, you'll need three tabs to make 300 requests in a minute.

 

You can do the requests in parallel in php but that's much trickier than just running multiple copies of the script.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.