Get Multi-language List Interface

Retrieve a list of all available languages in the system, including language identifiers, icons, links, etc., for the multi-language site switching feature.

Precautions

  • This interface uses the GET method
  • No authentication or special permissions are required
  • Return all configured language information in the system
  • Contains the current language identifier and switch link
  • Used for language switching functionality on multilingual sites

Request address

{域名地址}/api/languages

Description:{域名地址}Need to replace it with your domain address, such ashttps://en.anqicms.com/api/languages

Request syntax

GET {域名地址}/api/languages

Request Parameters

None

Return parameters

Field Name Type Description
code integer Error code
message string Error Description
data object[] Language list

data Parameter

Field Name Type Description
id integer Site ID
name string Site Name
language_icon string Language icon
language_emoji string Language symbol
Language name string Language Name
language string Language Identifier
is_current bool Is it the current language
link string Language switch link

Example Usage

Request Example

GET /api/languages HTTP/1.1
Host: www.anqicms.com

Response Example

{
  "code": 0,
  "data": [
    {
      "id": 1,
      "name": "简体中文",
      "language_icon": "https://en.anqicms.com/uploads/language/zh-cn.png",
      "language_emoji": "🇨🇳",
      "language_name": "简体中文",
      "language": "zh-cn",
      "is_current": true,
      "link": "https://en.anqicms.com/zh-cn/"
    },
    {
      "id": 2,
      "name": "English",
      "language_icon": "https://en.anqicms.com/uploads/language/en.png",
      "language_emoji": "🇺🇸",
      "language_name": "English",
      "language": "en",
      "is_current": false,
      "link": "https://en.anqicms.com/en/"
    },
    {
      "id": 3,
      "name": "日本語",
      "language_icon": "https://en.anqicms.com/uploads/language/ja.png",
      "language_emoji": "🇯🇵",
      "language_name": "日本語",
      "language": "ja",
      "is_current": false,
      "link": "https://en.anqicms.com/ja/"
    }
  ],
  "msg": ""
}

Error response example

{
  "code": -1,
  "msg": "系统错误"
}

Error Code

Error code Description
0 OK
-1 Error, the reason is indicated in msg
1001 Not logged in
1002 Unauthorized
200 API request OK