When translating with the DeepL API, you can customize translation results by specifying a glossary.
This allows you to prevent specific words from being translated or replace specific words with other specific words.
For example, in this code, we specify that the word Hello should be replaced with ハロー (the katakana version).
Normally, when translating with the DeepL API, the sentence Hello, world! would be translated to こんにちは、世界!, but by specifying a glossary, it becomes ハロー、世界!.

Example Node.js Program Using Glossary
The following program creates a glossary with translator.createGlossary() and uses translator.translateText() to translate with the created glossary.
The Node.js package used is "deepl-node": "^1.13.0".
Below is the code and its output:
- Node.js program code
(async () => {
const resNormal = await translator.translateText(`Hello, world!`, 'en', 'ja');
console.log("Translation result without glossary:");
console.log(resNormal.text);
const pairs = {
source: "Hello",
target: "ハロー",
}
// Create a glossary
__| |____________________________________________| |__
(__ ____________________________________________ __)
| | | |
| | | |
[Shown with subscription]
| | | |
__| |____________________________________________| |__
(__ ____________________________________________ __)
| | | |
const res = await translator.translateText(`Hello, world!`, 'en', 'ja', { glossary, });
console.log("Translation result with glossary:");
console.log(res.text);
- Output result
Translation result without glossary:
こんにちは、世界よ!
Translation result with glossary:
ハロー、世界よ!
That’s it.
We Also Accept Requests for Translation Using DeepL API
- Development of apps and tools utilizing the DeepL API
- Batch translation of text data, Excel, spreadsheets, and other documents using the DeepL API
- Other development and data processing requests not related to the DeepL API or translation
We also provide consultation and troubleshooting support for using the DeepL API via remote desktop, etc.
The fee is a flat rate of 3000 yen/30 minutes. (We may not be able to respond during busy periods, so please make advance reservations or consultations.)