Portable Infobox API

Portable infoboxes are a way to create infoboxes on Fandom using simplified XML markup. This page details how to interact with these infoboxes using MediaWiki's built-in APIs.
== Using the API ==
While there is no officially announced API for portable infoboxes, it is still possible to access some data related to them.
=== Listing all infoboxes ===
A list of all portable infoboxes on the wiki can be obtained by using the querypage API to access Special:AllInfoboxes, e.g.:
: /api.php?action=query&list=querypage&qppage=AllInfoboxes&qplimit=500&format=json
Note: this data is cached and may not be up to date.
=== Listing all pages with a specific infobox ===
One simple way to retrieve all pages with an infobox is to use the embeddedin API to retrieve all pages that transclude the template, e.g.:
: /api.php?action=query&list=embeddedin&eititle=Template:Infobox&eilimit=500&format=json
=== Listing all infoboxes on a page ===
To get data about the infoboxes on a specific page or group of pages, one can query the pageprops API:
It is important to note that the API returns the infobox data as a string, and not as JSON. As such the above code retrieves information about the given pages, and logs a stringified JSON array for each. Those arrays contain the information added to each infobox's tags, and will look something like this:
Actual output: /api.php?action=query&prop=pageprops&titles=AjaxRC&format=json
The sources array contains the parameter names used in the actual page and/or template.
Note that the data in the infobox is not saved as wikitext but rather as HTML, and wikitext like [[:Category:JavaScript]] is converted to:
<a href="/wiki/Category:JavaScript" title="Category:JavaScript">JavaScript</a>
== ==
* Help:Infoboxes
** Help:Infoboxes/Tags
** Help:Infoboxes/CSS
* Portability Hub
* Infoboxes are evolving
* The Future of Infoboxes on Wikia
* Tips and tricks
Category:API