Difference between revisions of "PCGamingWiki:API"

From PCGamingWiki, the wiki about fixing PC games
m (updated page and included mention of MediaWiki API)
Line 1: Line 1:
Our API allows us to link any Steam ID to the relevant PCGamingWiki page.
+
''This page might not be updated to reflect all available API endpoints or functionality.''
 +
 
 +
===MediaWiki API===
 +
{{ii}} As the PCGamingWiki is based on MediaWiki, the built-in [https://www.mediawiki.org/wiki/API:Main_page MediaWiki API] can be used to access a lot of data. MediaWiki extensions we use, such as [https://www.semantic-mediawiki.org/wiki/Help:API Semantic MediaWiki] and [https://www.mediawiki.org/wiki/Extension:Cargo/Exporting_data#API Cargo], also exposes their own API actions through the MediaWiki API.
 +
{{ii}} The [[Special:ApiSandbox|API Sandbox]] can be helpful in figuring the API out.
 +
{{++}} If you want to retrieve the Semanic MediaWiki properties (e.g. cover image, developer, publisher, release date, etc) of a page, the {{Code|browsebysubject}} API action is currently the most relevant one if you know the page name. See [https://www.pcgamingwiki.com/w/api.php?action=browsebysubject&format=json&subject=NieR%3A%20Automata this example] ([https://www.pcgamingwiki.com/wiki/Special:ApiSandbox#action=browsebysubject&format=json&subject=NieR%3A%20Automata sandbox])
 +
 
 +
===Redirect API===
 +
{{ii}} Our custom redirect API allows us to redirect incoming users using any Steam ID to the relevant PCGamingWiki page.
 +
{{mm}} [https://github.com/PCGamingWiki/api Source code]
 +
{{ii}} '''Example''' {{Pre|1=https://pcgamingwiki.com/api/appid.php?appid=674020}}
 +
 
  
https://github.com/PCGamingWiki/api
 
  
https://pcgamingwiki.com/api/appid.php?appid=674020
 
 
[[Category:PCGamingWiki]]
 
[[Category:PCGamingWiki]]

Revision as of 08:16, 8 April 2020

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 can be used to access a lot of data. MediaWiki extensions we use, such as Semantic MediaWiki and Cargo, also exposes their own API actions through the MediaWiki API.
The API Sandbox can be helpful in figuring the API out.
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)

Redirect API

Our custom redirect API allows us to redirect incoming users using any Steam ID to the relevant PCGamingWiki page.
Source code
Example
https://pcgamingwiki.com/api/appid.php?appid=674020