API

Search API

  • Request
  • POST /api/v1/search HTTP/1.1
    Host: i18ns.com
    Content-Type: application/json
    x-access-token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    {
    	"language":"en",
    	"content":"settings"
    }
    
    Name Description
    Method POST
    Url https://i18ns.com/api/v1/search
    x-access-token api access token, click here to get it.
    post body language: search language. [en, zh, es, fr, ar, pt, ru, ja, ko, de, it]
    content: search content.
    limit To prevent API abuse, this api limit 150/minute, 2000/day.
    In the case of proper use, if it is not enough, I can increase your request limit if the server load allows. [email protected]
  • Response
  • return top 20 best match results
    [
            {
                "format": 0,
                "translations": {
                    "ar": ["الإعدادات"],
                    "de": ["Einstellungen"],
                    "en": ["Settings"],
                    "es": ["Ajustes"],
                    "fr": ["Paramètres"],
                    "ja": ["設定"]
                }
            },
            {
                "format": 0,
                "translations": {
                    "ar": ["الإعدادات"],
                    "de": ["EINSTELLUNGEN"],
                    "en": ["SETTINGS"],
                    "es": ["AJUSTES"],
                    "fr": ["PARAMÈTRES"],
                    "zh": ["设置"]
                }
            },
            ...
    ]
    
    Field Description
    format current item translations format:
    0: single string;
    1: plural string; more about language plural rules is here
    translations translations content.
    when format is 0, only one string in the array:
    "translations": {
       "ar": ["الإعدادات"], // Arabic translations.
       "de": ["EINSTELLUNGEN"],// German translations.
       "en": ["SETTINGS"], // english translations.
       "es": ["AJUSTES"],   // Spanish translations.
       "fr": ["PARAMÈTRES"], // French translations.
       "zh": ["设置"]        // chinese  translations.
    }
                                    
    if format is 1, plural translations are placed with a fixed order in the array:
    "translations": {
        en:[
            "xx",//"other":
            "xx",//"zero":
            "xx",//"one":
            "xx",//"two":
            "xx",//"few":
            "xx"//"many":
        ]
        ...
    }
    
  • A request -> response demo
  • request(replace the x-access-token with you own access-token please.)
    POST /api/v1/search HTTP/1.1
    Host: i18ns.com
    Content-Type: application/json
    x-access-token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    {
    	"language":"en",
    	"content":"%s days"
    }
    
    response:
    [
            {
                "format": 1,
                "translations": {
                    "ar": [
                        "%s أيام",
                        "%s أيام",
                        "%s يوم",
                        "%s أيام",
                        "%s أيام",
                        "%s أيام"
                    ],
                    "da": [
                        "%s dage",
                        "%s dage",
                        "%s dag",
                        "",
                        "",
                        ""
                    ],
                    "de": [
                        "%s Tage",
                        "%s Tage",
                        "%s Tag",
                        "",
                        "",
                        ""
                    ],
                    "en": [
                        "%s days",
                        "%s days",
                        "%s day",
                        "",
                        "",
                        ""
                    ],
                    "es": [
                        "%s días",
                        "%s días",
                        "%s día",
                        "",
                        "",
                        ""
                    ],
                    "es_ES": [
                        "%s días",
                        "%s días",
                        "%s día",
                        "",
                        "",
                        ""
                    ],
                    "fr": [
                        "%s jours",
                        "%s jours",
                        "%s jour",
                        "",
                        "",
                        ""
                    ],
                    "it": [
                        "%s giorni",
                        "%s giorni",
                        "%s giorno",
                        "",
                        "",
                        ""
                    ],
                    "ja": [
                        "%s日",
                        "%s日",
                        "",
                        "",
                        "",
                        ""
                    ],
                    "ko": [
                        "%s 일",
                        "%s 일",
                        "",
                        "",
                        "",
                        ""
                    ],
                    "pl": [
                        "%s dni",
                        "%s dni",
                        "%s dzień",
                        "",
                        "%s dni",
                        "%s dni"
                    ],
                    "pt": [
                        "%s dias",
                        "%s dias",
                        "%s dia",
                        "",
                        "",
                        ""
                    ],
                    "pt_BR": [
                        "%s dias",
                        "%s dias",
                        "%s dia",
                        "",
                        "",
                        ""
                    ],
                    "ru": [
                        "%s дней",
                        "%s дней",
                        "%s день",
                        "",
                        "%s дня",
                        "%s дней"
                    ],
                    "vi": [
                        "%s ngày",
                        "%s ngày",
                        "",
                        "",
                        "",
                        ""
                    ],
                    "zh": [
                        "%s天",
                        "%s天",
                        "",
                        "",
                        "",
                        ""
                    ],
                    "zh_CN": [
                        "%s天",
                        "%s天",
                        "",
                        "",
                        "",
                        ""
                    ],
                    "zh_HK": [
                        "%s天",
                        "%s天",
                        "",
                        "",
                        "",
                        ""
                    ],
                    "zh_TW": [
                        "%s天",
                        "%s天",
                        "",
                        "",
                        "",
                        ""
                    ]
                }
            },
            {
                "format": 0,
                "translations": {
                    "ar": [
                        "%s يوم"
                    ],
                    "bg": [
                        "%s дни"
                    ],
                    "cs": [
                        "%s dní"
                    ],
                    "da": [
                        "%s dage"
                    ],
                    "zh": [
                        "%s 天"
                    ],
                    "zh_HK": [
                        "%s 天"
                    ],
                    "zh_TW": [
                        "%s 天"
                    ]
                }
            },
            ...
    ]