Asmor
First Post
I've figured out some exclusive details on how to programatically query the compendium. Details on my blog.
[sblock=Copied and pasted, but I'm too lazy to redo it in BB code.]So to cut a short (but uninteresting) story even shorter, I stumbled onto a way to get XML results from Compendium searches, opening the door for people to run queries against the compendium programatically. For example, I’ve just updated my Monster Maker with the ability to search the compendium for monsters and import them (this was previously available, but more complicated as you had to save the monsters to an HTML file and then import that…).
So without further ado, here’s the key:
http://www.wizards.com/dndinsider/compendium/CompendiumSearch.asmx/KeywordSearch
You can query that URL using either GET or POST If you don’t know what those are, you’re probably best off using GET, which I’ll describe.
The two parameters which seem to be necessary are “Keywords” and “tab” (I don’t think case matters, but that’s the case I’m using and it works…). Keywords is what you’re searching for, and tab is the type of results you want.
For example, to search for mind flayers, you’d look up:
http://www.wizards.com/dndinsider/c...ywordSearch?Keywords=mind flayers&tab=Monster
Note that the space was escaped to %20. I’m pretty sure you can NOT replace spaces with +. I haven’t tried dashes or underscores.
And that brings up a nice little XML document ready to be fed into whatever silly machinery you’re working on.
Also note that each entry has an associated ID. You can use that ID to find the page for the specific element. In the case of monsters, you use…
http://www.wizards.com/dndinsider/compendium/monster.aspx?id=[insert ID here]
For example, the Mind Flayer Infiltrator is ID 339, so its page is
http://www.wizards.com/dndinsider/compendium/monster.aspx?id=339
The URLs for other elements are…
http://www.wizards.com/dndinsider/compendium/race.aspx?id=
http://www.wizards.com/dndinsider/compendium/class.aspx?id=
http://www.wizards.com/dndinsider/compendium/glossary.aspx?id=
http://www.wizards.com/dndinsider/compendium/deity.aspx?id=
http://www.wizards.com/dndinsider/compendium/item.aspx?id=
http://www.wizards.com/dndinsider/compendium/monster.aspx?id=
http://www.wizards.com/dndinsider/compendium/epicdestiny.aspx?id=
http://www.wizards.com/dndinsider/compendium/paragonpath.aspx?id=
http://www.wizards.com/dndinsider/compendium/ritual.aspx?id=
http://www.wizards.com/dndinsider/compendium/feat.aspx?id=
http://www.wizards.com/dndinsider/compendium/skill.aspx?id=
http://www.wizards.com/dndinsider/compendium/power.aspx?id=
For some info on actually running queries, check out Gaming in Code, a blog run by one of the guys working on DDI. I haven’t tested to make sure that all those filters and such actually work with this, but I strongly suspect they do.[/sblock]
[sblock=Copied and pasted, but I'm too lazy to redo it in BB code.]So to cut a short (but uninteresting) story even shorter, I stumbled onto a way to get XML results from Compendium searches, opening the door for people to run queries against the compendium programatically. For example, I’ve just updated my Monster Maker with the ability to search the compendium for monsters and import them (this was previously available, but more complicated as you had to save the monsters to an HTML file and then import that…).
So without further ado, here’s the key:
http://www.wizards.com/dndinsider/compendium/CompendiumSearch.asmx/KeywordSearch
You can query that URL using either GET or POST If you don’t know what those are, you’re probably best off using GET, which I’ll describe.
The two parameters which seem to be necessary are “Keywords” and “tab” (I don’t think case matters, but that’s the case I’m using and it works…). Keywords is what you’re searching for, and tab is the type of results you want.
For example, to search for mind flayers, you’d look up:
http://www.wizards.com/dndinsider/c...ywordSearch?Keywords=mind flayers&tab=Monster
Note that the space was escaped to %20. I’m pretty sure you can NOT replace spaces with +. I haven’t tried dashes or underscores.
And that brings up a nice little XML document ready to be fed into whatever silly machinery you’re working on.
Also note that each entry has an associated ID. You can use that ID to find the page for the specific element. In the case of monsters, you use…
http://www.wizards.com/dndinsider/compendium/monster.aspx?id=[insert ID here]
For example, the Mind Flayer Infiltrator is ID 339, so its page is
http://www.wizards.com/dndinsider/compendium/monster.aspx?id=339
The URLs for other elements are…
http://www.wizards.com/dndinsider/compendium/race.aspx?id=
http://www.wizards.com/dndinsider/compendium/class.aspx?id=
http://www.wizards.com/dndinsider/compendium/glossary.aspx?id=
http://www.wizards.com/dndinsider/compendium/deity.aspx?id=
http://www.wizards.com/dndinsider/compendium/item.aspx?id=
http://www.wizards.com/dndinsider/compendium/monster.aspx?id=
http://www.wizards.com/dndinsider/compendium/epicdestiny.aspx?id=
http://www.wizards.com/dndinsider/compendium/paragonpath.aspx?id=
http://www.wizards.com/dndinsider/compendium/ritual.aspx?id=
http://www.wizards.com/dndinsider/compendium/feat.aspx?id=
http://www.wizards.com/dndinsider/compendium/skill.aspx?id=
http://www.wizards.com/dndinsider/compendium/power.aspx?id=
For some info on actually running queries, check out Gaming in Code, a blog run by one of the guys working on DDI. I haven’t tested to make sure that all those filters and such actually work with this, but I strongly suspect they do.[/sblock]