Skip to content
Unofficial naver dictionary API.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitattributes
.gitignore Initial commit Jan 19, 2020
LICENSE
README.md
index.js
package.json
yarn.lock

README.md

naverDict

Unofficial naver dictionary API wrapper.

Table of Contents


Installation

  • Yarn
yarn add naverDict
  • NPM
npm i naverDict

Usage

const naverDict = require('naverDict')

searchDictionary

  • Returns Promise
naverDict.searchDictionary('아리랑', {
  maximum: 5, // NOTE: Maximum word length is always 5.
  language: 'ko', // NOTE: See #availableLanguages (in README.md)
  raw: false // NOTE: If this set true, word objects won't serialized and include raw html values. In this library, I use `cheerio` to extract text.
})

Serialized data

  • If raw option is not set. (default)
{
  ...,
  map: { // NOTE: `map` is shortcut to `searchResultMap.searchResultListMap`
    WORD: {
      items: [.../* Words are here */]
    },
    ... // NOTE: Other ranges (such as `idiom`, `meaning`, `examples`, ...)
  }
}

serializeWordObject

  • Returns Object (Serialized word)
naverDict.serializeWordObject(wordObject)

availableLanguages

  • Array
[
  'ko', 'en', 'zh', 'ja', 'fr', 'es', 'de', 'vi'
]

requestHeaders

  • Object
{
  Accept: '*/*',
  DNT: 1,
  Host: 'ko.dict.naver.com',
  Cookie: 'nid_slevel=1; nid_enctp=1; nx_ssl=2',
  'Accept-Language': 'en,ko-KR;q=0.9,ko;q=0.8,en-US;q=0.7',
  'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36',
  'Sec-Fetch-Mode': 'no-cors',
  'Sec-Fetch-Site': 'same-site',
  'Cache-Control': 'no-cache',
  'upgrade-insecure-requests': 1
}
You can’t perform that action at this time.