Path of Exile Wiki:Data query API: Difference between revisions

From Path of Exile Wiki
Jump to navigation Jump to search
>Illviljan
mNo edit summary
>Illviljan
mNo edit summary
(No difference)

Revision as of 19:28, 19 September 2017

This page contains development information and is intended for developers and not regular end users.

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.

In addition the Semantic Mediawiki API can be used to execute powerful queries and retrieve properties from pages.

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 semantic API to retrieve it. It will be much faster then scraping the wiki pages and reduce the overhead significantly on both your script and the wiki server.

When using properties, it's advisable to check the documentation of the module or template that adds them or the page of the property. You can also check the list of all properties for some information. There's also Special:Browse where it is possible to see what properties a page have.

Items

All items on the wiki are exposed by Template:Item and are fully powered by semantic media wiki - this means you can query just about any property of an item to create convenient item lists.

Examples

Browse by subject

To take a look at what properties are available on the an item page you can use Special:Browse or the API equivalent browsebysubject, for example:

https://pathofexile.gamepedia.com/api.php?action=browsebysubject&subject=Rebuke%20of%20the%20Vaal

This will return a json list containing the properties and their associated values on the page Rebuke of the Vaal

Askargs

If you just need specific properties from a page you can use askargs - it takes a ask queries and properties as arguments, for example:

https://pathofexile.gamepedia.com/api.php?action=askargs&conditions=Has%20rarity::Unique%7CHas%20base%20item::Imbued%20Wand&printouts=Has%20name

This has a query with two conditions, it searches for any items that have the unique rarity (Has rarity::Unique) and that have a base item with the name "Imbued Wand" (Has base item::Imbued Wand).

For any results found, it will print out Property:Has name.