Search code examples
mediawikimediawiki-apimediawiki-extensionsmediawiki-templates

Use OSM-Tags in Wikimedia-Template


I would love to be able to create templates in Wikimedia that get their variables filled from the tags of an OSM-feature.

Herefor I would provide an ID like n4741336025 and fetch the data from https://www.openstreetmap.org/node/4741336025

The tags coming from OSM could then simply be accessible as template-variables like {{{phone}}} or {{{website}}}.

The problem is: I have no idea how to get started. How can I even get a template to fetch data and then render?


Solution

  • You can get the data via OSM API like https://www.openstreetmap.org/api/0.6/node/4741336025 and use an extension like https://www.mediawiki.org/wiki/Extension:External_Data to grab and render the data.