: https://api.unikhorn.com
: JSON
: Header X-API-Key
POST
/coats/result
X-API-Key: votre-cle-api
Content-Type: application/x-www-form-urlencoded
# Form-data format with stringified JSON (recommended)
base={"extension":["E","E"],"agouti":["A","A"]}&others={"dun":["D","nd1"],"matp":["Cr","n"]}&lang=fr
# Ou format form-data avec arrays
base[extension][]=E&base[extension][]=E&base[agouti][]=A&base[agouti][]=A&others[dun][]=D&others[dun][]=nd1&lang=fr
(200 OK)
{
"base": {
"agouti": ["A", "A"],
"extension": ["E", "E"]
},
"others": {
"matp": ["Cr", "Cr"],
"dun": ["D", "nd1"],
"silver": ["Z", "n"],
"champagne": ["Ch", "n"],
"grey": ["G", "n"],
"kit": ["DW7", "n"],
"lp": ["Lp", "n"]
},
"translate": "Alezan"
}
curl -X POST https://api.unikhorn.com/coats/result \
-H "X-API-Key: votre-cle-api" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'base={"agouti":["A","a"],"extension":["E","e"]}&others={"matp":["Cr","n"]}&lang=fr'
POST
/coats/generateChild
X-API-Key: votre-cle-api
Content-Type: application/x-www-form-urlencoded
# Form-data format with stringified JSON
mother={"base":{"agouti":["A","a"],"extension":["E","e"]},"others":{"matp":["Cr","n"],"dun":["D","nd1"]}}&father={"base":{"agouti":["A","A"],"extension":["e","e"]},"others":{"matp":["n","n"],"dun":["D","D"]}}&kit_linkage={"mother":["E","DW7"],"father":[]}&has_IDK=false&lang=fr
(200 OK)
{
"results": [
{
"coat": "Bai",
"percentage": 25.0,
"genotype": {
"agouti": ["A","A"],
"extension": ["E","e"],
"matp": ["Cr","n"],
"dun": ["D","D"]
}
},
{
"coat": "Alezan",
"percentage": 25.0,
"genotype": {
"agouti": ["A","A"],
"extension": ["e","e"],
"matp": ["Cr","n"],
"dun": ["D","D"]
}
},
{
"coat": "Bai dun",
"percentage": 12.5,
"genotype": {
"agouti": ["A","a"],
"extension": ["E","e"],
"matp": ["n","n"],
"dun": ["D","nd1"]
}
}
// ... other possibilities
],
"has_kit_linkage": false,
"has_IDK": false
}
curl -X POST https://api.unikhorn.com/coats/generateChild \
-H "X-API-Key: votre-cle-api" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'mother={"base":{"agouti":["A","a"],"extension":["E","e"]}}&father={"base":{"agouti":["A","A"],"extension":["e","e"]}}&lang=fr'
GET
/coats/api-info
X-API-Key: votre-cle-api
(200 OK)
{
"authenticated": true,
"type": "api_key",
"key_name": "Production Key",
"key_id": 12345,
"daily_limit": 10000,
"monthly_limit": 300000,
"daily_usage": 245,
"monthly_usage": 5420,
"created_at": "2025-01-15 10:30:00",
"last_used_at": "2025-01-15 14:30:00",
"endpoints": {
"calculate_coat": "/coats/result (POST)",
"calculate_offspring": "/coats/generateChild (POST)",
"api_info": "/coats/api-info (GET)"
},
"allowed_endpoints": [
"coats.result",
"coats.generateChild",
"coats.api-info"
],
"allowed_ips": [],
"documentation": "https://api-docs.ekine.io"
}
Code | Meaning | Description |
---|---|---|
200 | OK | Successful request |
400 | Bad Request | Invalid or missing data |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | Access denied to this resource |
404 | Not Found | Resource not found |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server error |
Error Format
All errors return a JSON object with the following structure:
{
"error": "Validation error",
"message": "Invalid genetic combination provided",
"code": "VALIDATION_INVALID_GENES",
"details": {
"field": "base.agouti",
"value": "XX",
"expected": ["AA", "Aa", "aa"]
}
}
Common Error Codes
Code | Description |
---|---|
AUTH_MISSING_KEY |
Missing X-API-Key header |
AUTH_INVALID_KEY |
Invalid API key |
AUTH_KEY_SUSPENDED |
Suspended API key |
VALIDATION_INVALID_GENES |
Invalid genetic combination |
VALIDATION_MISSING_FIELD |
Missing required field |
RATE_LIMIT_EXCEEDED |
Rate limit exceeded |
INTERNAL_ERROR |
Internal server error |
Gene Values
Base Genes (Required)
agouti |
["A","A"], ["A","a"], ["a","a"] |
extension |
["E","E"], ["E","e"], ["e","e"] |
matp |
["Cr","Cr"], ["Cr","n"], ["Prl","Prl"], ["Cr","Prl"], ["n","n"] |
dun |
["D","D"], ["D","nd1"], ["D","nd2"], ["nd1","nd2"], ["nd2","nd2"] |
silver |
["Z","Z"], ["Z","n"], ["n","n"] |
champagne |
["Ch","Ch"], ["Ch","n"], ["n","n"] |
grey |
["G","G"], ["G","n"], ["n","n"] |
kit |
["DW1", "DW21"], ["SW2"], ["n"] (dominant white variants) |
lp |
["Lp","Lp"], ["Lp","n"], ["n","n"] (leopard complex) |
And others... | Always array format ["allele1", "allele2"] |
Supported Languages
Code | Language | Result Example |
---|---|---|
fr |
French | Alezan, Bai, Noir |
en |
English | Chestnut, Bay, Black |
💡 Tip
Use the official SDKs to simplify integration:
- PHP SDK - Installation via Composer
- JavaScript SDK - Installation via npm