First of all, this API is not official
! The API allows you to manipulate with your text in different ways. Almost all the features from the website are supported by this API. Currently supported: context, translation, spell check, synonyms.
$ npm install reverso-api
const Reverso = require('reverso-api');
const reverso = new Reverso();
Congrats! You can use all the available methods now.
Let's read through the README and find out how the things work.
Remember, you can pass either callback function...
reverso.getContext(...params, (response) => {
...
});
or use .then()
function.
reverso.getContext(...params).then((response) => {
...
});
All the examples below will be given using callback function.
reverso.getContext('meet me half way', 'English', 'Russian', (response) => {
console.log(response);
}).catch(err => {
console.error(err);
});
Response:
{
text: String,
from: String,
to: String,
translation: [String, ...],
examples: [
{
id: Number,
from: String,
to: String
},
...
]
}
Error:
{ method: String, error: String }
Available languages for this method: English, Arabic, German, Spanish, French, Hebrew, Italian, Japanese, Dutch, Polish, Portuguese, Romanian, Russian, Turkish, Chinese.
reverso.getSpellCheck('helo', 'English', (response) => {
console.log(response);
}).catch(err => {
console.error(err);
});
Response:
[
{
id: Number,
text: String,
type: String,
explanation: String,
corrected: String,
full_corrected: String
}
]
Error:
{ method: String, error: String }
Available languages for this method: English and French.
reverso.getSynonyms('dzień dobry', 'Polish', (response) => {
console.log(response);
}).catch(err => {
console.error(err);
});
Response:
{
text: String,
from: String,
synonyms: [
{ id: Number, synonym: String },
...
]
}
Error:
{ method: String, error: String }
Available languages for this method: English, Russian, German, Spanish, French, Italian, Polish.
⚠️ WARNING: eventually, your server's IP address might get banned by Reverso moderators and you won't receive any data.
reverso.getTranslation('how is going?', 'English', 'Chinese', (response) => {
console.log(response);
}).catch(err => {
console.error(err);
});
Response:
{
text: String,
from: String,
to: String,
translation: [String, ...],
context: {
examples: [
{
from: String,
to: String,
phrase_from: String,
phrase_to: String
},
...
],
rude: Boolean
}, // or null
detected_language: String,
voice: String // or null
}
Error:
{ method: String, error: String }
Available languages for this method: English, Arabic, German, Spanish, French, Hebrew, Italian, Japanese, Dutch, Polish, Portuguese, Romanian, Russian, Turkish, Chinese.
- All the data is fetched from reverso.net.
- Author of the API @vychs.
- Want to talk about the API? Join our Telegram chat.