SotAWiki:API

Mediawiki has a public API. "But Fenyx4" you say "the MW API doesn't curate the data in a useful way for me!" No it doesn't. That is where SMW comes in. This is a benefit of Semantic mediawiki. SMW has a public api for getting data. You can query it here (for example recipe data) in a broad range of formats. As I am familiar with the data structure I will gladly help write queries. All I would ask in return for using our data is that they have somewhere on their site "data provided by SotAwiki.net" or somethin' like that.

Here is an example query that pulls the recipes into a csv file.

This is using Semantic MediaWiki to pull the info from the pages themselves. This page helps you craft the queries.

Here's some links for further reading; http://semantic-mediawiki.org/wiki/Help:Special:Ask http://semantic-mediawiki.org/wiki/Help:Result_formats

P.S. There is a limit to how many records can be retrieved from the API in any one call. We aren't near that limit yet but if you want to develop for the future the stuff below should help...

http://www.sotawiki.net/index.php?title=Special%3AAsk&q=%5B%5BHas+ingredient%3A%3A%2B%5D%5D&po=%3FHas+parent%3DItem%0D%0A%3FRequires+skill%3DSkill%0D%0A%3FHas+ingredient%3DRecipe%0D%0A&eq=yes&p%5Bformat%5D=csv&sort_num=&order_num=ASC&p%5Blimit%5D=500&p%5Boffset%5D=&p%5Blink%5D=all&p%5Bsort%5D=&p%5Bheaders%5D=show&p%5Bmainlabel%5D=Recipe+ID&p%5Bintro%5D=&p%5Boutro%5D=&p%5Bsearchlabel%5D=%E2%80%A6+further+results&p%5Bdefault%5D=&p%5Bclass%5D=sortable+wikitable+smwtable&eq=yes

That ups the limit to 500 (which gets all 158 that we currently have). We may eventually hit a max the server will serve up due for performance reasons and at that point we'll have to break it up into multiple queries with an offset (example below).

First 100

Offset by 100 for the rest

The Special:Browse page lets you see what properties an article has, so, for example Iron Halberd has these properties. That will let you look at the properties that are directly used by the kind of items you want to search for. But take special note of the "Has subobject" section. It may simply say "Iron Halberd" there a couple time but if you click on the plus it will pull up the recipe.

(Technical aside: Recipes had to be subobjects because otherwise the ingredients for two recipes for the same item would have bled together. This is why when you query for a recipe you don't get the final stats. But the recipe does have the actual item as its Has parent property. Which you can then query by to get the other attributes.)

You can also look at all the properties to look for ones you may not be aware of. But that can be a bit of informational overload.