JSON Item API for PTR Items

100 Night Elf Druid
Is there any chance of being able to query items from the PTR using the Blizzard API Item?

Or does anyone have ptr.wowhead.com XML to JSON converter already coded?
Reply Quote
100 Night Elf Hunter
we cannot access ptr items on the api only live items and profiles as for wowhead xml use xmltoarray then encode json ...
Reply Quote
100 Night Elf Hunter

function Parse ($url) {

$fileContents= file_get_contents($url);

$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);

$fileContents = trim(str_replace('"', "'", $fileContents));

$simpleXml = simplexml_load_string($fileContents);

$json = json_encode($simpleXml);

return $json;

Reply Quote
100 Night Elf Druid
Thanks for the reply, but I wasn't specifically interested in how-to do it, just if anyone had an existing application that mirrors the Blizzard JSON API for PTR items. The JSON format is so much nicer than the barf that the Wowhead "XML API" spits out.

Here is a very early release of my Wowhead PTR -> Blizzard JSON API translator:

Once I get more features implemented, I'll make it cache the results, but for the time being, don't use this URL for anything other than checking out the example, since some requests require me to pull multiple Wowhead pages to scrape the proper information.

Edit: this now has support for most items and has a cache to avoid spamming ptr.wowhead.com. You can navigate to an overview of the cached items by dropping the query string:

I also added support for "uniqueInfo" which indicates Unique-Equipped information, which is currently missing from the Blizzard API.
Edited by Edgy on 2/16/2013 9:12 PM PST
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)
Submit Cancel