Answer the question
In order to leave comments, you need to log in
How to limit the number of requests per minute?
I extract data from VK. But VK complains that I am doing too many requests per second. How it is possible to bypass it?
In the code below, I first get the number of posts, how many times I need to offset and I already get the posts.
$piecesPosts = Yii::$app->vk->api('wall.get', array('owner_id' => '-10639516'));
$countPiecesPosts = $piecesPosts['response'][0];
$cp = $countPiecesPosts / 100;
$cp = ceil($cp);
for ($c = 0; $c < $cp; $c++) {
$coue = 99 * $c;
$getPosts = Yii::$app->vk->api('wall.get', array('owner_id' => '-10639516', 'count' => '99', 'offset' => $coue));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question