Collins
DictionariesThe Bilingual Dictionary and Thesaurus API is an essential tool for developers and language enthusiasts who want to integrate comprehensive language resources into their applications. Powered by Collins, this API provides access to an extensive database of bilingual dictionary entries and thesaurus data, catering to numerous language pairs. The API allows users to retrieve translations, synonyms, antonyms, and example sentences, making it a valuable resource for enhancing language learning, developing language applications, and providing accurate linguistic information in real-time.
Using the Bilingual Dictionary and Thesaurus API offers several benefits that can enhance your application's functionality and user experience. Key advantages include:
- Access to a rich database of bilingual dictionaries and thesauri for multiple languages.
- Real-time data for accurate and up-to-date translations and definitions.
- User-friendly API documentation to facilitate easy integration and usage.
- Capability to retrieve synonyms, antonyms, and contextual examples to enrich vocabulary.
- Support for diverse language pairs, making it versatile for different linguistic applications.
Here is a JavaScript code example demonstrating how to call the Bilingual Dictionary and Thesaurus API:
const fetch = require('node-fetch');
const apiKey = 'YOUR_API_KEY';
const word = 'example';
const sourceLang = 'en';
const targetLang = 'fr';
async function getBilingualData() {
const url = `https://api.collinsdictionary.com/api/v1/dictionaries/english/entries/${word}/translations/${targetLang}`;
const response = await fetch(url, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Accept': 'application/json'
}
});
if (!response.ok) {
console.error('Error fetching data:', response.statusText);
return;
}
const data = await response.json();
console.log(data);
}
getBilingualData();