• The VOIDRUNNER'S CODEX is LIVE! Explore new worlds, fight oppressive empires, fend off fearsome aliens, and wield deadly psionics with this comprehensive boxed set expansion for 5E and A5E!

Exclusive details on the DDI API (not a repeat...)

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]
 

log in or register to remove this ad


tomBitonti

Adventurer
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.

That %20 is the escaping of a space in a URI. See RFC 1630 for more details, or check out any of many references online (e.g. 4.1.2. Unsafe characters)

You might want to be careful before going too far down the line of figuring out the APIs. As soon as they include access protection, or if they may be considered reverse engineering, that might subject you to the DMCA. You might also have to deal with issues of unauthorized access if those aren't a part of a public API.

I'd have to do some research figure out what is allowed or not. This is probably a good opportunity to invest in understanding the DMCA, as well as finding out the WotC policy for how one is allowed to access their web site.

Thx!

TomB
 

Asmor

First Post
That %20 is the escaping of a space in a URI. See RFC 1630 for more details, or check out any of many references online (e.g. 4.1.2. Unsafe characters)

I know... That would be why I escaped it thusly. :p

You might want to be careful before going too far down the line of figuring out the APIs. As soon as they include access protection, or if they may be considered reverse engineering, that might subject you to the DMCA. You might also have to deal with issues of unauthorized access if those aren't a part of a public API.

I'd have to do some research figure out what is allowed or not. This is probably a good opportunity to invest in understanding the DMCA, as well as finding out the WotC policy for how one is allowed to access their web site.

Thx!

TomB

For a variety of reasons, I'm both not worried about any legal issues and also not worried about them taking umbrage with this use. In fact, I have good reason to believe that this is exactly what they're intending.

Of course, if they do have a problem they can email me and I'll take down anything at their request. But I seriously doubt that's going to happen.
 

Scribble

First Post
Nice work... I've been waiting for the gaming in code part two... But you beat him to it! :)

Also your monster make just got more awesomer. :)
 




wayne62682

First Post
I thnk wotc should publish a developer API or something. I have a really great idea fir an iPhone app for D&D gamers - the only thing stopping me from seriously working on it is that I would like to be able to query for info.

You know what I would really like? A way to have someones character info from the character builder made available via web site, like the character sheet hosting that some sites provided in 3.x. If I could prompt someone for their DDI account and then grab parts of their character info to use in my app that would be awesome.
 

malraux

First Post
I thnk wotc should publish a developer API or something. I have a really great idea fir an iPhone app for D&D gamers - the only thing stopping me from seriously working on it is that I would like to be able to query for info.

You know what I would really like? A way to have someones character info from the character builder made available via web site, like the character sheet hosting that some sites provided in 3.x. If I could prompt someone for their DDI account and then grab parts of their character info to use in my app that would be awesome.

Something like http://iplay4e.appspot.com/characters
 

Voidrunner's Codex

Remove ads

Top