B
B
BonBon Slick2017-04-30 01:55:54
PHP
BonBon Slick, 2017-04-30 01:55:54

Steam Web API ERROR - HTTP request failed! HTTP/1.0 429 Unknown?

This line:

$appDetails = (json_decode(file_get_contents('http://store.steampowered.com/api/appdetails?appids=' . $app->appid)));

Sometimes gives an error:
file_get_contents(http://store.steampowered.com/api/appdetails?appids=564): failed to open stream: HTTP request failed! HTTP/1.0 429 Unknown

Although if you follow the link, it will be. {"564":{"success":false}}
That is, the request comes through if you manually drive it into the URL or reload the "parser" (checks all games). However, for some reason it returns an error for me.
Here is a more extended version of the code:
$apps = $this->steamService->getAllApps();
        foreach ($apps as $app) {
            sleep(3); // prevents steam api calls limits
            $appDetails = (json_decode(file_get_contents('http://store.steampowered.com/api/appdetails?appids=' . $app->appid)));

            $appId = $app->appid;
            //validate data
            if ($appDetails->$appId->success === TRUE && $appDetails->$appId->data->type === 'game' && $appDetails->$appId->data->is_free === FALSE && isset($appDetails->$appId->data->price_overview->initial) && $appDetails->$appId->data->price_overview->initial > 500) {
                $dbGameCheck = SteamGame::where('steam_appid', '=', $appDetails->$appId->data->steam_appid)->count();
                if ($dbGameCheck === 0) {
                    $data = [.....

I think it can increase the timing limit, although there are already 3 seconds for 1 request.
Why is that? How to fix?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question