Failing API Calls

90 Pandaren Monk
This code is timing out, worked fine the other day. Not sure if its my site host or if I am being throttled? Is there a way to tell?

$htmlScrap = file_get_contents('');
echo htmlScrap;


Warning: file_get_contents( failed to open stream: Connection timed out in ********/wowapi.php on line 2 NULL
Reply Quote
100 Dwarf Mage
According to the API docs, you should receive a 500 response code with a JSON response body containing the "If at first you don't succeed, blow it up again. (too many requests)" reason when you're being throttled.

This indicates that it's probably your host, but I can't say for sure what your application's current status with the API is.
Reply Quote
90 Pandaren Monk
Yeah I created a support ticket with my host about this issue.

I should have checked github, appreciate the response.

Currently in development mode. Well under 3k requests per day for anonymous use. Which made me curious how I could be throttled but... as you said probably the host.
Reply Quote Developer
Yeah, if you are getting timeouts than the issue is not anything to do with our API code. Either you're being blocked by our server admins (VERY unlikely, for all of the sites I've checked about this I've NEVER seen it be an issue), or your ISP or their ISP is blocking the calls for some reason. Often dev work can trigger their (horrible) filters.
Edited by Peratryn on 3/27/2013 2:00 PM PDT
Reply Quote
99 Draenei Hunter
If your getting timeouts today it might be because of the massive ddos going on.
Reply Quote
100 Night Elf Hunter
i would also try usuing a curl call some times file_get_contents just failes for me but curl get results
Reply Quote
27 Undead Warrior
By the way i am having the same problem with outland in Europe, my host is wiredtree. I try to port to CURL because i am using file get contents too...
Reply Quote
100 Dwarf Hunter
<?php echo ini_get('allow_url_fopen'); ?>

If it writes out '0', then your webhost has disabled the ability to use remote files in fopen() (and many other file-related functions, including file_get_contents), possibly as some form of security measure. Using curl is a good alternative for handling HTTP requests, as it does error handling much better by default.
Edited by Yuyn on 3/27/2013 3:18 PM PDT
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Explain (256 characters max)