PCGamingWiki:API
From PCGamingWiki, the wiki about fixing PC games
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.
Examples:
- Find PCGW page(s) using the SMW property Steam AppID:
https://www.pcgamingwiki.com/w/api.php?action=askargs&conditions=Steam_AppID::863550&format=jsonfm
- Retrieve all populated SMW properties for a single page:
https://www.pcgamingwiki.com/w/api.php?action=browsebysubject&subject=Hitman_2&format=jsonfm
Hitman_2
was retrieved using the previous example query.#0#
at the end of thesubject
key represents the MediaWiki namespace the page resides under, see the siteinfo API action for the details.#0#
refers to the main namespace of the site.
- Retrieve specific populated SMW properties for a single page retrieved using the the SMW property Steam AppID:
https://www.pcgamingwiki.com/w/api.php?action=askargs&conditions=Steam+AppID::863550&printouts=4K_Ultra_HD%7CUltra-widescreen%7CPublished_by&format=jsonfm
- This example retrieves the 4K Ultra HD, Ultra-widescreen, and Published by SMW properties.
%7C
is an URL encoded|
that is used to separate multiple specified properties to retrieve.
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
Examples:
- Steam App ID:
https://www.pcgamingwiki.com/api/appid.php?appid=674020