From MediaWiki.org
Jump to navigation Jump to search
Other languages: English

GET Request to search for a language in any script by its name, ISO code or native name.

API documentation[edit]


(main | languagesearch)
  • This module requires read rights.
  • Source: UniversalLanguageSelector
  • License: GPL-2.0-or-later

Search for language names in any script.


Search string.

This parameter is required.

Number of spelling mistakes allowed in the search string.

Type: integer
Default: 1


GET Request[edit]


    "languagesearch": {
        "gu": "gujarati",
        "gaa": "ga",
        "gn": "guarani",

Sample code[edit]




    MediaWiki Action API Code Samples
    Demo of `Languagesearch` module: Search for a language in any language
    MIT license

import requests

S = requests.Session()

URL = "https://en.wikipedia.org/w/api.php"

LANG_NAME = "Gu" #Could be name of the language, its iso code or native name


R = S.get(url=URL, params=PARAMS)
DATA = R.json()


Demo app(s)[edit]

  • Screenshot of Universal Language Selector tool that uses this API
    Primarily used by the Extension:UniversalLanguageSelector that allows users to select a language and configure its support in an easy way.
  • Telegram translation bot that accepts input via chat message for language selection. Link to the code using the API is here.

Possible errors[edit]

Code Info
nosearch The "search" parameter must be set

Additional notes[edit]

  • Internally, this API stores a very long list of language names in many different languages. The major source for this list is Common Locale Data Repository along with a few manual additions.

See also[edit]