Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Madan_Para's avatar

How to count the API calls ?

I have an application where i am using data from a public API and sending those data to a telegram channel. That Public API has a restriction that only 100 API calls per 5 minute per IP. Now, my question is - How to count API calls my application is making to that API ? Is there any solution so i can count that my application is calling the API no. of times per minute.

0 likes
3 replies
Sergiu17's avatar

Use throttle middleware

Route::group(['middleware' => 'throttle:100,5'], function () {
		//
});
ideepesh's avatar

@sergiu17 How to know about the number of calls made? If I have to show the number of calls made and the number of calls left then how can we do it?

Please or to participate in this conversation.