Quota Headers
Every API response includes headers that show your current quota usage and limits. These headers help you track your usage and implement proper rate limiting in your applications.
Response Headers
Section titled “Response Headers”X-Quota-Remaining
Section titled “X-Quota-Remaining”Type: integer
Number of API calls remaining in your current quota period.
X-Quota-Limit
Section titled “X-Quota-Limit”Type: integer
Total number of API calls allowed in your quota period.
X-Quota-Used
Section titled “X-Quota-Used”Type: integer
Number of API calls used in your current quota period.
X-Quota-Reset
Section titled “X-Quota-Reset”Type: unix timestamp
Unix timestamp when your quota will reset.
X-Quota-Type
Section titled “X-Quota-Type”Type: string
Either “daily” or “monthly” indicating your quota period type.
Quota Limits by Plan
Section titled “Quota Limits by Plan”100 requests/day
Resets daily at midnight UTC
Developer
Section titled “Developer”10,000 requests/month
Resets monthly on your billing date
Professional
Section titled “Professional”50,000 requests/month
Resets monthly on your billing date
Business
Section titled “Business”150,000 requests/month
Resets monthly on your billing date
Enterprise
Section titled “Enterprise”Custom limits
Contact sales for custom quotas
Example Headers
Section titled “Example Headers”Daily Quota (Free)
Section titled “Daily Quota (Free)”X-Quota-Remaining: 92X-Quota-Limit: 100X-Quota-Used: 8X-Quota-Reset: 1735689600X-Quota-Type: dailyShows 8 calls used out of 100 daily limit, with 92 remaining. Quota resets at midnight UTC.
Monthly Quota (Developer/Professional/Business/Enterprise)
Section titled “Monthly Quota (Developer/Professional/Business/Enterprise)”X-Quota-Remaining: 8500X-Quota-Limit: 10000X-Quota-Used: 1500X-Quota-Reset: 1738368000X-Quota-Type: monthlyShows 1,500 calls used out of 10,000 monthly limit (Developer plan example). Quota resets on billing cycle date.
Usage in Code
Section titled “Usage in Code”const response = await fetch('https://api.newsdatahub.com/v1/news', { headers: { 'X-API-Key': 'your-api-key', 'User-Agent': 'docs-quota-headers/1.0-js' }});
const remaining = parseInt(response.headers.get('X-Quota-Remaining'));const resetTime = parseInt(response.headers.get('X-Quota-Reset'));
if (remaining < 10) { console.warn('Low quota remaining:', remaining);}
// Calculate time until resetconst timeUntilReset = (resetTime * 1000) - Date.now();Quota Exhaustion (403 vs 429)
Section titled “Quota Exhaustion (403 vs 429)”When you exhaust your quota, you’ll receive a 403 Forbidden response (not 429):
{ "error": "Quota Exceeded", "message": "You have exhausted your monthly/daily API quota. Visit https://newsdatahub.com/plans to upgrade your plan or wait for your quota to reset."}Key difference:
- 403 (Quota Exhausted): Used all allocated requests for the period - upgrade plan or wait for reset
- 429 (Rate Limited): Making requests too quickly (per-minute limit) - slow down and retry
Both include X-Quota-* headers showing your usage and reset time.
Best Practices
Section titled “Best Practices”- Monitor quota headers on every response to track usage proactively
- Implement client-side rate limiting based on remaining quota
- Cache responses when possible to reduce API calls
- Handle 403 quota errors gracefully - direct users to upgrade page or show reset time
- Handle 429 rate limit errors with exponential backoff retry logic
- Set up alerts for low quota thresholds
- Consider upgrading if you consistently hit limits