First timer questions

I’m setting up a local server to translate some data I need via api in a nodejs environment, I have a doubt, in terms on rate limit, how many translations requests can be done per minute?

Also is there a way to install only Portuguese and Spanish languages?

1 Like

If you want to translate from NoseJS you can use this library:

If you buy a LibreTranslate.com API key you get up to 80 translations per minute. If you install LibreTranslate on your own hardware you’re only limited by what your hardware can manage.

You can use --load-only to select which language pairs you want to install. For example:

--load-only en,pt,es

Or:

EXPORT LT_LOAD_ONLY="en,pt,es"
1 Like

Thanks for your fast reply!

I’m trying to run a Node.js translation using my local machine, but it always asks for an API key.

Error: Visit https://portal.libretranslate.com to get an API key

What am I missing so I can test it in my local server install?

How are you connecting to the LibreTranslate instance? It looks like you’re currently pointing to the LibreTranslate.com instance not you local LibreTranslate installation (normally localhost:5000).

i’m using the node repo you advised earlier, trying out this:

import translate from “translate”;

translate.engine = “libre”; // “google”, “yandex”, “libre”, “deepl”
// translate.key = process.env.LIBRE_KEY;

const options = {
to: ‘es’,
from: ‘pt’,
engine: translate.engine,
url: ‘http://127.0.0.1:5000
}

const text = await translate(“Hello world”, options);
console.log(text);

Something doesn’t look right; if you’re using a local instance you should not be getting Visit https://portal.libretranslate.com to get an API key. Double-check your requests are going to localhost rather than libretranslate.com?

1 Like