: 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 Code Meaning Signification Description Description
200 OK Successful request Requête réussie
400 Bad Request Invalid or missing data Données invalides ou manquantes
401 Unauthorized Missing or invalid API key Clé API manquante ou invalide
403 Forbidden Access denied to this resource Accès refusé à cette ressource
404 Not Found Resource not found Ressource non trouvée
429 Too Many Requests Rate limit exceeded Limite de taux dépassée
500 Internal Server Error Server error Erreur serveur

Error Format Format des erreurs

All errors return a JSON object with the following structure: Toutes les erreurs retournent un objet JSON avec la structure suivante :

{
    "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 Codes d'erreur courants

Code Code Description Description
AUTH_MISSING_KEY Missing X-API-Key header Header X-API-Key manquant
AUTH_INVALID_KEY Invalid API key Clé API invalide
AUTH_KEY_SUSPENDED Suspended API key Clé API suspendue
VALIDATION_INVALID_GENES Invalid genetic combination Combinaison génétique invalide
VALIDATION_MISSING_FIELD Missing required field Champ requis manquant
RATE_LIMIT_EXCEEDED Rate limit exceeded Limite de taux dépassée
INTERNAL_ERROR Internal server error Erreur serveur interne

Gene Values Valeurs des gènes

Base Genes (Required) Gènes de base (requis)

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... Et autres... Always array format ["allele1", "allele2"] Toujours format array ["allele1", "allele2"]

Supported Languages Langues supportées

Code Code Language Langue Result Example Exemple de résultat
fr French Français Alezan, Bai, Noir
en English Chestnut, Bay, Black

💡 Tip 💡 Astuce

Use the official SDKs to simplify integration: Utilisez les SDK officiels pour simplifier l'intégration :