Dictionary API

The Dictionary API allows you to fetch definitions, phonetics, and meanings for words.

Base URL

"https://openapi-idk8.onrender.com"

Endpoint

GET `/dictionary`

Description: Fetches dictionary data for the specified word.

Query Parameters:

  • word (required): The word to look up in the dictionary.

Sample Request

GET `https://openapi-idk8.onrender.com/dictionary?word=hello`

Sample Response

{
    "word": "hello",
    "phonetics": [
        {
            "audio": "https://api.dictionaryapi.dev/media/pronunciations/en/hello-au.mp3",
            "sourceUrl": "https://commons.wikimedia.org/w/index.php?curid=75797336",
            "license": {
                "name": "BY-SA 4.0",
                "url": "https://creativecommons.org/licenses/by-sa/4.0"
            }
        },
        // More phonetics here...
    ],
    "meanings": [
        {
            "partOfSpeech": "noun",
            "definitions": [
                {
                    "definition": "\"Hello!\" or an equivalent greeting.",
                    "synonyms": [],
                    "antonyms": []
                }
                // More definitions here...
            ],
            "synonyms": [
                "greeting"
            ],
            "antonyms": []
        },
        // More meanings here...
    ],
    "license": {
        "name": "CC BY-SA 3.0",
        "url": "https://creativecommons.org/licenses/by-sa/3.0"
    },
    "sourceUrls": [
        "https://en.wiktionary.org/wiki/hello"
    ]
}

Error Handling

400 Bad Request: Returned when the "word" query parameter is missing.

Response Body:


{
    "error": "Query parameter 'word' is required"
}
        

500 Internal Server Error: Returned when there's an issue fetching dictionary data using the API.

Response Body:


{
    "error": "Failed to fetch dictionary data"
}