2.4 KiB
Network Service
Web Pages
-
/page/mainui
Synchronizes with the text content displayed in the main window.
-
/page/transhist
Synchronizes with the text content displayed in the translation history.
-
/page/dictionary
Word lookup page. This page is triggered when clicking a word for lookup in
/page/mainui. -
/
A consolidated page combining the three pages mentioned above. When clicking a word for lookup in the
/page/mainuisub-section of this window, it will not open a new lookup window but will instead display the results in the/page/dictionarysub-section of the current window. -
/page/translate
Translation interface
-
/page/ocr
OCR interface
-
/page/tts
TTS interface
API Services
HTTP Service
-
/api/translate
The query parameter
textmust be specified.If the parameter
id(translator ID) is specified, that translator will be used for translation. Otherwise, the fastest available translation API will be returned.Returns
application/json, including the translator IDid, namename, and translation resultresult. -
/api/dictionary
The query parameter
wordmust be specified.If the parameter
id(the ID of the dictionary) is specified, it will return the query result of that dictionary as anapplication/jsonobject, containing the dictionary IDid, dictionary namename, and HTML contentresult. If the query fails, an empty object will be returned.Otherwise, it will query all dictionaries and return
event/text-stream, where each event is a JSON object containing the dictionary IDid, dictionary namename, and HTML contentresult. -
/api/mecab
The query parameter
textmust be specified.Returns Mecab's parsing result for
text. -
/api/tts
The query parameter
textmust be specified.Returns audio binary data.
-
/api/ocr
Use POST method to send a JSON request containing an
imagefield with base64 encoded image data. -
/api/list/dictionary
List all currently available dictionaries
-
/api/list/translator
List all currently available translation tools
WebSocket Service
-
/api/ws/text/origin
Continuously outputs all extracted original texts.
-
/api/ws/text/trans
Continuously outputs all translation results.