There is such a thing, called network latency - the time spent on traveling by wire. It is very slow, and the longer the distance the slower (the speed of light). Even if we compare the speed of access to localhost and next to the same computer. The difference in request speed will be up to 20 ms.
I suspect steam hosts its api server at a considerable distance from your provider, i.e. Each request will cost you at best 100ms one way.
To drive back - 200ms (optimistic), this is for everyone! request to api . Simple math says that more than 5 queries per second can not be done.
Change the code to make less requests to api . Store information in session or cache ...
Cache - memcached , redis . These applications allow you to store data for a specific time (half an hour for example).
With the session harder, most will have to manage time.
Example:
<?php> // Псевдо код для понимания а не копирования!!! function getUserInfo($userId) { // Пробуем читать из кэша/сессии $userInfo = $cache->read("user_info_" . $userId); // Если в кэше нет if (!$userInfo) { // Читаем с api. $userInfo = $api->read("user_info_" . $userId); // Пишем в кэш на 30 минут $cache->write("user_info_" . $userId, $userInfo, 30); } // Возвращаем значение. return $userInfo; } // Пишем информацию о пользователе function setUserInfo($userId, $userInfo) { // Пишем новые значения в api. $api->write("user_info_" . $userId, $userInfo); // Пишем новые значения в кэш. Важно что бы небыло старых данных $cache->write("user_info_" . $userId, $userInfo, 30); }