Rate Limit Exceeded (rate_limit_exceeded)
Quick Fix & Resolution
Implement exponential backoff with jitter, use SSE streaming (Accept: text/event-stream), or batch state lookups.
Response Payload & SDK Handling
json
{
"type": "https://orion.stellarchain.io/horizon-errors/rate_limit_exceeded",
"title": "Rate Limit Exceeded",
"status": 429,
"detail": "The rate limit for the requesting IP address is over its alloted limit. The allowed limit and requests left per time period are communicated to clients via the http response headers 'X-RateLimit-*' headers."
}typescript
import { Horizon } from '@stellar/stellar-sdk';
const server = new Horizon.Server('https://pubnet.stellarchain.io');
try {
const res = await server.ledgers().limit(10).call();
} catch (err: any) {
const problem = err?.response?.data;
if (problem?.type === 'https://orion.stellarchain.io/horizon-errors/rate_limit_exceeded') {
console.error('[rate_limit_exceeded] HTTP 429:', problem.detail, problem.extras);
}
}go
client := &horizonclient.Client{
HorizonURL: "https://pubnet.stellarchain.io",
}
_, err := client.Root()
if hErr := horizonclient.GetError(err); hErr != nil {
if hErr.Problem.Status == 429 {
log.Printf("Problem (%s): %s - extras=%v", hErr.Problem.Type, hErr.Problem.Detail, hErr.Problem.Extras)
}
}bash
curl -i -s "https://pubnet.stellarchain.io/" \
-H "Accept: application/hal+json"Common Root Causes
- Bursting above the per-IP request rate limit.
- Polling endpoints in a tight loop without backoff.