Wiktionary API

The Wiktionary API provides access to definitions, etymology, and pronunciation of words from Wiktionary, a free content dictionary of all words in all languages. It is collaboratively edited via a wiki, and its name is a portmanteau of the words wiki and dictionary.

Base URL

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

Fetch Word Information Endpoint

GET `/wiktionary`

Description: Retrieves the definition, etymology, and pronunciation of a specified word from Wiktionary.

Query Parameters

  • word (required): The word for which the definitions, etymology, and pronunciation are to be fetched.

Sample Request

GET `https://openapi-idk8.onrender.com/wiktionary?word=example`

Sample Response

{
  "api_info": {
    "api_name": "Wiktionary",
    "author": "OpenAPI",
    "description": "Wiktionary is a multilingual, web-based project to create a free content dictionary of all words in all languages. It is collaboratively edited via a wiki, and its name is a portmanteau of the words wiki and dictionary."
  },
  "word": "example",
  "definitions": [
    "Something that is representative of all such things in a group.",
    "An action or event that is typical or characteristic of a larger group."
  ],
  "etymology": "From Latin exemplum.",
  "pronunciation": "/ɪɡˈzɑːmpəl/",
  "sourceUrl": "https://en.wiktionary.org/wiki/example"
}

Usage Example

To use the API, make a GET request to the `/wiktionary` endpoint with the required query parameter:

fetch('https://openapi-idk8.onrender.com/wiktionary?word=example')
    .then(response => response.json())
    .then(data => console.log(data));

Error Handling

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

{
  "error": "Word parameter is required"
}

500 Internal Server Error: Returned when an error occurs while fetching or processing data.

{
  "error": "An error occurred while fetching data"
}