Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

Difference between revisions of "PCGamingWiki:API"

From PCGamingWiki, the wiki about fixing PC games
m (minor changes)
m (updated redirect API to mention GOG and WineHQ as well)
Line 9: Line 9:
  
 
===Redirect API===
 
===Redirect API===
{{ii}} Our custom redirect API allows us to redirect incoming users using any Steam ID to the relevant PCGamingWiki page.
+
{{ii}} Our custom redirect API allows us to redirect incoming users using any registered GOG ID, Steam App ID, or WineHQ ID to the relevant PCGamingWiki page.
 
{{mm}} [https://github.com/PCGamingWiki/api Source code]
 
{{mm}} [https://github.com/PCGamingWiki/api Source code]
{{ii}} '''Example''' {{Pre|1=https://pcgamingwiki.com/api/appid.php?appid=674020}}
+
{{ii}} '''GOG ID example:''' {{Pre|1=https://www.pcgamingwiki.com/api/gog.php?page=1785384169}}
 +
{{ii}} '''Steam App ID example:''' {{Pre|1=https://www.pcgamingwiki.com/api/appid.php?appid=674020}}
 +
{{ii}} '''WineHQ example:''' {{Pre|1=https://www.pcgamingwiki.com/api/winehq.php?appid=15482}}
  
 
__NOTOC__ __NOEDITSECTION__ [[Category:PCGamingWiki]]
 
__NOTOC__ __NOEDITSECTION__ [[Category:PCGamingWiki]]
  
 
 
 
 

Revision as of 19:55, 11 November 2020

API

This page might not be updated to reflect all available API endpoints or functionality.

MediaWiki API

As the PCGamingWiki is based on MediaWiki, the built-in MediaWiki API endpoint can be used to access a lot of data. Some MediaWiki extensions we use such as Semantic MediaWiki and Cargo also exposes their own API actions through the MediaWiki API.
If you want to retrieve the Semanic MediaWiki properties (e.g. cover image, developer, publisher, release date, etc) of a page, the browsebysubject API action is currently the most relevant one if you know the page name. See this example (sandbox).
The API Sandbox can be helpful in figuring the API out.
Example (JSON)
https://www.pcgamingwiki.com/w/api.php?action=browsebysubject&format=json&subject=NieR%3A%20Automata

Redirect API

Our custom redirect API allows us to redirect incoming users using any registered GOG ID, Steam App ID, or WineHQ ID to the relevant PCGamingWiki page.
Source code
GOG ID example:
https://www.pcgamingwiki.com/api/gog.php?page=1785384169
Steam App ID example:
https://www.pcgamingwiki.com/api/appid.php?appid=674020
WineHQ example:
https://www.pcgamingwiki.com/api/winehq.php?appid=15482