Path of Exile Wiki:Data query API

Overview
Just like other wikis the Path of Exile wiki can be accessed through the Mediawiki API. This allows for much faster page editing as well as data retrieval.

Cargo is a type of database used to store interesting values in various items, mods, versions etc. as rows in cargo tables. The stored values can then be used to execute powerful queries and retrieve fields from cargo tables. The syntax is similar to MySQL or SQL because it uses MySQL at its core.

The API documentation for querying Cargo tables can be found here.

Using the API to retrieve Path of Exile data
If you need certain data such as item or mod data for your tools it is highly advised to use the cargo API to retrieve it. It will be much faster than scraping the wiki pages and will significantly reduce the overhead on both your script and the wiki server.

When using tables, it's advisable to check the related module or template documentation. You can also check CargoTables to see cargo tables or hit "Page values" in the Toolbar to see the currently set cargo values on the page. Queries can also be made from the CargoQuery page.

Cargo data
Following things are exposed via the cargo API (list may be incomplete, please check CargoTables for the full list)


 * Items via Template:Item
 * Area data via Template:Area
 * Modifier data via Template:Mod
 * Version & dates via Template:Version
 * Bestiary recipes via Template:Bestiary
 * Skill data via Template:Skill

cargoquery
This will return a json list containing the first 5 distinct names of unique items.

Breakdown:

You can search for containment using searches where=name LIKE string.

At the time of writing, running this query will return a json like this: {   "cargoquery": [ {           "title": { "name": "Arakaali's Fang" }       },        {            "title": { "name": "Bino's Kitchen Knife" }       },        {            "title": { "name": "Bloodplay" }       },        {            "title": { "name": "Divinarius" }       },        {            "title": { "name": "Fragment of Eternity" }       }    ] }

Dealing with multiple tables on the same page
A lot of the wiki is setup with multiple tables that have 1:1 or 1:N relationships. If there isn't any particular key in the table, you generally you want to perform a JOIN query on the two tables, using the hidden row _pageID of both tables.

For example getting the skill levels and experience for :

Can be done through the API like this:

It's highly advised to check the template documentation about the fields and tables available.

Offset a limited query
If you have a query that yields more results than the query limit it is possible to offset the results by using the  parameter.

For example getting the next 5 skill levels and experience for :

Can be done through the API like this:

Grouping by field
The results can be grouped up with respect to the field. Continuing the example

Can be done through the API like this:

ru:Path of Exile Wiki:Data query API