Longdo Dictionary JSON API (Unofficial)

Search API that returns results in JSON

View on GitHub

About

This is an unofficial API for interfacing with Longdo Dictionary. Longdo offers a greate service for translating words from English to Thai and vice versa. However, Longdo only provides an API that returns result in HTML format. While this may work on websites, it is difficult to interface with the API on other platforms. As JSON is widely accepted in many areas, I decided to wrap that HTML respond from Longdo API in JSON. The service is hosted on Heroku. Source code can be found on Github.

Features and Statuses

  • Support NECTEC Lexitron EN-TH ___
  • Support NECTEC Lexitron-2 TH-EN ___

Usage

Make a GET request to the URL below.

http://longdo-dict-unofficial-api.herokuapp.com/search/{query}

Replace {query} with your search keyword. For example,

http://longdo-dict-unofficial-api.herokuapp.com/search/response

The GET request to the URL above will search for meaning of the word response, which gives the results shown below.

{
   "err":false,
   "result":{
      "Lexitron-EN-TH":[
         {
            "term":"response",
            "pos":"N",
            "def":[
               "คำตอบ"
            ],
            "also":[
               "การตอบ"
            ],
            "syn":[
               "answer",
               "reply"
            ]
         },
         {
            "term":"response",
            "pos":"N",
            "def":[
               "การตอบสนอง"
            ],
            "also":[
               "การโต้ตอบ"
            ],
            "syn":[
               "feedback",
               "reaction"
            ]
         }
      ]
   }
}

Respond Format Reference

// Todo