1
votes

I'm working with Steam Api and using this code to send queries the steam server, where $url is the query

$channel = curl_init();
curl_setopt($channel, CURLOPT_URL, $url);
curl_setopt( $channel , CURLOPT_RETURNTRANSFER , true );
$result = json_decode( curl_exec( $channel ), true );
curl_close($channel);

However, it only works about 50% of the time. The other half the time I get the error

Rejecting request for slow asset API server. 150 pending of 150 allowed

An example query I use is :

http://api.steampowered.com/ISteamEconomy/GetAssetPrices/v0001/?key=$SOME_API_KEY&appid=440&format=json

When the query goes through, I get all the correct data back.

Also, I have a similar problem when I specifically use the query GetAssetClassInfo() where I have to pass a list of class ids. Sometimes it works but other times it says

Unable to get appearance for app 440 classID 16891096 instanceID 0

Does any know what my problem is? Thanks for any help.

1

1 Answers

1
votes

I have worked with Valve's Web API and do have the same experience. It is sadly not something you can fix, Valve's API servers sometimes don't respond at all, sometimes they only respond slowly. It's an issue von Valve's end and has been for a while, and it gets worse when many people try to access the API (Steam sales, holidays, etc.).

If your API key or your query were invalid, it would tell you so and give other error messages.