🪞 MIRROR API

Intégrez l'engine d'identité sociale MIRROR dans vos applications. L'API est accessible gratuitement.

🔑 Authentification : Aucune authentification requise. Tous les endpoints sont publics.
⏱️ Rate Limit : 100 requêtes / minute par IP. Header Retry-After: 60 en cas de dépassement.
📦 Format : Toutes les réponses sont en JSON avec Content-Type: application/json.
🌍 CORS : Autorisé depuis https://mirrors-app.com uniquement.

🔹 GET /api/leaderboard

GET/api/leaderboard?period=all 60s cachepublic

Top 20 des identités sociales. Paramètre optionnel period=today pour le classement du jour. La propriété archetype est toujours un slug (visionary|maverick|connector|sage|architect|luminary|phantom|catalyst).

curl

curl -s https://mirrors-app.com/api/leaderboard

JavaScript fetch()

const res = await fetch('https://mirrors-app.com/api/leaderboard');
const data = await res.json();
// data = [{ name: 'Lucas', archetype: 'visionary', score: 847 }, ...]

Réponse JSON

[
  { "name": "Lucas", "archetype": "visionary", "score": 847 },
  { "name": "Emma", "archetype": "connector", "score": 812 }
]

🔹 GET /api/analytics/count

GET/api/analytics/count 300s cachepublic

Nombre total de profils générés sur MIRROR.

curl

curl -s https://mirrors-app.com/api/analytics/count

JavaScript fetch()

const res = await fetch('https://mirrors-app.com/api/analytics/count');
const { total } = await res.json();
console.log(total); // 12450

Réponse JSON

{ "total": 12450 }

🔹 GET /api/og

GET/api/og?name=Lucas&archetype=visionary 24h cachepublic

Génère une OG image SVG 1200×630 pour partage réseaux sociaux. Paramètres : name (optionnel) et archetype (visionary|maverick|connector|sage|architect|luminary|phantom|catalyst).

curl

curl -s "https://mirrors-app.com/api/og?name=Lucas&archetype=visionary"

JavaScript fetch()

const url = 'https://mirrors-app.com/api/og?name=' + encodeURIComponent('Lucas') + '&archetype=visionary';
// Utiliser comme og:image dans <meta> tags

🔹 POST /api/submit

POST/api/submit no cachepublic

Soumettre un nom au leaderboard. Body JSON : {"name": "Lucas"}. Le serveur calcule l'archétype et le score automatiquement à partir du nom. Validation : name 2-30 chars, lettres/accents/tirets/espace uniquement.

curl

curl -s -X POST https://mirrors-app.com/api/submit \
  -H "Content-Type: application/json" \
  -d '{"name":"Lucas"}'

JavaScript fetch()

const res = await fetch('https://mirrors-app.com/api/submit', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ name: 'Lucas' })
});
const data = await res.json();
// { ok: true, archetype: 'visionary', score: 847 }

Réponse JSON

{ "ok": true, "archetype": "visionary", "score": 847 }

🔹 POST /api/email

POST/api/email no cachepublic

Enregistrer un email. Body JSON : {email, archetype}.

curl

curl -s -X POST https://mirrors-app.com/api/email \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","archetype":"visionary"}'

JavaScript fetch()

await fetch('https://mirrors-app.com/api/email', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ email: '[email protected]', archetype: 'visionary' })
});

Réponse JSON

{ "ok": true }

Pages SEO

GET/archetype/:idpublic

Page HTML dédiée à un archétype. /archetype/visionary, /archetype/maverick, etc. 8 archétypes disponibles.

GET/compatibilite/:a1-:a2public

Page HTML de compatibilité. /compatibilite/connector-luminary. Toutes les paires d'archétypes.

GET/prenom/:namepublic

Page HTML dédiée à un prénom. /prenom/Lucas. Génération automatique pour 50+ prénoms populaires.

⚠️ À propos des endpoints internes

Les endpoints listés ci-dessus sont les seuls endpoints publics et documentés. Les autres routes (/api/push/*, /api/sync/*, /api/referral/*, /api/premium/*, /api/checkout/*, /api/stripe-webhook) sont internes à l'application et peuvent changer sans préavis. Ne les utilisez pas dans vos intégrations.