Skip to content

d0minYk/reverso-api

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

107 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Reverso API

version downloads telegram chat

logotype

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.

Navigation

Installing

$ npm i reverso-api

Usage

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.

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.

Examples

  • getContext

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 }
  • getSpellCheck

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 }
  • getSynonyms

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 }
  • getTranslation

โš ๏ธ 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 }

Languages

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

Credits

About

๐ŸŒ Simple JavaScript Reverso API. Context, Spell Check, Synonyms and Translation are currently available.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%