Rate Limits
Understanding API rate limits and best practices
Rate Limit Overview
MyDisct Solver API enforces two layers of rate limiting to ensure fair usage and protect the service. Both layers work simultaneously — a request must pass both checks to be processed.
Layer 1: IP-Based Rate Limit
A global rate limit is applied per IP address to protect against DDoS and brute-force attacks. This limit applies to all requests regardless of authentication status.
| Scope | Limit | Window | Error Code |
|---|---|---|---|
| Per IP Address | 1,000 requests | 1 minute | IP_RATE_LIMIT_EXCEEDED |
Layer 2: API Key-Based Rate Limit (RPM)
Each user has a personal RPM (Requests Per Minute) limit tied to their API key. The default RPM for
pay-per-use accounts is 1,000 requests per minute. Subscription packages may include higher RPM limits.
You can check your current RPM limit via the /accountInfo endpoint.
| Account Type | Default RPM | Customizable |
|---|---|---|
| Pay-per-use (Balance) | 1,000 | Admin can adjust per user |
| Subscription Package | Defined by package | Automatically set when package is activated |
Rate Limit Headers
Every authenticated API response includes rate limit information in the headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 985
X-RateLimit-Reset: 45
| Header | Description |
|---|---|
X-RateLimit-Limit |
Your maximum requests allowed per minute (RPM) |
X-RateLimit-Remaining |
Requests remaining in the current 1-minute window |
X-RateLimit-Reset |
Seconds until the rate limit window resets |
Rate Limit Error Responses
When you exceed a rate limit, you will receive a 429 Too Many Requests response.
IP Rate Limit Exceeded
Returned when too many requests come from the same IP address within 1 minute.
{
"success": false,
"errorId": "ERROR_RATE_LIMIT",
"errorCode": "IP_RATE_LIMIT_EXCEEDED",
"message": "Too many requests from this IP address. Please wait before retrying.",
"service": "MyDisct Solver",
"retryAfter": 60
}
API Key Rate Limit Exceeded
Returned when your API key exceeds its personal RPM limit within 1 minute.
{
"success": false,
"errorId": "ERROR_RATE_LIMIT",
"errorCode": "API_KEY_RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Your plan allows 1000 requests per minute.",
"service": "MyDisct Solver",
"rateLimit": {
"limit": 1000,
"remaining": 0,
"resetInSeconds": 42
}
}
Checking Your RPM Limit
You can check your current RPM limit using the /accountInfo endpoint:
{
"success": true,
"account": {
"email": "[email protected]",
"username": "myuser",
"balance": 25.50,
"currency": "USD",
"status": "active",
"rpm_limit": 1000,
"created_at": "2025-01-15T12:00:00.000Z"
}
}
Handling Rate Limits
Implement exponential backoff in your code to handle rate limits gracefully:
async function solveWithRetry(captchaData, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
const response = await fetch('https://solver-api.mydisct.com/createTask', {
method: 'POST',
headers: {
'apikey': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
auth: { token: 'YOUR_API_KEY' },
context: { source: 'api', version: '1.0.0' },
captcha: captchaData
})
});
if (response.status === 429) {
// Check reset header for optimal wait time
const resetSeconds = response.headers.get('X-RateLimit-Reset') || Math.pow(2, i) * 2;
console.log(`Rate limited. Waiting ${resetSeconds} seconds...`);
await new Promise(resolve => setTimeout(resolve, resetSeconds * 1000));
continue;
}
return await response.json();
} catch (error) {
if (i === maxRetries - 1) throw error;
await new Promise(resolve => setTimeout(resolve, Math.pow(2, i) * 1000));
}
}
}
Best Practices
- Monitor
X-RateLimit-Remainingheader to proactively throttle requests before hitting the limit - Use
X-RateLimit-Resetto know exactly when to retry instead of guessing - Implement exponential backoff for 429 responses
- Check your RPM limit via
/accountInfoand adjust your request rate accordingly - If you consistently hit limits, consider upgrading to a subscription package with higher RPM
- Use connection pooling for better performance
- Avoid sending bursts of requests — spread them evenly across the minute