Skip to content

Pangeanic MT API

The Pangeanic API is a simple RESTful implementation where requests are typically sent as POST with a JSON-encoded body.

External programs, legacy systems, programmers using the console, or API clients can access all the solution's functionalities using these generic APIs.

SERVER URL: http://prod.pangeamt.com:8080/NexRelay/v1/

APIKEY

All endpoints require the apikey parameter. If not provided or incorrect, the API will respond with a 400 or 401 error.


POST /corp/engines

This endpoint is required to list the IDs of the available engines associated with your API Key.

Request Parameters

Parameter Type Description
apikey string Required. Your personal access key.
import requests

url = "http://prod.pangeamt.com:8080/NexRelay/v1/corp/engines"
payload = {"apikey": "your-api-key-here"}

res = requests.post(url, json=payload)
print(res.json())
curl -X POST http://prod.pangeamt.com:8080/NexRelay/v1/corp/engines \
  -H "Content-Type: application/json" \
  -d '{"apikey": "your-api-key-here"}'
{
  "engines": [
    {
      "id": 1,
      "src": "en",
      "tgt": "es",
      "descr": "ENES_B_plain",
      "status": 0
    }
  ]
}

POST /translate

Processes a text segment. Processing works best if the segment is a sentence with full semantic content.

Request Parameters

Parameter Type Description
apikey string Required. Your personal access key.
src string Required. Language code (e.g., "es").
tgt string Required. Language code (e.g., "en").
engine string Required. ID of the engine to use.
text array Required. List of texts to translate.
import requests

url = "http://prod.pangeamt.com:8080/NexRelay/v1/translate"
payload = {
  "src": "es",
  "tgt": "en",
  "apikey": "your-api-key-here",
  "engine": "2",
  "text": ["¿Cómo estás?", "Mi perro es negro"]
}

res = requests.post(url, json=payload)
print(res.json())
curl -X POST http://prod.pangeamt.com:8080/NexRelay/v1/translate \
  -H "Content-Type: application/json" \
  -d '{
    "src": "es",
    "tgt": "en",
    "apikey": "your-api-key-here",
    "engine": "2",
    "text": ["¿Cómo estás?", "Mi perro es negro"]
  }'
[
  [{"src": "¿Cómo estás?", "tgt": "How are you?"}],
  [{"src": "Mi perro es negro", "tgt": "My dog is black"}]
]

POST /sendfile

Host: http://prod.pangeamt.com:8080/PGFile/v1

Sends a file to the service for translation.

import requests
import json

url = "http://prod.pangeamt.com:8080/PGFile/v1/sendfile"
config = {
    "title": "file.docx",
    "engine": "123",
    "src": "es",
    "tgt": "en",
    "apikey": "your-api-key-here"
}

files = {'file': open('file.docx', 'rb')}
data = {'json': json.dumps(config)}

res = requests.post(url, files=files, data=data)
print(res.json())
curl -X POST http://prod.pangeamt.com:8080/PGFile/v1/sendfile \
  -F "json={'title': 'file.docx', 'engine': '123', 'src': 'es', 'tgt': 'en', 'apikey': 'your-api-key-here'}" \
  -F "file=@file.docx"
{ "fileId": "8d4e1c5be60d4e04850f55ec135f2554" }

GET /checkfile

Queries the processing status of one or more files.

import requests

params = {"apikey": "your_key", "guid": "FILE_ID"}
res = requests.get("http://prod.pangeamt.com:8080/PGFile/v1/checkfile", params=params)
print(res.json())
curl -X GET "http://prod.pangeamt.com:8080/PGFile/v1/checkfile?apikey=your_key&guid=FILE_ID"
[
  {
    "fileId": "1dc77dc5ba6d44828b860537dae07187",
    "status": 100,
    "fileName": "test.txt"
  }
]

POST /retrievefile

Retrieves the processed file in Base64 format.

import requests

url = "http://prod.pangeamt.com:8080/PGFile/v1/retrievefile"
payload = {"apikey": "your_key", "guid": "FILE_ID"}

res = requests.post(url, json=payload)
print(res.json())
{
  "success": true,
  "status": "110",
  "data": {
    "filename": "test.txt",
    "file": "U2VlIHRoaW5ncyB0byBkby..."
  }
}

GET /download

Downloads the file directly as a data stream.

import requests

url = "http://prod.pangeamt.com:8080/PGFile/v1/download"
params = {"apikey": "your_key", "fileid": "FILE_ID"}

with requests.get(url, params=params, stream=True) as r:
    with open('translated_file.docx', 'wb') as f:
        for chunk in r.iter_content(chunk_size=8192):
            f.write(chunk)
curl -O -J "http://prod.pangeamt.com:8080/PGFile/v1/download?apikey=your_key&fileid=FILE_ID"

POST /glossaries

Returns a list of available glossaries, optionally filtered by glossaryid.

Parameters

Parameter Type Description
apikey string Required. Your access key.
glossaryid int Optional. Filter by a specific ID.
import requests
url = "http://prod.pangeamt.com:8080/NexRelay/v1/glossaries"
payload = {
    "apikey": "your-api-key-here",
    "glossaryid": 123
}
res = requests.post(url, json=payload)
print(res.json())
curl -X POST http://prod.pangeamt.com:8080/NexRelay/v1/glossaries \
  -H "Content-Type: application/json" \
  -d '{"apikey":"your-api-key-here"}'
[
  {
    "id": 1,
    "name": "Medical Glossary",
    "path": "/glossaries/medico.csv"
  },
  {
    "id": 2,
    "name": "Legal Glossary",
    "path": "/glossaries/legal.csv"
  }
]

POST /deleteglossary

Permanently deletes a specific glossary.

Parameters

Parameter Type Description
apikey string Required. Your access key.
glossaryid int Required. ID of the glossary to delete.
import requests
url = "http://prod.pangeamt.com:8080/NexRelay/v1/deleteglossary"
payload = {
    "apikey": "your-api-key-here",
    "glossaryid": 1
}
res = requests.post(url, json=payload)
print(res.json())
curl -X POST http://prod.pangeamt.com:8080/NexRelay/v1/deleteglossary \
  -H "Content-Type: application/json" \
  -d '{"apikey":"your-api-key-here", "glossaryid": 1}'
{
  "status": "success",
  "message": "Glossary successfully deleted"
}

POST /addglossary

Allows uploading a glossary file and associating it with an engine (engineid). Requires multipart/form-data.

Parameters (Form-Data)

Field Type Description
file file Glossary file (CSV).
name string Descriptive name of the glossary.
engineid int Associated engine ID.
apikey string Your access key.
import requests
url = "http://prod.pangeamt.com:8080/NexRelay/v1/addglossary"
files = {'file': open('my_glossary.csv', 'rb')}
data = {
    "name": "New Glossary",
    "engineid": 2,
    "apikey": "your-api-key-here"
}
res = requests.post(url, files=files, data=data)
print(res.json())
curl -X POST http://prod.pangeamt.com:8080/NexRelay/v1/addglossary \
  -F "file=@/path/to/file.csv" \
  -F "name=New Glossary" \
  -F "engineid=2" \
  -F "apikey=your-api-key-here"
{
  "status": "success",
  "message": "Glossary added successfully",
  "id": 124
}