Cover photo by Christopher Gower on Unsplash
Are you developing a language learning app, a writing assistant, or any project involving words and need an API to retrieve word meanings? Free Dictionary API offers a free and accessible way to incorporate language data into your work. This documentation will show you how to get started.
Free Dictionary API developed by meetDeveloper and has 2.6k stars on GitHub. API supports only GET requests and provides word definitions along with phonetic transcriptions.
https://api.dictionaryapi.dev/api/v2/entries/en/
This endpoint retrieves dictionary information for the specified English word.
The API has two versions: v1 and v2. The primary difference lies in the response structure. Current version is v2.
The API returns a JSON array containing a single object with detailed information about the word, including:
const word = "documentation"; fetch(`https://api.dictionaryapi.dev/api/v2/entries/en/${word}`) .then(response => response.json()) .then(data => console.log(data));
[ { "word": "documentation", "phonetic": "/ˌdɒkjʊmənˈteɪʃən/", "phonetics": [ { "text": "/ˌdɒkjʊmənˈteɪʃən/", "audio": "" }, { "text": "/ˌdɑkjəmənˈteɪʃən/", "audio": "" } ], "meanings": [ { "partOfSpeech": "noun", "definitions": [ { "definition": "Something transposed from a thought to a document; the written account of an idea.", "synonyms": [], "antonyms": [] }, { "definition": "Documentary evidence and sources.", "synonyms": [], "antonyms": [] }, { "definition": "Documents that explain the operation of a particular machine or software program.", "synonyms": [], "antonyms": [] }, { "definition": "Comments that explain the usage of individual functions, libraries and blocks of code.", "synonyms": [], "antonyms": [] } ], "synonyms": [], "antonyms": [] } ], "license": { "name": "CC BY-SA 3.0", "url": "https://creativecommons.org/licenses/by-sa/3.0" }, "sourceUrls": [ "https://en.wiktionary.org/wiki/documentation" ] } ]
const word = "Software engineer"; fetch(`https://api.dictionaryapi.dev/api/v2/entries/en/${word}`) .then(response => response.json()) .then(data => console.log(data));
{ "title": "No Definitions Found", "message": "Sorry pal, we couldn't find definitions for the word you were looking for.", "resolution": "You can try the search again at later time or head to the web instead." }
This API does not currently return specific success or error codes.
To try the API or support the Free Dictionary API, go to Free Dictionary API website.
See also Free Dictionary API project on Github.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3