Jump to content

API Issues


junotown
 Share

Recommended Posts

I have been trying to work the PC Gaming Wiki API as I have used it before but has something changed with the way the API works as I can't seem to get the information I previously was able to. 

Unsure whether the documentation is not updated but when I use this call (which is an example on the documentation):

https://www.pcgamingwiki.com/w/api.php?action=askargs&conditions=Steam+AppID::863550&printouts=4K_Ultra_HD|Ultra-widescreen|Published_by&format=jsonfm 

it brings back empty lists but on the Hitman 2 page there is listings for Publishers so it shouldn't be empty? 

Any help would be greatly appreciated, thanks!

Link to comment
Share on other sites

The site has migrated from using Semantic MediaWiki for backend data stuff to using Cargo instead, which is why your query does not return anything. Cargo is basically a wrapper around the underlying SQL database, so queries are more SQL-based than before.

Example:

https://www.pcgamingwiki.com/w/api.php?action=cargoquery&format=json&tables=Infobox_game,Video&fields=Infobox_game._pageID%3DPageID%2CInfobox_game.Steam_AppID,Video.4K_Ultra_HD,Video.Ultrawidescreen&join_on=Infobox_game._pageID%3DVideo._pageID&where=Infobox_game.Steam_AppID%20HOLDS%20%221245620%22

You can see all tables and what columns they include here: https://www.pcgamingwiki.com/wiki/Special:CargoTables

Link to comment
Share on other sites

12 hours ago, Aemony said:

The site has migrated from using Semantic MediaWiki for backend data stuff to using Cargo instead, which is why your query does not return anything. Cargo is basically a wrapper around the underlying SQL database, so queries are more SQL-based than before.

Example:

https://www.pcgamingwiki.com/w/api.php?action=cargoquery&format=json&tables=Infobox_game,Video&fields=Infobox_game._pageID%3DPageID%2CInfobox_game.Steam_AppID,Video.4K_Ultra_HD,Video.Ultrawidescreen&join_on=Infobox_game._pageID%3DVideo._pageID&where=Infobox_game.Steam_AppID%20HOLDS%20%221245620%22

You can see all tables and what columns they include here: https://www.pcgamingwiki.com/wiki/Special:CargoTables

Thank you for the help! Really appreciate it! Is there anywhere that I can keep track of any changes to the API if anymore were to occur?

Link to comment
Share on other sites

  • 2 weeks later...

We don't really have a mailing list or anything like that for the API or even changes in general, sadly. But it's not bound to change much at this point so should be fine to reconfigure everything based around Cargo API queries instead and then just let that be it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Found PCGamingWiki useful? Please consider making a Donation or visiting our Patreon.
  • Who's Online   2 Members, 0 Anonymous, 250 Guests (See full list)

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Forum Statistics

    1.8k
    Total Topics
    9.2k
    Total Posts
×
×
  • Create New...