Passa al contenuto principale

Limiti di Frequenza

Tipo di endpointLimiteAmbito
Autenticazione10 req/minper IP
Configurazione runtime1.000 req/minper token di incorporamento
Invio consenso300 req/minper token di incorporamento
Revoca consenso60 req/minper token di incorporamento
Creazione scansione10 req/minper tenant
Caricamento media20 req/minper tenant
Gestione (generale)120 req/minper chiave API

Intestazioni dei limiti di frequenza

Ogni risposta include:

X-RateLimit-Limit: 120
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1741521600

Quando si supera il limite di frequenza, si riceve una risposta 429:

{
"error": {
"code": "rate_limited",
"message": "Too many requests. Try again in 30 seconds."
}
}

Gestione dei limiti di frequenza

Implementate il backoff esponenziale quando ricevete un 429:

async function fetchWithRetry(url, options, maxRetries = 3) {
for (let attempt = 0; attempt < maxRetries; attempt++) {
const res = await fetch(url, options);
if (res.status !== 429) return res;

const retryAfter = parseInt(res.headers.get('X-RateLimit-Reset')) - Date.now() / 1000;
await new Promise(r => setTimeout(r, (retryAfter + 1) * 1000));
}
throw new Error('Rate limit retries exhausted');
}