This API is not official! It 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 i reverso-apiconst 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.
You can pass either callback function...
reverso.getContext(...params, (response) => {
...
});or use .then() function.
reverso.getContext(...params).then((response) => {
...
});All the examples below are 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 }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 }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 }
โ ๏ธ 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 }getContext & getTranslation: English, Arabic, German, Spanish, French, Hebrew, Italian, Japanese, Dutch, Polish, Portuguese, Romanian, Russian, Turkish, Chinese.
getSynonyms: English, Russian, German, Spanish, French, Italian, Polish.
getSpellCheck: English, French
- All data is provided by reverso.net.
- Author on Telegram @vychs.
- Want to talk about the API? Join our Telegram chat.
