MediaWiki Get Template Data icon

MediaWiki Get Template Data

Retrieve template data from a MediaWiki page

MediaWiki Get Template Data

AI-generated

Summary

Fetches a MediaWiki page's current wikitext and extracts the named parameters of a specified template as a key/value object. Logs in with bot credentials before reading the page.

Inputs

  • Wiki URL — Overrides the site URL from credentials. '/api.php' is appended if not already present.
  • Page Title (required) — Title of the wiki page containing the template.
  • Template Name (required) — Name of the template to find. Matching is case-insensitive and finds the first occurrence of {{Name| or {{Name}}.
  • Options > Error If Not Found — Defaults to true. If true, throws when the template isn't on the page. If false, returns found: false with empty data.

Output shape

One output item per input item, with json containing pageTitle, templateName, found (boolean), and data (object mapping parameter names to trimmed string values).

Only named parameters (name=value) are captured; positional/unnamed parameters are ignored. Values are raw wikitext, so nested templates and links stay unparsed. A nonexistent page always throws an error. A page with no revisions yields empty content, so the template counts as not found. With Continue On Fail enabled, failed items return json.error. Each execution authenticates via the bot login flow using the mediaWikiApi credentials (siteUrl, botUsername, botPassword).

Examples

Example 1: Read infobox fields from a wiki article

Page Title: 'Paris', Template Name: 'Infobox settlement'; use data.population etc. downstream.

Example 2: Check whether a page uses a template without failing the workflow

Set Error If Not Found to false and branch on the 'found' field.

Example 3: Query a different wiki with the same bot credentials

Wiki URL: https://other.wiki.example.com, Page Title and Template Name set via expressions.

Links

Discussion