Giter Club home page Giter Club logo

cambridge-dictionary-api's Introduction

A simple API for Cambridge Dictionary, built with Node.js.

🕹️ Manual

api/dictionary/{language}/{word}

  • language option: english | english-chinese-simplified | english-chinese-traditional
  • use / to test it with UI

🌐 Deploy

Deploy with Vercel

💻 Running Locally

After clone this repository, run the following commands in the repository floder:

# install dependencies
npm install
# run
npm run dev

Then fetch http://localhost:3000/api/dictionary/english/hello to test it or use / to test it out with UI.

📖 Example

/api/dictionary/english-chinese-traditional/cook

{
  "word": "cook",
  "pos": ["verb", "noun"],
  "verbs": [
    {
      "type": "Plain form",
      "text": "cook"
    },
    {
      "type": "Third-person singular",
      "text": "cooks"
    },
    {
      "type": "Past tense",
      "text": "cooked"
    },
    {
      "type": "Past participle",
      "text": "cooked"
    },
    {
      "type": "Present participle",
      "text": "cooking"
    },
    {
      "type": "Singular",
      "text": "cook"
    },
    {
      "type": "Plural",
      "text": "cooks"
    }
  ],
  "pronunciation": [
    {
      "lang": "us",
      "url": "https://dictionary.cambridge.org/us/media/english-chinese-traditional/us_pron/c/coo/cook_/cook.mp3",
      "pron": "/kʊk/"
    },
    {
      "lang": "uk",
      "url": "https://dictionary.cambridge.org/us/media/english-chinese-traditional/uk_pron/u/ukc/ukcon/ukconve028.mp3",
      "pron": "/kʊk/"
    }
  ],
  "definition": [
    {
      "id": 0,
      "text": "When you cook food, you prepare it to be eaten by heating it in a particular way, such as baking or boiling, and when food cooks, it is heated until it is ready to eat.",
      "translation": "做飯,烹調;燒,煮",
      "example": [
        {
          "id": 0,
          "text": "I don't cook meat very often.",
          "translation": "我不常煮肉吃。"
        },
        {
          "id": 1,
          "text": "He cooked us a huge dinner./He cooked a huge dinner for us.",
          "translation": "他給我們準備了一頓豐盛的飯菜。"
        },
        {
          "id": 2,
          "text": "Let the fish cook for half an hour before you add the wine.",
          "translation": "先把魚煮半個小時再加入酒。"
        }
      ]
    },
    {
      "id": 1,
      "text": "someone who prepares and cooks food",
      "translation": "廚師",
      "example": [
        {
          "id": 3,
          "text": "She's a wonderful cook.",
          "translation": "她是位很出色的廚師。"
        }
      ]
    }
  ]
}

Develop by Elias ❤️

cambridge-dictionary-api's People

Contributors

chenelias avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.