The SOLVAN Translation API
One JSON endpoint that translates between English, Sinhala and Tamil, in every direction.
Base URL
https://solvan.markquad.com/v1Quick start
Your first translation takes about a minute.
- 01Get a keyCreate a free account and generate an API key.
- 02Send a requestPOST your text to
/v1/translatewith the key in a header. - 03Read the replyThe translation comes back as JSON in
translation.
Authentication
Every request needs an API key. Send it in either header. Keep keys secret and call the API from your server, not from code that runs in a visitor's browser.
Authorization: Bearer sol_your_key X-API-Key: sol_your_key
Translate text
POST
/v1/translateRequest body
| Field | Type | Description |
|---|---|---|
textrequired | string | The text to translate, up to 5,000 characters. |
sourcerequired | string | Language of the text: en, si or ta. |
targetrequired | string | Language to translate into. Must differ from source. |
Response
| Field | Type | Description |
|---|---|---|
translation | string | The translated text. |
characters | number | Characters counted for this request. |
usage | object | Characters used this month and your monthly limit. |
curl -X POST https://solvan.markquad.com/v1/translate \
-H "Authorization: Bearer sol_your_key" \
-H "Content-Type: application/json" \
-d '{"text": "Welcome to Jaffna", "source": "en", "target": "ta"}'import requests
response = requests.post(
"https://solvan.markquad.com/v1/translate",
headers={"Authorization": "Bearer sol_your_key"},
json={"text": "Welcome to Jaffna", "source": "en", "target": "ta"},
)
print(response.json()["translation"])const response = await fetch("https://solvan.markquad.com/v1/translate", {
method: "POST",
headers: {
"Authorization": "Bearer sol_your_key",
"Content-Type": "application/json",
},
body: JSON.stringify({ text: "Welcome to Jaffna", source: "en", target: "ta" }),
});
const data = await response.json();
console.log(data.translation);{
"translation": "யாழ்ப்பாணத்திற்கு வரவேற்கிறோம்",
"glossary": [],
"characters": 17,
"usage": {
"used": 17,
"limit": 100000
}
}Errors
When something goes wrong the status code tells you why, and the body explains it in one sentence.
| Status | Meaning |
|---|---|
400 | The text is empty or too long, or the language codes are not valid. |
401 | The API key is missing, wrong or revoked. |
403 | The account has been turned off by an admin. |
429 | The monthly character limit has been reached. |
503 | The translation model is busy or still starting. Try again shortly. |
Example
{
"error": "Monthly limit reached: 100,000 of 100,000 characters used."
}Limits
5,000
characters per request
100,000
characters a month on the free plan
1st
of each month, usage resets
Need more? Contact us to raise your monthly limit.
Languages
| Code | Language | Native name |
|---|---|---|
en | English | English |
si | Sinhala | සිංහල |
ta | Tamil | தமிழ் |