Quick Start Guide
Get up and running with YODI API in just 5 minutes.
Prerequisites​
- A YODI account
- An API key (you can create one in your dashboard)
- cURL, Postman, or any HTTP client
Step 1: Get Your API Key​
- Log in to https://console.yodi.tg
- Navigate to API Keys
- Click Generate New Key
- Copy and save your key safely
Step 2: Make Your First Request​
Using cURL​
curl -X POST "https://admin.yodi.tg/api/ai/translate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Bonjour, comment allez-vous?",
"sourceLanguage": "fr",
"targetLanguage": "ewe"
}'
Using Python​
import requests
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
data = {
'text': 'Bonjour, comment allez-vous?',
'sourceLanguage': 'fr',
'targetLanguage': 'ewe'
}
response = requests.post(
'https://admin.yodi.tg/api/ai/translate',
headers=headers,
json=data
)
print(response.json())
Using JavaScript​
const response = await fetch("https://admin.yodi.tg/api/ai/translate", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
text: "Bonjour, comment allez-vous?",
sourceLanguage: "fr",
targetLanguage: "ewe",
}),
});
const data = await response.json();
console.log(data);
Step 3: Check Your Response​
You should receive a JSON response with the translated text:
{
"message": "SUCCESS",
"error": false,
"data": {
"translatedText": "Akɔtaba me, ɔlɔ ɖe?",
"sourceLanguage": "fr",
"targetLanguage": "ewe"
},
"status": 200
}
Supported Languages​
YODI supports translation for West African languages:
| Code | Language |
|---|---|
| mina | Mina |
| fr | French (Français) |
| ewe | Ewe |
| tem | Tem (Kotokoli) |
Common Issues​
401 Unauthorized​
Your API key is invalid or missing. Check that:
- You've included the
Authorizationheader - The key format is correct:
Bearer YOUR_API_KEY - Your key hasn't expired
400 Bad Request​
Check that all required parameters are included in your request.