Skip to main content

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​

  1. Log in to https://console.yodi.tg
  2. Navigate to API Keys
  3. Click Generate New Key
  4. 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:

CodeLanguage
minaMina
frFrench (Français)
eweEwe
temTem (Kotokoli)

Common Issues​

401 Unauthorized​

Your API key is invalid or missing. Check that:

  • You've included the Authorization header
  • 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.


Next Steps​