Sign inSign up

sadlyharry/naverdictionary

By sadlyharry

•Updated over 1 year ago

A REST API that scrapes the Naver Korean-English Dictionary, delivering Korean-English translation.

Image
Developer tools
Web servers
Content management system
0

229

sadlyharry/naverdictionary repository overview

⁠NaverDictionary Docker Image

This Docker image provides a REST API that scrapes the Naver Korean-English Dictionary, delivering comprehensive Korean-English translation data.

⁠Quick Start

To run the NaverDictionary service, execute the following command:

docker run --network=host -p 8080:8080 sadlyharry/naverdictionary:latest

This command starts a REST server accessible at port 8080.

⁠API Endpoints

The NaverDictionary service offers several endpoints to interact with the dictionary data:

  1. Get Word Information

    Retrieve detailed information about a Korean word.

    • Endpoint: <hostname>/get?word=<korean_word>
    • Example Request: 127.0.0.1/get?word=사랑
    • Example Response:
      {
        "message": {
          "Topik": "TOPIK Elementary",
          "Importance": "★★★",
          "Title": "사랑",
          "Hanja": "愛",
          "Endef": "love",
          "Pronun": "sa-rang",
          "PartSpeech": "noun",
          "Meanings": "Deep affection for someone or something."
        }
      }
      
    • Description of Fields:
      • Topik: Indicates if the word appears in the TOPIK (Test of Proficiency in Korean) exams.
      • Importance: Represents the popularity of the word, rated out of three stars.
      • Title: The Korean word itself.
      • Hanja: The Chinese character equivalent of the word, if applicable.
      • Endef: The English translation of the word.
      • Pronun: Pronunciation guide in both English and Korean.
      • PartSpeech: Grammatical category (e.g., noun, verb).
      • Meanings: Detailed descriptions and meanings of the word.
  2. Get Raw Entry Information

    Access the raw entry data scraped from the Naver dictionary.

    • Endpoint: <hostname>/get/entryinfo?word=<korean_word>
    • Example Request: 127.0.0.1/get/entryinfo?word=사랑
    • Example Response:
      {
        "message": {
          ...
        }
      }
      
    • Description: Provides the unprocessed data retrieved directly from the Naver dictionary for advanced processing.
  3. Get Raw Search Information

    Obtain the raw search data from the Naver dictionary.

    • Endpoint: <hostname>/get/searchinfo?word=<korean_word>
    • Example Request: 127.0.0.1/get/searchinfo?word=사랑
    • Example Response:
      {
        "message": {
          ...
        }
      }
      
    • Description: Returns the raw search data from Naver for the specified word.
  4. Get Formatted Message

    Retrieve a formatted message suitable for chatbot integration or frontend display.

    • Endpoint: <hostname>/get/message?word=<korean_word>
    • Example Request: 127.0.0.1/get/message?word=사랑
    • Example Response:
      {
        "message": "사랑 (love)\nPart of Speech: Noun\nPronunciation: sa-rang\nMeaning: Deep affection for someone or something."
      }
      
    • Description: Provides a user-friendly message with key information about the word, ideal for chatbot responses or UI displays.

⁠Error Handling

In case of an error, the API will respond with a JSON object containing an error message.

  • Example Response:
  {
    "error": ...
  }

⁠License

This project is licensed under the MIT License.​

For more information or to contribute, visit the GitHub repository⁠.

Tag summary

Content type

Image

Digest

sha256:49f1821b2…

Size

13.9 MB

Last updated

over 1 year ago

docker pull sadlyharry/naverdictionary