Rate Limits
API rate limiting policy and headers.
Updated
On this page
Overview
The DashForDevs API enforces rate limits to ensure fair usage and protect against abuse. Limits are per API key using a sliding window.
Rate Limit Tiers
| Key Type | Limit |
|---|---|
Public key (pk_*) | 120 requests/minute |
Secret key (sk_*) | 300 requests/minute |
| No key (anonymous) | 30 requests/minute |
Rate Limit Headers
Every API response includes rate limit headers:
X-RateLimit-Limit: 120
X-RateLimit-Remaining: 87
X-RateLimit-Reset: 1705312800
Handling 429 Errors
try {
const { products } = await dash.products.list()
} catch (error) {
if (error.status === 429) {
// Wait and retry
const retryAfter = error.headers?.["retry-after"] || 60
await new Promise(r => setTimeout(r, retryAfter * 1000))
// Retry the request
}
}
Best Practices
- Cache responses where possible (product lists, categories, global data)
- Use server-side data fetching to reduce client-side API calls
- Batch related requests instead of making many small ones
- Use the
getCore()/getOptions()split for product pages
Next Steps
- Error Codes — All error types
- REST API Rate Limiting — Full details
- Caching Strategies — Reducing API calls