unofficial-deepl-client
This is an unofficial, DeepL API wrapper for Nodejs written in Typescript.
Official documentation: https://www.deepl.com/api.html
Install
$ npm install trkbt10/unofficial-deepl-client
Usage
;
Methods
Translating text
https://www.deepl.com/docs-api/translating-documents/#translating-text
;;;/* { translations: [ { detectedSourceLanguage: "JA", text: "As I climbed the mountain road, I thought about this.", }, ], }*/console.logresponse;
Multiple sentences
https://www.deepl.com/docs-api/translating-documents/#multiple-sentences
;/*{ translations: [ { detectedSourceLanguage: "EN", text: "Dies ist der erste Satz." }, { detectedSourceLanguage: "EN", text: "Dies ist der zweite Satz." }, { detectedSourceLanguage: "EN", text: "Dies ist der dritte Satz." }, ],}*/console.logresponse
Translating documents
Uploading document
https://www.deepl.com/docs-api/translating-documents/#uploading
; ;;; /*{ documentId: "DOCUMENT_ID", documentKey: "DOCUMENT_KEY"}*/console.logresponse;
Checking translation status
https://www.deepl.com/docs-api/translating-documents/#checking-status
;/* { documentId: "DOCUMENT_ID", status: "done"; billedCharacters: 10000; }*/console.logresponse;
Downloading translated documents
https://www.deepl.com/docs-api/translating-documents/#downloading
; fs.writeFileSync'translatedDocument.docx', buffer;
Other functions
Monitoring usage
https://www.deepl.com/docs-api/other-functions/monitoring-usage/#monitoring-usage
;/* { "characterCount": 180118, "characterLimit": 1250000 }*/console.logresponse;
Listing supported languages
https://www.deepl.com/docs-api/other-functions/monitoring-usage/#listing-supported-languages
;/*[ { "language": "DE", "name": "Deutsch" }, { "language": "EN", "name": "English" }, ...]*/console.logresponse;