hoppscotch
Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
- 81k
- TypeScript
- MIT
- 13 d ago
Official Node.js library for the DeepL language translation API.
Repo DeepL/deepl-node, read from GitHub 1 min ago. DeepL has not joined Take My Repo.
DeepL/deepl-node is a public repo on GitHub by DeepL. Official Node.js library for the DeepL language translation API. It declares the MIT license on GitHub. It is written mainly in TypeScript, has 441 stars and last changed on 2026-11-02. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-18.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
Official Node.js Client Library for the DeepL API.
The DeepL API is a language translation API that allows other computer programs to send texts and documents to DeepL's servers and receive high-quality translations. This opens a whole universe of opportunities for developers: any translation product you can imagine can now be built on top of DeepL's best-in-class translation technology.
The DeepL Node.js library offers a convenient way for applications written for Node.js to interact with the DeepL API. We intend to support all API functions with the library, though support for new features may be added to the library after they're added to the API.
To use the package, you'll need an API authentication key. To get a key, please create an account here. With a DeepL API Free account you can translate up to 500,000 characters/month for free.
npm install deepl-node
The package officially supports Node.js version 12, 14, 16, 17, 18, 20, 22 and 24.
We strongly recommend upgrading to a supported Node.js version as we will be dropping support for end-of-life versions in 2025. You can find the Node versions and support timelines here.
Import the package and construct a DeepLClient. The first argument is a string
containing your API authentication key as found in your
DeepL Pro Account.
Be careful not to expose your key, for example when sharing source code.
An example using async/await and ES Modules:
import * as deepl from 'deepl-node'; const authKey = "f63c02c5-f056-..."; // Replace with your key const deeplClient = new deepl.DeepLClient(authKey); (async () => { const result = await deeplClient.translateText('Hello, world!', null, 'fr'); console.log(result.text); // Bonjour, le monde ! })();
This example is for demonstration purposes only. In production code, the authentication key should not be hard-coded, but instead fetched from a configuration file or environment variable.
If you are using CommonJS, you should instead require the package:
const deepl = require('deepl-node'); const deeplClient = new deepl.DeepLClient(authKey);
DeepLClient accepts options as the second argument, see
Configuration for more information.
The Translator class of earlier versions is deprecated and will be removed in
the next major version; DeepLClient extends it, so replacing
new deepl.Translator(...) with new deepl.DeepLClient(...) keeps your code
working.
All DeepLClient functions return promises, and for brevity the examples in this
file use await and try/catch blocks, however Promise-chaining is also
possible:
deeplClient .translateText('Hello, world!', null, 'fr') .then((result) => { console.log(result.text); // Bonjour, le monde ! }) .catch((error) => { console.error(error); });
The package also supports TypeScript:
import * as deepl from 'deepl-node'; (async () => { const targetLang: deepl.TargetLanguageCode = 'fr'; const results = await deeplClient.translateText( ['Hello, world!', 'How are you?'], null, targetLang, ); results.map((result: deepl.TextResult) => { console.log(result.text); // Bonjour, le monde ! }); })();
To translate text, call translateText(). The first argument is a string
containing the text you want to translate, or an array of strings if you want to
translate multiple texts.
The second and third arguments are the source and target language codes.
Language codes are case-insensitive strings according to ISO 639-1, for
example 'de', 'fr', 'ja''. Some target languages also include the regional
variant according to ISO 3166-1, for example 'en-US', or 'pt-BR'. Target
languages without a variant use a default variant, for example 'en' translates
to 'en-US' and 'pt' to 'pt-PT'. The source language also accepts null, to
enable auto-detection of the source language.
The language parameters accept any language code returned by
getSourceLanguages() and getTargetLanguages(), not only the members of the
SourceLanguageCode and TargetLanguageCode types. In TypeScript, a code held
in a string variable can be passed without a cast; the codes are sent to the
API unchanged apart from the case standardization.
The last argument to translateText() is optional, and specifies extra
translation options, see Text translation options
below.
translateText() returns a Promise that fulfills with a TextResult, or an
array of TextResults corresponding to your input text(s). TextResult has the
following properties:
text is the translated text,detectedSourceLang is the detected source language code,billedCharacters is the number of characters billed for the text.modelTypeUsed indicates the translation model used, but is undefined
unless the modelType option is specified.tagHandlingVersion is the tag handling version used (for example 'v2'), or
undefined unless the tagHandling option is specified.// Translate text into a target language, in this case, French: const translationResult = await deeplClient.translateText('Hello, world!', 'en', 'fr'); console.log(translationResult.text); // 'Bonjour, le monde !' // Translate multiple texts into British English: const translations = await deeplClient.translateText( ['お元気ですか?', '¿Cómo estás?'], null, 'en-GB', ); console.log(translations[0].text); // 'How are you?' console.log(translations[0].detectedSourceLang); // 'ja' console.log(translations[0].billedCharacters); // 7 - the number of characters in the source text "お元気ですか?" console.log(translations[1].text); // 'How are you?' console.log(translations[1].detectedSourceLang); // 'es' console.log(translations[1].billedCharacters); // 12 - the number of characters in the source text "¿Cómo estás?" // Translate into German with less and more Formality: console.log(await deeplClient.translateText('How are you?', null, 'de', { formality: 'less' })); // 'Wie geht es dir?' console.log(await deeplClient.translateText('How are you?', null, 'de', { formality: 'more' })); // 'Wie geht es Ihnen?'
splitSentences: specify how input text should be split into sentences,
default: '1'.
'1': input text will be split into sentences using both newlines and
punctuation.'0' or 'off': input text will not be split into sentences. Use this for
applications where each input text contains only one sentence.'nonewlines': input text will be split into sentences using punctuation
but not newlines.'on' and 'default' are deprecated aliases of '1'.preserveFormatting: controls automatic-formatting-correction. Set to true
to prevent automatic-correction of formatting, default: false.formality: controls whether translations should lean toward informal or
formal language. This option is only available for some target languages, see
Listing available languages. Use the
prefer_* options to apply formality if it is available for the target'less': use informal language.'more': use formal, more polite language.'default': use default formality.'prefer_less': use informal language if available, otherwise default.'prefer_more': use formal, more polite language if available, otherwise default.glossary: specifies a glossary to use with translation, either as a string
containing the glossary ID, or a MultilingualGlossaryInfo/GlossaryInfo as returned by
getMultilingualGlossary()/getGlossary().glossaryIds: specifies up to 5 glossaries to use with translation, as an array of
glossary ID strings, MultilingualGlossaryInfo, or GlossaryInfo objects. Glossaries are
applied in the order given, with the first matching term taking precedence. Cannot be
combined with the singular glossary option.styleRule: specifies a style rule to use with translation, either as a string
containing the style rule ID, or a StyleRuleInfo as returned by getAllStyleRules().styleProfile: specifies a style profile to use with translation, either as a
string containing the style profile ID, or a StyleProfile as returned by
getStyleProfile(). The profile applies its linked glossaries, style rule lists and
translation memories; a component that does not fit the language pair is left out.
Does not require sourceLang. Cannot be combined with glossary, glossaryIds,
styleRule, translationMemory, translationMemoryThreshold or
customInstructions; the API rejects such requests.translationMemory: specifies a translation memory to use with translation,
either as a string containing the translation memory ID, or a
TranslationMemoryInfo as returned by listTranslationMemories().translationMemoryThreshold: a number from 0 to 100 that specifies the
minimum matching percentage for translation memory matches. We recommend
a minimum threshold of 75%.context: specifies additional context to influence translations, that is not
translated itself. Characters in the context parameter are not counted toward billing.
See the API documentation for more information and
example usage.customInstructions: an array of instructions to customize the translation behavior.
Up to 10 custom instructions can be specified, each with a maximum of 300 characters.
Important: The target language must be de, en, es, fr, it, ja, ko, zh
or any variants of these languages.
Note: Any request with the customInstructions parameter enabled will use
the quality_optimized model type as the default. Requests combining
customInstructions and modelType: latency_optimized will be rejected.modelType: specifies the type of translation model to use, options are:
'quality_optimized': use a translation model that maximizes translation
quality, at the cost of response time. This option may be unavailable for
some language pairs.'prefer_quality_optimized': use the highest-quality translation model
for the given language pair.'latency_optimized': use a translation model that minimizes response
time, at the cost of translation quality.tagHandling: type of tags to parse before translation, options are 'html'
and 'xml'.tagHandlingVersion: specifies which version of the tag handling algorithm to use.
Options are v1 and v2.formality, splitSentences, modelType, tagHandling and tagHandlingVersion
also accept any other string, which is sent to the API unchanged; this allows values
the API adds later to be used without a library update.
The following options are only used if tagHandling is 'xml':
outlineDetection: specify false to disable automatic tag detection,
default is true.splittingTags: list of XML tags that should be used to split text into
sentences. Tags may be specified as an array of strings (['tag1', 'tag2']),
or a comma-separated list of strings ('tag1,tag2'). The default is an empty
list.nonSplittingTags: list of XML tags that should not be used to split text
into sentences. Format and default are the same as for splittingTags.ignoreTags: list of XML tags that containing content that should not be
translated. Format and default are the same as for splittingTags.extraBodyParameters: Extra body parameters to be passed along with the
HTTP request. Only string values are permitted.
For example: {'param': 'value', 'param2': 'value2'}
Note: Extra body parameters replace parameters of the same name set by the library
(such as target_lang, source_lang, split_sentences, etc.). This is primarily useful for testing or
accessing beta features. extraRequestParameters is the deprecated old name
of this option; pass only one of the two.To translate documents, call translateDocument(). The first and second
arguments are the input and output files. These arguments accept strings
containing file paths, or Streams or FileHandles opened for reading/writing. The
input file may also be given as a Buffer containing the file data. Note that if
the input file is not given as a file path, then the filename option is
required.
The third and fourth arguments are the source and target language codes, and
they work exactly the same as when translating text with translateText().
The last argument to translateDocument() is optional, and specifies extra
translation options, see
Document translation options below.
// Translate a formal document from English to German: try { await deeplClient.translateDocument( 'Instruction Manual.docx', 'Bedienungsanleitung.docx', 'en', 'de', { formality: 'more' }, ); } catch (error) { // If the error occurs after the document was already uploaded, // documentHandle will contain the document ID and key if (error.documentHandle) { const handle = error.documentHandle; console.log(`Document ID: ${handle.documentId}, ` + `Document key: ${handle.documentKey}`); } else { console.log(`Error occurred during document upload: ${error}`); } }
An existing file at the output path, or an output directory that is missing or
not writable, rejects with the Node error (EEXIST, ENOENT, EACCES) before
any request is sent. A missing input file rejects with a
DocumentTranslationError before any request is sent. A failed document
minification rejects with a DocumentMinificationError. Every other failure
rejects with a DocumentTranslationError whose error property holds the
cause; its httpStatusCode and shouldRetry are copied from the cause when
that is a DeepLError.
translateDocument() wraps multiple API calls: uploading, polling status until
the translation is complete, and downloading. If your application needs to
execute these steps individually, you can instead use the following functions
directly:
translateDocumentUpload(), which resolves with a DocumentHandle,translateDocumentGetStatus(), or translateDocumentWaitUntilDone() to poll
the status every 5 seconds until the translation is done; it resolves with
the final DocumentStatus and rejects with a DeepLError if the
translation fails (isDocumentTranslationComplete() is deprecated in favour
of it). Pass { timeoutMs } as its second argument to reject with a
DeepLError once that many milliseconds have passed. A status this library
does not know keeps it polling; pass timeoutMs to bound the wait, andtranslateDocumentDownload(), which rejects with a DocumentNotReadyError
if the translation is not done yet. Given an output file path, it creates the
file before sending the request, so an existing file rejects at once; if the
connection fails mid-download it rejects with a ConnectionError and removes
the partial file.uploadDocument(), getDocumentStatus() and downloadDocument() are
deprecated aliases of these methods and will be removed in the next major
version.
A DocumentStatus has documentId, status ('queued', 'translating',
'done' or 'error'), secondsRemaining, billedCharacters and
errorMessage. done() is true when the status is 'done'; ok() is true
unless the status is 'error', so the polling methods keep waiting through
statuses this library does not know.
formality: same as in Text translation options.glossary: same as in Text translation options.
Requires sourceLang to be set.glossaryIds: same as in Text translation options.
Requires sourceLang to be set.styleRule: same as in Text translation options.styleProfile: same as in Text translation options.
A style profile that does not exist fails the translation with a
DocumentTranslationError whose message contains Style profile not found..translationMemory: same as in Text translation options.translationMemoryThreshold: same as in Text translation options.filename: file name sent with the upload; its extension determines the
document type. Required if the input file is not provided as file path. For a
file path it defaults to the path's base name; set it when the path lacks the
right extension, for example filename: 'report.docx' for a temporary file.outputFormat: file extension of the desired format of the translated
document, for example 'docx'. If unspecified, the translated document has
the same format as the input document.enableWatermark: set to true to add a "Translated by DeepL" watermark to
the translated document. Only supported for docx and pdf output; for
other output formats the API ignores this option.timeoutMs: used by translateDocument() only, not sent to the API. Maximum
time in milliseconds to wait for the translation between upload and
download; when it expires, translateDocument() rejects with a
DocumentTranslationError. By default it waits without limit. A status this
library does not know keeps it polling; pass timeoutMs to bound the wait.extraBodyParameters: same as in Text translation options.enableDocumentMinification: deprecated, will be removed in the next
major version. A bool value. If set to true, the library will try to
minify a document before translating it through the API, sending a smaller
document if the file contains a lot of media. This is currently only
supported for pptx and docx files. See also
Document minification.Deprecated: document minification (the
enableDocumentMinificationoption and theDocumentMinifierclass) is deprecated and will be removed in the next major version. It still works until then. The DeepL API accepts larger documents; see the usage limits.
In some contexts, one can end up with large document files (e.g. PowerPoint presentations or Word files with many contributors, especially in a larger organization). The DeepL API limits the size of uploaded documents; see the usage limits for the current values. In the case that most of this size comes from media included in the documents (e.g. images, videos, animations), document minification can help. In this case, the library will create a temporary directory to extract the document into, replace the large media with tiny placeholders, create a minified document, translate that via the API, and re-insert the original media into the original file. Please note that this requires a bit of additional (temporary) disk space, we recommend at least 2x the file size of the document to be translated.
To use document minification, simply pass the option to the translateDocument() function:
await deeplClient.translateDocument( inFile, outFile, "en", "de", { enableDocumentMinification: true } );
In order to use document minification with the lower-level translateDocumentUpload(),
translateDocumentWaitUntilDone() and translateDocumentDownload() methods as well as other details,
see the DocumentMinifier class.
Currently supported document types for minification:
pptxdocxCurrently supported media types for minification:
pngjpgjpegemfbmptiffwdpsvggifmp4asfavim4vmpgmpegwmvmovaiffaumidmidimp3m4awavwmaGlossaries allow you to customize your translations using defined terms. Multiple glossaries can be stored with your account, each with a user-specified name and a uniquely-assigned ID.
The newest version of the glossary APIs are the /v3 endpoints, allowing both
editing functionality plus support for multilingual glossaries. New methods and
objects have been created to support interacting with these new glossaries.
Due to this new functionality, users are recommended to utilize these
multilingual glossary methods. However, to continue using the v2 glossary API
endpoints, please continue to use the existing endpoints in the translator.ts
(e.g. createGlossary(), getGlossary(), etc).
To migrate to use the new multilingual glossary methods from the current monolingual glossary methods, please refer to this migration guide.
The following sections describe how to interact with multilingual glossaries using the new functionality:
You can create a multi-lingual glossary with your desired terms and name using
createMultilingualGlossary(). Glossaries created via the /v3 endpoints can now
support multiple source-target language pairs. Note: Glossaries are only
supported for some language pairs, check the
DeepL API documentation for more information.
// Create a glossary with an English to German dictionary containing two terms: const entries = new deepl.GlossaryEntries({ entries: { artist: 'Maler', prize: 'Gewinn' } }); const glossaryEnToDe = await deeplClient.createMultilingualGlossary('My glossary', [{sourceLangCode: 'en', targetLangCode: 'de', entries: entries}]);
Glossary terms are trimmed of leading and trailing whitespace and then
validated before any request: a term that is empty after trimming or contains a
control character such as a newline throws a DeepLError. The trimmed terms are
sent.
You can also upload a glossary downloaded from the DeepL website using
createMultilingualGlossaryFromCsv() (createMultilingualGlossaryWithCsv() is
deprecated and behaves the same). Instead of supplying the entries as a dictionary,
provide the CSV content as a string.
const fs = require('fs').promises; const filePath = '/path/to/glossary_file.csv'; let csvContent = ''; try { csvContent = await fs.readFile(filePath, 'utf-8'); } catch (error) { console.error(`Error reading file at ${filePath}:`, error); throw error; } const csvContent = await readCsvFile(filePath); const glossaryEnToDe = await deeplClient.createMultilingualGlossaryFromCsv('My glossary', 'en', 'de', csvContent);
The API documentation explains the expected CSV format in detail.
Functions to get, list, and delete stored glossaries are also provided.
// Find details about the glossary named 'My glossary' const glossaries = await deeplClient.listMultilingualGlossaries(); const glossary = glossaries.find((glossary) => glossary.name == 'My glossary'); console.log(`Glossary ID: ${glossary.glossaryId}`); for (const glossaryDict of glossary.dictionaries) { console.log(`Contains dictionary, source: ${glossaryDict.sourceLangCode}, target: ${glossaryDict.targetLangCode}, with ${glossaryDict.entryCount} entries.`); }
To use a glossary when translating text and documents, include the ID
(or MultilingualGlossaryInfo object returned by listMultilingualGlossaries() or createMultilingualGlossary()) in
the function call. The glossary needs a dictionary for the source and target
languages. For text translation, sourceLang may be null: DeepL detects the
source language and uses the dictionary for the detected language pair, and the
request fails if the glossary has none. Document translation with a glossary
requires sourceLang.
const resultWithGlossary = await deeplClient.translateText( 'The artist was awarded a prize.', 'en', 'de', { glossary }, ); console.log(resultWithGlossary.text); // 'Der Maler wurde mit einem Gewinn ausgezeichnet.' // Without using a glossary would give: 'Der Künstler wurde mit einem Preis ausgezeichnet.'
Functions to get, list, and delete stored glossaries are also provided:
getMultilingualGlossary() takes a glossary ID or MultilingualGlossaryInfo
object and returns a
Promise<MultilingualGlossaryInfo> object for a stored glossary, or raises an
exception if no such glossary is found.listMultilingualGlossaries() returns a promise of a list of MultilingualGlossaryInfo objects
corresponding to all of your stored glossaries.deleteMultilingualGlossary() takes a glossary ID or MultilingualGlossaryInfo
object and deletes the stored glossary from the server, or raises an
exception if no such glossary is found.deleteMultilingualGlossaryDictionary() takes a glossary ID or GlossaryInfo object to
identify the glossary. Additionally takes in a source and target language or a
MultilingualGlossaryDictionaryInfo object and deletes the stored dictionary
from the server, or raises an exception if no such glossary dictionary is found.const glossaryDicts = [{sourceLangCode: 'en', targetLangCode: 'de', entries: new deepl.GlossaryEntries({ entries: {'hello': 'hallo'}})}, {sourceLangCode: 'de', targetLangCode: 'en', entries: new deepl.GlossaryEntries({ entries: {'hallo': 'hello'}})}]; const createdGlossary = await deeplClient.createMultilingualGlossary('My Glossary', glossaryDicts); const glossaries = await deeplClient.listMultilingualGlossaries(); // Delete a dictionary in a glossary await deeplClient.deleteMultilingualGlossaryDictionary(createdGlossary, 'de', 'en'); // Delete a glossary by name for (const glossary of glossaries) { if (glossary.name === "Old glossary") { await deeplClient.deleteMultilingualGlossary(glossary); } }
The MultilingualGlossaryInfo object does not contain the glossary entries, but
instead only the number of entries in the entryCount property.
To list the entries contained within a stored glossary, use
getMultilingualGlossaryEntries() providing either the MultilingualGlossaryInfo object or glossary
ID and the source and target language pair:
const entriesObj = await deeplClient.getMultilingualGlossaryDictionaryEntries(createdGlossary, 'en', 'de'); console.log(entriesObj.entries.toTsv()); // 'hello\thallo'
Functions to edit stored glossaries are also provided:
updateMultilingualGlossary() takes a glossary ID or MultilingualGlossaryInfo
object and an optional UpdateMultilingualGlossaryOptions with name and
dictionaries, and changes the name and merges the dictionaries in one request.
Only the fields that are set are sent. The methods below are shortcuts for one
field.updateMultilingualGlossaryDictionary() takes a glossary ID or MultilingualGlossaryInfo
object, plus a source language, target language, and a dictionary of entries.
It will then either update the list of entries for that dictionary (either
inserting new entries or replacing the target phrase for any existing
entries) or will insert a new glossary dictionary if that language pair is
not currently in the stored glossary.replaceMultilingualGlossaryDictionary() takes a glossary ID or MultilingualGlossaryInfo
object, plus a source language, target language, and a dictionary of entries.
It will then either set the entries to the parameter value, completely
replacing any pre-existing entries for that language pair.updateMultilingualGlossaryName() takes a glossary ID or MultilingualGlossaryInfo
object, plus the new name of the glossary.updateMultilingualGlossaryDictionaryFromCsv() and
replaceMultilingualGlossaryDictionaryFromCsv() take a glossary ID or
MultilingualGlossaryInfo object, a source language, target language and the
entries as CSV content. The *WithCsv() methods of the same name are
deprecated and behave the same.Every method that takes a glossary accepts its ID or a MultilingualGlossaryInfo
object. The methods that send a request body (createMultilingualGlossary(),
createMultilingualGlossaryFromCsv(), updateMultilingualGlossary(), the
updateMultilingualGlossary*() shortcuts and replaceMultilingualGlossaryDictionary*())
take an optional last options argument with extraBodyParameters: extra fields
added last to the request body, replacing fields of the same name.
const glossaryDicts = [{sourceLangCode: 'en', targetLangCode: 'de', entries: new deepl.GlossaryEntries({ entries: {"artist": "Maler", "hello": "guten tag"} })}]; const myGlossary = await deeplClient.createMultilingualGlossary('My Glossary', glossaryDicts); const newDict = {sourceLangCode: 'en', targetLangCode: 'de', entries: new deepl.GlossaryEntries({ entries: {"hello": "hallo", "prize": "Gewinn"} })}; const updatedGlossary = await deeplClient.updateMultilingualGlossaryDictionary(myGlossary, newDict); // Rename the glossary and merge entries in one request await deeplClient.updateMultilingualGlossary(myGlossary, { name: 'My renamed glossary', dictionaries: [newDict] }); const entriesObj = await deeplClient.getMultilingualGlossaryDictionaryEntries(createdGlossary, 'en', 'de'); console.log(entriesObj.entries.toTsv()); // {'artist': 'Maler', 'hello': 'hallo', 'prize': 'Gewinn'}
For examples for the other methods please see this migration guide
Spoken terms collections improve the speech recognition of names, brands and other
terms. A collection has a name and one term list per language (for example 'en').
Terms are passed and returned as arrays of strings. Before sending, createSpokenTerms(),
updateSpokenTerms() and replaceSpokenTermsList() trim each term and check it like a
glossary term: an empty or whitespace-only term or one containing a control character such
as a newline throws a DeepLError and sends no request; valid terms are sent trimmed. The API validates the rest (for example, at most 300
characters per list) and rejects invalid terms with a DeepLError.
Every method that takes a collection accepts its ID or a SpokenTerms object.
createSpokenTerms(), updateSpokenTerms() and replaceSpokenTermsList() take an optional
last options argument (CreateSpokenTermsOptions, UpdateSpokenTermsOptions and
ReplaceSpokenTermsListOptions) with extraBodyParameters: extra fields added last to the
JSON request body, replacing fields of the same name. UpdateSpokenTermsOptions also holds
name and termLists; only the fields that are set are sent.
// Create a collection; returns a SpokenTerms object const spokenTerms = await deeplClient.createSpokenTerms('My terms', [ { lang: 'en', entries: ['DeepL', 'webhook'] }, ]); console.log(spokenTerms.spokenTermsId, spokenTerms.name, spokenTerms.creationTime); console.log(spokenTerms.termLists); // [{ lang: 'en', entryCount: 2 }] // List all collections, or retrieve one; neither includes the terms const allSpokenTerms = await deeplClient.listSpokenTerms(); const fetched = await deeplClient.getSpokenTerms(spokenTerms.spokenTermsId); // Rename the collection and/or merge terms into existing term lists await deeplClient.updateSpokenTerms(spokenTerms, { name: 'My renamed terms', termLists: [{ lang: 'en', entries: ['authentication'] }], }); // Read the terms of one language const entries = await deeplClient.getSpokenTermsEntries(spokenTerms, 'en'); console.log(entries.entries); // ['DeepL', 'authentication', 'webhook'] // Replace the term list of one language, or add it if the language is new; // returns a SpokenTermsList const termList = await deeplClient.replaceSpokenTermsList(spokenTerms, { lang: 'de', entries: ['Schnittstelle'], }); console.log(termList); // { lang: 'de', entryCount: 1 } // Delete the term list of one language, then the whole collection await deeplClient.deleteSpokenTermsList(spokenTerms, 'de'); await deeplClient.deleteSpokenTerms(spokenTerms);
Style rules allow you to customize your translations using a managed, shared list of rules for style, formatting, and more. Multiple style rules can be stored with your account, each with a user-specified name and a uniquely-assigned ID.
Use createStyleRule() to create a new style rule with a name and language
code. You can optionally provide configuredRules and customInstructions,
using the API's names: configuredRules is sent as given as configured_rules
(the same shape updateStyleRuleConfiguredRules() takes, e.g.
{ dates_and_times: { calendar_era: 'use_bc_and_ad' } }), and
customInstructions as custom_instructions, an array of objects with
label, prompt and an optional source_language.
const rule = await deeplClient.createStyleRule('My Style Rule', 'en'); console.log(`Created: ${rule.name} (${rule.styleId})`); const configured = await deeplClient.createStyleRule( 'Formal English', 'en', { dates_and_times: { calendar_era: 'use_bc_and_ad' } }, [{ label: 'Formal tone', prompt: 'Always use formal language', source_language: 'de' }], );
Passing a single CreateStyleRuleRequestBody object
({ name, language, configured_rules, custom_instructions }) is deprecated and
will be removed in the next major version.
Every method that takes a style rule accepts its ID or a StyleRuleInfo
object, and every method that takes a custom instruction accepts its ID or a
CustomInstruction object, for example deleteStyleRule(rule).
The methods that send a request body (createStyleRule(),
updateStyleRuleName(), updateStyleRuleConfiguredRules(),
createStyleRuleCustomInstruction() and updateStyleRuleCustomInstruction())
take an optional last options argument (CreateStyleRuleOptions,
UpdateStyleRuleNameOptions, UpdateStyleRuleConfiguredRulesOptions,
CreateStyleRuleCustomInstructionOptions, UpdateStyleRuleCustomInstructionOptions)
with extraBodyParameters: extra fields added to the JSON body after the
library-set ones.
await deeplClient.updateStyleRuleName(rule, 'New Name', { extraBodyParameters: { some_new_field: 'value' }, });
Use getStyleRule() to retrieve a single style rule by ID, or
getAllStyleRules() to list all style rules.
getAllStyleRules() returns a list of StyleRuleInfo objects
corresponding to all of your stored style rules. The method accepts optional
parameters: page (page number for pagination, 0-indexed), pageSize (number
of items per page), and detailed. When true, the response includes
configuredRules and customInstructions for each style rule. When false
(default), these fields are omitted for faster responses.
// Get a single style rule by ID const rule = await deeplClient.getStyleRule('YOUR_STYLE_ID'); console.log(`${rule.name} (${rule.language})`); // List all style rules const styleRules = await deeplClient.getAllStyleRules(); for (const r of styleRules) { console.log(`${r.name} (${r.styleId})`); } // List with detailed configuration const detailed = await deeplClient.getAllStyleRules(undefined, undefined, true); for (const r of detailed) { if (r.configuredRules) { console.log(` Number formatting: ${JSON.stringify(r.configuredRules.numbers)}`); } }
Use updateStyleRuleName() to rename a style rule, and
updateStyleRuleConfiguredRules() to update its configured rules.
// Update the name const updated = await deeplClient.updateStyleRuleName('YOUR_STYLE_ID', 'New Name'); // Update configured rules const updatedRules = await deeplClient.updateStyleRuleConfiguredRules( 'YOUR_STYLE_ID', { dates_and_times: { calendar_era: 'use_bc_and_ad' } }, );
Custom instructions allow you to add free-text prompts to a style rule. Use
createStyleRuleCustomInstruction(), getStyleRuleCustomInstruction(),
updateStyleRuleCustomInstruction(), and
deleteStyleRuleCustomInstruction() to manage them. The create and update
methods take the label, the prompt and an optional source language code;
passing them as one object is deprecated.
// Create a custom instruction const instruction = await deeplClient.createStyleRuleCustomInstruction( 'YOUR_STYLE_ID', 'Formal tone', 'Always use formal language', 'de'); console.log(`Created instruction: ${instruction.id}`); // Get a custom instruction, passing the objects instead of the IDs const fetched = await deeplClient.getStyleRuleCustomInstruction(rule, instruction); // Update a custom instruction const updated = await deeplClient.updateStyleRuleCustomInstruction( 'YOUR_STYLE_ID', instruction, 'Updated label', 'Use very formal language'); // Delete a custom instruction await deeplClient.deleteStyleRuleCustomInstruction( 'YOUR_STYLE_ID', instruction);
Use deleteStyleRule() to delete a style rule by ID.
await deeplClient.deleteStyleRule('YOUR_STYLE_ID');
A style profile is a named set of linked glossaries, style rule lists and translation
memories, with an optional description and industry. Every method that takes a style
profile accepts its ID or a StyleProfile object.
createStyleProfile() takes CreateStyleProfileOptions and updateStyleProfile()
takes UpdateStyleProfileOptions (optional; the same options plus name):
description, industry: free-text description and industry.glossaryIds, styleRuleIds, translationMemoryIds: the components to link, each
given as its ID or as the object returned by the SDK (GlossaryInfo or
MultilingualGlossaryInfo, StyleRuleInfo, TranslationMemoryInfo). Glossaries
are listed highest priority first.glossaryPriorityOrderEnabled: whether the order of glossaryIds sets the
priority of the glossaries.extraBodyParameters: extra fields added to the JSON request body, replacing
fields with the same key.Options left undefined are not sent. When updating, they are not changed; an empty
string '' clears description or industry, and an ID array replaces the linked
components of that kind in full, so an empty array [] unlinks all of them.
// Create a style profile with only a name; the component ID arrays are empty const minimal = await deeplClient.createStyleProfile('My profile'); // Create a style profile linking components const styleProfile = await deeplClient.createStyleProfile('Legal, German', { description: 'Contract wording for the German market.', industry: 'Legal', glossaryIds: ['YOUR_GLOSSARY_ID', myGlossaryInfo], styleRuleIds: ['YOUR_STYLE_ID'], translationMemoryIds: ['YOUR_TRANSLATION_MEMORY_ID'], glossaryPriorityOrderEnabled: true, }); console.log(styleProfile.styleProfileId, styleProfile.name, styleProfile.styleRuleIds); // Retrieve a style profile const fetched = await deeplClient.getStyleProfile(styleProfile.styleProfileId); // List style profiles page by page: page is 0-indexed, pageSize defaults to 10 (max 100) const firstPage = await deeplClient.listStyleProfiles(); const secondPage = await deeplClient.listStyleProfiles(1, 100); // Rename, clear the description and unlink all style rule lists; other fields stay unchanged const updated = await deeplClient.updateStyleProfile(styleProfile, { name: 'Legal, German (v2)', description: '', styleRuleIds: [], }); console.log(updated.description); // undefined // Delete the style profile; the linked components are not deleted await deeplClient.deleteStyleProfile(styleProfile);
To translate with a style profile, pass it as the styleProfile option of text or
document translation:
const result = await deeplClient.translateText('The artist is here.', null, 'de', { styleProfile: 'YOUR_STYLE_PROFILE_ID', }); await deeplClient.translateDocument('input.docx', 'output.docx', null, 'de', { styleProfile: styleProfile, });
Translation memories store and reuse previously created translations, helping to maintain consistency and reduce translation costs by leveraging past work.
Use listTranslationMemories() to list available translation memories
associated with your account.
const translationMemories = await deeplClient.listTranslationMemories(); for (const tm of translationMemories) { console.log(`${tm.name} (${tm.translationMemoryId})`); }
Use getTranslationMemory() to retrieve a single translation memory. It accepts
either a translation memory ID or a TranslationMemoryInfo object.
const tm = await deeplClient.getTranslationMemory('YOUR_TM_ID'); console.log(`${tm.name}: ${tm.segmentCount} segments, updated ${tm.updatedTime}`);
listTranslationMemorySegments() returns one page of segments. Pagination is
cursor-based: omit pageCursor on the first call, then pass the previous
response's nextPageCursor until it is undefined. Optionally filter with
filterText (at least 2 characters, matched against both source and target
text) and filterCaseSensitive. Note that segmentCount is the
translation-memory total and is not reduced by the filter.
let pageCursor = undefined; do { const page = await deeplClient.listTranslationMemorySegments('YOUR_TM_ID', { pageSize: 50, pageCursor, }); for (const segment of page.segments) { console.log(segment.sourceText); for (const target of segment.targets) { console.log(` ${target.targetLanguage}: ${target.targetText}`); } } pageCursor = page.nextPageCursor; } while (pageCursor);
importTranslationMemoryFromFilepath() imports a TMX file as a new translation
memory: it creates the import job, uploads the file, and waits for processing to
finish. The returned job carries the ID of the new translation memory.
const job = await deeplClient.importTranslationMemoryFromFilepath('/path/to/legal.tmx', { displayName: 'Legal TM', timeoutMs: 300000, }); console.log(`Created translation memory ${job.result?.translationMemoryId}`); console.log(`Skipped segments: ${job.result?.skippedSegmentCount}`);
The input may also be a Buffer or ReadStream; then pass the fileName
option (otherwise displayName is used as the file name). The options
(ImportTranslationMemoryOptions) are:
displayName: name of the new translation memory; defaults to the file name.contentType: MIME type of the file; defaults to 'application/xml'.fileName: file name sent to the API; defaults to the base name of the path.timeoutMs: maximum time to wait for the import, in milliseconds.extraBodyParameters: extra fields added last to the JSON request body.A file path is read before any request is sent; a missing file or a directory
rejects with the Node error (ENOENT, EISDIR).
The three steps are also available separately, for example to upload the file
yourself or to poll for progress. createTranslationMemoryImport() returns an
upload URL that the file must be uploaded to, then getTranslationMemoryJob()
reports the status.
const fileBuffer = await fs.promises.readFile('/path/to/legal.tmx'); const created = await deeplClient.createTranslationMemoryImport('legal.tmx', fileBuffer.length, { displayName: 'Legal TM', }); await deeplClient.uploadTranslationMemoryFile(created, fileBuffer); const job = await deeplClient.waitUntilTranslationMemoryJobDone(created.jobId, { timeoutMs: 300000, });
createTranslationMemoryImport() accepts CreateTranslationMemoryImportOptions:
contentType, displayName and extraBodyParameters.
getTranslationMemoryJob() and waitUntilTranslationMemoryJobDone() accept the
job ID or a TranslationMemoryJob. waitUntilTranslationMemoryJobDone() takes
WaitOptions ({ timeoutMs }) or the timeout in milliseconds as a number,
resolves with the job once its status is 'completed' (or the deprecated
'downloaded'), and rejects with a
DeepLError carrying the job's error message if it fails or expires.
isTranslationMemoryJobComplete() is deprecated in its favour.
A TranslationMemoryJob has result (the single entry of results), status
(the status of result), done() (true once the status is 'completed', or
the deprecated 'downloaded') and
ok() (false once the status is 'failed' or 'expired', true while the job
is in progress). status may also be a status this library does not know.
The job status is 'awaiting_input' until the file is uploaded, and stays
'awaiting_input' for a while afterwards because the API detects the upload
asynchronously. waitUntilTranslationMemoryJobDone() polls through that status
like any other status that is not final, including statuses it does not know.
A job whose file is never uploaded does not finish on its own, so pass a
timeout when that is a possibility.
exportTranslationMemoryToFilepath() exports a translation memory to a TMX file:
it creates the export job, waits for it to finish, and writes the result.
const job = await deeplClient.exportTranslationMemoryToFilepath( 'YOUR_TM_ID', '/path/to/exported.tmx', );
The output file must not exist yet and its directory must be writable; both are
checked before the export job is created. A failure rejects with the Node error
(EEXIST, ENOENT, EACCES), as do local write failures.
Errors from the pre-signed upload and download URLs, which are not part of the
DeepL API, are thrown as a plain DeepLError carrying httpStatusCode, with
shouldRetry true for HTTP 429 and 5xx.
As with import, the individual steps are available separately. Note that the API
may reuse a previously completed export of an unchanged translation memory,
indicated by reusedExisting.
const created = await deeplClient.createTranslationMemoryExport('YOUR_TM_ID'); const job = await deeplClient.waitUntilTranslationMemoryJobDone(created.jobId, { timeoutMs: 300000, }); await deeplClient.downloadTranslationMemoryExport(job, '/path/to/exported.tmx');
Use deleteTranslationMemory() to delete a translation memory.
await deeplClient.deleteTranslationMemory('YOUR_TM_ID');
Pass the translationMemory option to translateText() to apply a translation
memory during translation. You can provide either the translation memory ID as a
string, or a TranslationMemoryInfo object returned by
listTranslationMemories(). Optionally, use translationMemoryThreshold to
control the minimum similarity for matches.
// Using a translation memory ID const result = await deeplClient.translateText( 'Hello, world!', 'en', 'de', { translationMemory: 'YOUR_TM_ID' }, ); // Using a TranslationMemoryInfo object with a similarity threshold const translationMemories = await deeplClient.listTranslationMemories(); const result = await deeplClient.translateText( 'Hello, world!', 'en', 'de', { translationMemory: translationMemories[0], translationMemoryThreshold: 80, }, );
To check account usage, use the getUsage() function.
The returned Usage object contains up to three usage subtypes, depending on
your account type: character, document and teamDocument. For API accounts
character will be defined, the others undefined.
Each usage subtypes (if defined) have count and limit properties giving the
amount used and maximum amount respectively, and the limitReached() function
that checks if the usage has reached the limit. The top level Usage object has
the anyLimitReached() function to check the character, document and
teamDocument usage.
For API Pro accounts, the Usage object also contains:
apiKeyCharacter: characters translated with this API key, as opposed to
character, which covers the whole account.speechToTextMinutes and speechToSpeechMinutes: speech usage in minutes.startTime and endTime: the current billing period, as Date objects.products: an array of per-product usage, each with productType (for
example 'translate', 'write', 'speechToText'), billingUnit (for
example 'characters', 'minutes'), apiKeyUnitCount (this API key) and
accountUnitCount (the whole account). Each of these four fields is
undefined when the API omits it.These fields are undefined when the response does not contain them, for
example for API Free accounts. anyLimitReached() does not check
apiKeyCharacter, speechToTextMinutes or speechToSpeechMinutes; call their
limitReached() function yourself.
const usage = await deeplClient.getUsage(); if (usage.anyLimitReached()) { console.log('Translation limit exceeded.'); } if (usage.character) { console.log(`Characters (account): ${usage.character.count} of ${usage.character.limit}`); } if (usage.apiKeyCharacter) { console.log( `Characters (this API key): ${usage.apiKeyCharacter.count} of ${usage.apiKeyCharacter.limit}`, ); if (usage.apiKeyCharacter.limitReached()) { console.log('API key character limit exceeded.'); } } if (usage.document) { console.log(`Documents: ${usage.document.count} of ${usage.document.limit}`); } if (usage.startTime && usage.endTime) { console.log(`Billing period: ${usage.startTime.toISOString()} to ${usage.endTime.toISOString()}`); } for (const product of usage.products ?? []) { console.log( `${product.productType}: ${product.apiKeyUnitCount} ${product.billingUnit} (this API key), ` + `${product.accountUnitCount} ${product.billingUnit} (account)`, ); }
You can request the list of languages supported by DeepL Translator for text and
documents using the getSourceLanguages() and getTargetLanguages() functions.
They both return an array of Language objects.
The name property gives the name of the language in English, and the code
property gives the language code. The supportsFormality property only appears
for target languages, and is a Boolean indicating whether the target language
supports the optional formality parameter.
const sourceLanguages = await deeplClient.getSourceLanguages(); for (let i = 0; i < sourceLanguages.length; i++) { const lang = sourceLanguages[i]; console.log(`${lang.name} (${lang.code})`); // Example: 'English (en)' } const targetLanguages = await deeplClient.getTargetLanguages(); for (let i = 0; i < targetLanguages.length; i++) { const lang = targetLanguages[i]; if (lang.supportsFormality) { console.log(`${lang.name} (${lang.code}) supports formality`); // Example: 'German (DE) supports formality' } }
Glossaries are supported for a subset of language pairs. To retrieve those
languages use the getGlossaryLanguagePairs() function, which returns an array
of GlossaryLanguagePair objects. Each has sourceLang and targetLang
properties indicating that that pair of language codes is supported for
glossaries.
const glossaryLanguages = await deeplClient.getGlossaryLanguagePairs(); for (let i = 0; i < glossaryLanguages.length; i++) { const languagePair = glossaryLanguages[i]; console.log(`${languagePair.sourceLang} to ${languagePair.targetLang}`); // Example: 'en to de', 'de to en', etc. }
DeepLClient can also query the languages of any DeepL API resource with
getLanguagesForResource(resource, options?), which returns an array of
LanguageSupport objects with code (as returned by the API), name,
status, usableAsSource, usableAsTarget and features. The resource is
a LanguageResourceName such as 'translate_text' or 'glossary'; the
optional include option takes LanguageInclude values ('beta',
'external'). Both also accept any other string, which is sent unchanged.
getLanguageResources() returns the resources as LanguageResource objects
with name and features, keyed by feature name. Each ResourceFeature has
needsSourceSupport and needsTargetSupport, which are false when the API
omits them.
const languages = await deeplClient.getLanguagesForResource('glossary', { include: ['beta'] }); for (const lang of languages) { console.log(`${lang.name} (${lang.code}): source ${lang.usableAsSource}`); } const resources = await deeplClient.getLanguageResources(); for (const resource of resources) { for (const feature of Object.values(resource.features)) { console.log(`${resource.name}.${feature.name}: needs target ${feature.needsTargetSupport}`); } }
The Admin API lets you manage the developer keys of your organization and retrieve usage analytics. It requires an admin API key, which you can create in the "Admin API Keys" tab of your DeepL account. Admin keys cannot be used for translation; developer keys cannot access the Admin API.
Create a DeepLAdminClient with your admin key. It uses the
https://api.deepl.com server by default, and accepts the same connection
options as DeepLClient, see Configuration.
import * as deepl from 'deepl-node'; const adminClient = new deepl.DeepLAdminClient('YOUR_ADMIN_KEY');
let key = await adminClient.createDeveloperKey({ label: 'Staging Team Key' }); console.log(`Created ${key.label} (${key.keyId})`); for (const k of await adminClient.listDeveloperKeys()) { console.log(`${k.label}: deactivated=${k.isDeactivated}`); } key = await adminClient.renameDeveloperKey(key, 'Production Team Key'); // Limits 500000 characters and removes the speech-to-text limit. Other limits // keep their current value. key = await adminClient.setDeveloperKeyUsageLimits(key, { characters: 500000, speechToTextMilliseconds: null, }); // Deactivation is permanent. await adminClient.deactivateDeveloperKey(key);
renameDeveloperKey(), setDeveloperKeyUsageLimits() and
deactivateDeveloperKey() accept either a key ID or a DeveloperKey object.
These three and createDeveloperKey() return the resulting DeveloperKey.
Its label and usageLimits are undefined when the API does not return
them.
createDeveloperKey() takes optional CreateDeveloperKeyOptions: label, the
label of the new key (the API uses "DeepL API Key" if it is omitted). All four
take a trailing options argument (CreateDeveloperKeyOptions,
DeactivateDeveloperKeyOptions, RenameDeveloperKeyOptions,
SetDeveloperKeyUsageLimitsOptions) that accepts extraBodyParameters, which
are added last to the JSON request body.
setDeveloperKeyUsageLimits() changes only the limits you pass:
characters, speechToTextMilliseconds and speechToSpeechMilliseconds.
Omitted limits keep their current value, null removes a limit and 0 blocks
that usage.
getUsageAnalytics() returns an AdminUsageReport for a date range. Dates are
UTC calendar days, and both the start day and the end day are included. The API
requires the end date to be after the start date, so a report covers at least
two days, and at most 366 days after it; otherwise it responds with an error.
Dates can be 'YYYY-MM-DD' strings or Date objects. For a Date, the library
sends the UTC date of that moment: local midnight in UTC+2
(2026-10-20T00:00+02:00) is sent as 2026-10-19. Use a string to send an
exact date. Invalid dates throw an ArgumentError before any request is sent.
Use the optional third parameter
groupBy to break the usage down by key ('key', see keyUsages) or by key
and day ('key_and_day', see keyAndDayUsages); other strings are sent
unchanged. The groupBy of the returned report
is the raw string the API reports, for example 'keyAndDay'. The startDate and
endDate of both report types are Dates at UTC midnight. Usage breakdowns
contain the characters per product plus speechToTextMinutes and
speechToSpeechMinutes. Fields the API leaves out of a report are undefined,
never 0 or an empty breakdown: totalUsage, startDate and endDate of a
report, and speechToSpeechMinutes of an AdminUsageBreakdown or a
CustomTagUsageBreakdown.
const report = await adminClient.getUsageAnalytics('2026-06-01', '2026-07-01', 'key'); console.log(`Total characters: ${report.totalUsage?.totalCharacters}`); for (const keyUsage of report.keyUsages) { console.log(`${keyUsage.apiKeyLabel}: ${keyUsage.usage.totalCharacters}`); }
getCustomTagUsageAnalytics() returns a CustomTagUsageReport with the usage
per custom tag. Use the optional third parameter aggregateBy to choose
between the whole period ('period', the default) and per-day usage ('day');
other strings are sent unchanged. The results are paginated: pass the
nextPage value of a report as the optional fourth parameter page to get the
next page.
let page; do { const report = await adminClient.getCustomTagUsageAnalytics( '2026-06-01', '2026-07-01', undefined, page, ); for (const tagUsage of report.usage) { console.log(`${tagUsage.customTag}: ${tagUsage.breakdown.totalCharacters}`); } page = report.nextPage; } while (page !== undefined);
If you use this library in an application, please identify the application with
the appInfo field in the DeepLClientOptions, which takes the name and version of the app:
const options = {appInfo: { appName: 'sampleNodeTranslationApp', appVersion: '1.2.3' },}; const deepl = new deepl.DeepLClient('YOUR_AUTH_KEY', options);
This information is passed along when the library makes calls to the DeepL API. Both name and version are required.
The DeepLClient constructor accepts configuration options as a second argument,
for example:
const options = { maxRetries: 5, minTimeout: 10000 }; const deepl = new deepl.DeepLClient('YOUR_AUTH_KEY', options);
The available options are:
maxRetries: the maximum Number of retries after the first attempt, per
function call. By default, 5 retries are made (6 attempts in total); 0
disables retries. A negative or non-integer value throws an ArgumentError.
See Request retries.minTimeout: the Number of milliseconds used as connection timeout for each
HTTP request retry. The default value is 10000 (10 seconds).serverUrl: string containing the URL of the DeepL API, can be overridden
for example for testing purposes. By default, the URL is selected based on the
user account type (free or paid): deepl.isFreeAccountAuthKey(authKey)
returns true for a Free account key (it ends in :fx).headers: extra HTTP headers attached to every HTTP request. By default, no
extra headers are used. Note that Authorization and User-Agent headers are
added automatically. A header in this option replaces the library's header
of the same name in any casing, including Authorization and User-Agent.
Content-Type, Content-Length, Transfer-Encoding and Host headers in
this option are ignored.proxy: define the hostname, and port of the proxy server, and optionally
the protocol, and authorization (as an auth object with username and
password fields). Alternatively, a proxy URL string such as
'http://user:pass@proxy.example.com:3128', see
Proxy configuration.To rephrase text, call rephraseText(). The first argument is a string containing the text you want to rephrase, or an array of strings if you want to rephrase multiple texts.
The second argument is the target language code. Language codes are case-insensitive strings, for example, 'de', 'fr', 'en'. The target language code can also be null to enable auto-detection of the target language.
The third argument is optional and is a RephraseTextOptions object (it extends BaseRequestOptions) with the following properties:
writingStyle: the writing style of the rephrased text. Possible values are defined in the WritingStyle enum.tone: the tone of the rephrased text. Possible values are defined in the WritingTone enum. The API accepts either writingStyle or tone in a request, not both.extraBodyParameters: extra parameters to add to the request body. They can override parameters set by the library. extraRequestParameters is the deprecated old name of this option.Passing the writing style and tone as the third and fourth arguments, for example rephraseText(text, 'en', WritingStyle.ACADEMIC), is deprecated and will be removed in the next major version.
rephraseText() returns a Promise that fulfills with an Improvement object or an array of Improvement objects corresponding to your input text(s). The Improvement object has the following properties:
text: the rephrased text,detectedSourceLang: the detected source language code,targetLanguage: the target language code.// Rephrasing a text in academic style: const rephrasedResult = await deepLClient.rephraseText('This is an example text.', 'en', { writingStyle: WritingStyle.ACADEMIC, }); console.log(rephrasedResult.text); // The rephrased text in academic style // Rephrasing multiple texts in a friendly tone: const rephrasedTexts = await deepLClient.rephraseText( ['How are you?', 'What are you doing today?'], 'de', { tone: WritingTone.FRIENDLY }, ); console.log(rephrasedTexts[0].text); // The rephrased text for "How are you?" in a friendly tone console.log(rephrasedTexts[1].text); // The rephrased text for "What are you doing today?" in a friendly tone
To correct grammar, spelling and punctuation, call correctText(). The first argument is a string containing the text you want to correct, or an array of strings if you want to correct multiple texts.
The second argument is optional and is the target language code, for example 'de' or 'en-US'. If it is omitted or null, the language of the input text is used.
The third argument is optional and is a CorrectTextOptions object (it is BaseRequestOptions) with the following property:
extraBodyParameters: extra parameters to add to the request body. They can override parameters set by the library. extraRequestParameters is the deprecated old name of this option.correctText() returns a Promise that fulfills with a WriteResult object or an array of WriteResult objects corresponding to your input text(s). The WriteResult object has the following properties:
text: the corrected text,detectedSourceLang: the detected source language code,targetLang: the target language code.// Correcting a single text: const corrected = await deepLClient.correctText('I has a apple.', 'en-US'); console.log(corrected.text); // It has an apple
DeepL/deepl-node is a public repo on GitHub by DeepL. Official Node.js library for the DeepL language translation API.
It declares the MIT license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-11-02. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
🚀Vite+Vue3+Gin拥有AI辅助的基础开发平台,企业级业务AI+开发解决方案,内置mcp辅助服务,内置skills管理,支持TS和JS混用。它集成了JWT鉴权、权限管理、动态路由、显隐可控组件、分页封装、多点登录拦截、资源权限、上传下载、代码生成器、表单生成器和可配置的导入导出等开发必备功能。
[EMNLP 2025 Demo] PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
Official Python library for the DeepL language translation API.
This page is also available as structured data, with the same sources and dates.
Take My Repo has not tested this on your machine. Requirements come from the project's own documentation.