Rate Limiting
The Virtual Inventory Public API implements rate limiting to ensure system stability and fair resource allocation among all clients.
Understanding Rate Limits
- Name
Request Limits- Description
There are limits to the number of API requests you can make within a given time period
- Name
Status Code- Description
When you exceed the rate limit, the API will respond with a 429 (Too Many Requests) status code
- Name
Headers- Description
Rate limit information is included in response headers:
- X-RateLimit-Limit: Maximum requests per window
- X-RateLimit-Remaining: Remaining requests in current window
- X-RateLimit-Reset: Time when the rate limit resets
Best Practices
- Name
Exponential Backoff- Description
Implement exponential backoff when retrying rate-limited requests
- Name
Request Batching- Description
Batch related requests together to minimize API calls
- Name
Monitoring- Description
Monitor rate limit headers to stay within limits
- Name
Caching- Description
Cache responses when possible to reduce API calls
Example Implementation
Rate Limit Handling
async function makeRequest(url: string, retries = 3): Promise<Response> {
for (let i = 0; i < retries; i++) {
try {
const response = await fetch(url);
// Check rate limit headers
const remaining = response.headers.get('X-RateLimit-Remaining');
const reset = response.headers.get('X-RateLimit-Reset');
if (response.status === 429) {
// Calculate delay with exponential backoff
const delay = Math.min(1000 * Math.pow(2, i), 8000);
await new Promise(resolve => setTimeout(resolve, delay));
continue;
}
return response;
} catch (error) {
if (i === retries - 1) throw error;
}
}
throw new Error('Max retries exceeded');
}
While specific rate limits are still being finalized, implementing these best practices will help ensure your integration remains robust when limits are enforced.

