Introspection du souscripteur
Recuperez les informations liees a votre cle API : identite, entreprise, plan actif, quotas et consommation en cours. Ideal pour integrer un tableau de bord de suivi de consommation dans votre application.
GET
/api/v2/meHeaders
| Header | Value | Description |
|---|---|---|
X-API-Key | pk_live_... | Votre cle API publique |
X-API-Secret | sk_live_... | Votre cle API secrete |
Exemple de requête
cURL
curl -X GET \ "https://companybelgium.be/api/v2/me" \ -H "X-API-Key: pk_live_votre_cle" \ -H "X-API-Secret: sk_live_votre_secret"
JavaScript / Node.js
const response = await fetch(
'https://companybelgium.be/api/v2/me',
{
headers: {
'X-API-Key': process.env.API_KEY,
'X-API-Secret': process.env.API_SECRET,
},
}
);
const data = await response.json();
if (data.success) {
const me = data.data;
console.log(`Cle : ${me.keyName} (${me.keyId})`);
console.log(`Entreprise : ${me.company.name}`);
console.log(`Plan : ${me.plan.name} (${me.plan.code})`);
console.log(`Consommation : ${me.usage.requestsThisMonth} / ${me.plan.monthlyQuota}`);
console.log(`Requetes restantes : ${me.usage.requestsRemaining}`);
}Python
import requests
response = requests.get(
'https://companybelgium.be/api/v2/me',
headers={
'X-API-Key': 'pk_live_votre_cle',
'X-API-Secret': 'sk_live_votre_secret',
}
)
data = response.json()
if data['success']:
me = data['data']
print(f"Cle : {me['keyName']} ({me['keyId']})")
print(f"Entreprise : {me['company']['name']}")
print(f"Plan : {me['plan']['name']} ({me['plan']['code']})")
print(f"Consommation : {me['usage']['requestsThisMonth']} / {me['plan']['monthlyQuota']}")
print(f"Requetes restantes : {me['usage']['requestsRemaining']}")Exemple de réponse
200 OK
{
"success": true,
"data": {
"keyId": "clk_abc123def456",
"keyName": "Production",
"source": "api_key",
"company": {
"id": "cmp_xyz789",
"name": "Espero-Soft Informatiques SRL"
},
"plan": {
"code": "pro",
"name": "Pro",
"monthlyQuota": 50000,
"hourlyRateLimit": 1000
},
"usage": {
"requestsThisMonth": 12483,
"requestsRemaining": 37517,
"periodStart": "2026-04-01T00:00:00.000Z",
"periodEnd": "2026-04-30T23:59:59.999Z"
},
"issuedAt": "2026-01-15T10:30:00.000Z"
},
"timestamp": "2026-04-17T10:00:00.000Z"
}Codes d'erreur
401 Unauthorized
Cle API manquante ou invalide401 Unauthorized
{
"success": false,
"error": "Invalid API key. Please check your X-API-Key and X-API-Secret headers.",
"timestamp": "2026-04-17T10:00:00.000Z"
}403 Forbidden
Cle API desactivee ou plan expire403 Forbidden
{
"success": false,
"error": "API key is disabled. Please contact support.",
"timestamp": "2026-04-17T10:00:00.000Z"
}Notes
- Cet endpoint ne prend aucun parametre de chemin ou de requete. Seuls les headers d'authentification sont necessaires.
- Utile pour le monitoring de quotas : integrez un appel periodique a /api/v2/me dans votre application pour suivre votre consommation.
- Le champ usage.requestsRemaining est calcule en temps reel (monthlyQuota - requestsThisMonth).
- Le champ source indique le mode d'authentification utilise (api_key, internal, etc.).
- Les periodes de facturation (periodStart / periodEnd) correspondent au mois calendaire en cours.