Documentation de l'API

Exemples de points d'accès pour intégrer nos données. L'authentification se fait via une clé API fournie dans le header `X-API-Key`.

GET
/api/results/public
Récupère les résultats publics agrégés pour toutes les régions.

Exemple de réponse :

{
  "data": [
    {
      "regionId": "GN-C",
      "lastUpdated": "2024-07-31T10:00:00Z",
      "turnoutPercent": 68.5,
      "byCandidate": {
        "candidate-a": 150000,
        "candidate-b": 120000
      }
    },
    {
      "regionId": "GN-LB",
      "lastUpdated": "2024-07-31T09:30:00Z",
      "turnoutPercent": 72.1,
      "byCandidate": {
        "candidate-a": 80000,
        "candidate-b": 95000
      }
    }
  ]
}
GET
/api/candidates
Récupère la liste de tous les candidats configurés.

Exemple de réponse :

{
  "data": [
    {
      "id": "mamady-doumbouya",
      "name": "Mamady Doumbouya",
      "party": "Indépendant",
      "color": "#008f36"
    },
    {
      "id": "cellou-dalein-diallo",
      "name": "Cellou Dalein Diallo",
      "party": "UFDG",
      "color": "#ffeb00"
    }
  ]
}