Module:JSON data/documentation

Hello, you have come here looking for the meaning of the word Module:JSON data/documentation. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:JSON data/documentation, but we will also tell you about its etymology, its characteristics and you will know how to say Module:JSON data/documentation in singular and plural. Everything you need to know about the word Module:JSON data/documentation you have here. The definition of the word Module:JSON data/documentation will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:JSON data/documentation, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This module is intended to be used by bots or other automation tools which need to access Wiktionary data. This is not a general-purpose JSON serialisation module. Using one would be impractical, as experiments have shown that using one on the language data easily hits execution limits.

Bots may access the data by using mw:API:Expandtemplates or requesting the raw source of a page invoking this module with a &templates=expand query parameter.

Make sure you only load this module once (or twice, if you need both the languages table and another table). Generating the JSON data takes a few seconds and puts a relatively high strain on the servers.

Available functions are: export_languages, export_scripts and export_families, which generate the JSON equivalents of Module:languages, Module:scripts and Module:families respectively. The structure of the data corresponds exactly to the one used in Wiktionary modules, with a caveat below.

When export_languages is given positional arguments:

  • The first specifies the types of languages (see Template:language data documentation) that will be listed in the data. The special values TWO_LETTER, TWO_THREE_LETTER and TWO_THREE_LETTER_REGULAR can be passed. For example, invoking the function with TWO_LETTER, 1 and 4 as arguments will export the canonical names and script codes for languages with two-letter codes.
  • The following arguments list data keys which will be exported. To conserve space, if only one key is specified, its value is listed directly in the root object (indexed by language codes).

Examples:

{{#invoke:JSON data|export_languages||ancestors|3}}

This will return the ancestors and language family for every language. (See Template:language data documentation for an explanation of numbers 1 to 4.)

{{#invoke:JSON data|export_languages|TWO_LETTER}}

This will return all available info for two-letter language codes. (Note, this is currently broken and returns a Lua error.)