Overview
The PricingSaaS Intelligence API implements rate limiting to ensure fair usage and maintain service quality for all users. Rate limits vary by subscription tier.
Rate Limit Tiers
Free Tier
Pro Tier
Enterprise Tier
100 requests per hour
Perfect for testing and small projects
Resets every hour
No credit card required
1,000 requests per hour
10x the free tier capacity
Suitable for production applications
$49/month
Custom rate limits
Tailored to your needs
Dedicated support
SLA guarantees
Contact sales for pricing
Every API response includes headers showing your current rate limit status:
HTTP / 1.1 200 OK
X-RateLimit-Limit : 1000
X-RateLimit-Remaining : 987
X-RateLimit-Reset : 1640995200
Maximum requests allowed in the current window
Number of requests remaining in the current window
Unix timestamp when the rate limit resets
const response = await fetch (
'https://api.pricingsaas.com/functions/v1/api/companies' ,
{
headers: {
'Authorization' : `Bearer ${ API_KEY } `
}
}
);
const limit = response . headers . get ( 'X-RateLimit-Limit' );
const remaining = response . headers . get ( 'X-RateLimit-Remaining' );
const reset = response . headers . get ( 'X-RateLimit-Reset' );
console . log ( `Rate limit: ${ remaining } / ${ limit } ` );
console . log ( `Resets at: ${ new Date ( reset * 1000 ) } ` );
Rate Limit Exceeded
When you exceed your rate limit, the API returns a 429 Too Many Requests response:
{
"error" : "Rate limit exceeded" ,
"message" : "You have exceeded your rate limit of 100 requests per hour" ,
"retry_after" : 3600
}
Status Code: 429 Too Many RequestsHeaders:
Retry-After: Seconds until you can make requests again
X-RateLimit-Reset: Unix timestamp when limit resets
Handling Rate Limits
Exponential Backoff
Implement exponential backoff when you hit rate limits:
async function fetchWithRetry ( url , maxRetries = 3 ) {
for ( let i = 0 ; i < maxRetries ; i ++ ) {
const response = await fetch ( url , {
headers: { 'Authorization' : `Bearer ${ API_KEY } ` }
});
if ( response . status === 429 ) {
const retryAfter = response . headers . get ( 'Retry-After' );
const delay = retryAfter ? parseInt ( retryAfter ) * 1000 : Math . pow ( 2 , i ) * 1000 ;
console . log ( `Rate limited. Retrying in ${ delay } ms` );
await new Promise ( resolve => setTimeout ( resolve , delay ));
continue ;
}
return response ;
}
throw new Error ( 'Max retries exceeded' );
}
Request Throttling
Proactively throttle your requests to stay under the limit:
class RateLimiter {
constructor ( maxRequests , windowMs ) {
this . maxRequests = maxRequests ;
this . windowMs = windowMs ;
this . requests = [];
}
async throttle () {
const now = Date . now ();
this . requests = this . requests . filter ( time => now - time < this . windowMs );
if ( this . requests . length >= this . maxRequests ) {
const oldestRequest = this . requests [ 0 ];
const waitTime = this . windowMs - ( now - oldestRequest );
await new Promise ( resolve => setTimeout ( resolve , waitTime ));
}
this . requests . push ( now );
}
}
// Usage: 100 requests per hour for free tier
const limiter = new RateLimiter ( 100 , 60 * 60 * 1000 );
async function fetchCompanies () {
await limiter . throttle ();
return fetch ( 'https://api.pricingsaas.com/functions/v1/api/companies' , {
headers: { 'Authorization' : `Bearer ${ API_KEY } ` }
});
}
Best Practices
Cache API responses to reduce redundant requests. Company data doesn’t change frequently. const cache = new Map ();
async function getCachedCompany ( slug ) {
if ( cache . has ( slug )) {
return cache . get ( slug );
}
const response = await fetch (
`https://api.pricingsaas.com/functions/v1/api/companies/ ${ slug } ` ,
{ headers: { 'Authorization' : `Bearer ${ API_KEY } ` } }
);
const data = await response . json ();
cache . set ( slug , data );
return data ;
}
Use pagination to fetch multiple records in fewer requests: # Instead of 10 requests for 10 companies:
curl "https://api.pricingsaas.com/functions/v1/api/companies?limit=10"
# More efficient than 10 individual requests
Track your rate limit usage in real-time: const remaining = parseInt ( response . headers . get ( 'X-RateLimit-Remaining' ));
const limit = parseInt ( response . headers . get ( 'X-RateLimit-Limit' ));
const percentUsed = (( limit - remaining ) / limit ) * 100 ;
if ( percentUsed > 80 ) {
console . warn ( `Warning: ${ percentUsed . toFixed ( 1 ) } % of rate limit used` );
}
Request Only What You Need
Use query parameters to filter results and reduce unnecessary data transfer: # Get only what you need
curl "https://api.pricingsaas.com/functions/v1/api/companies?category=Communication&limit=5"
If you’re consistently hitting rate limits, consider upgrading to Pro tier for 10x capacity.
Rate Limit FAQs
Do rate limits reset at midnight?
No, rate limits use a sliding window. They reset exactly one hour after your first request in the current window.
Are rate limits per API key or per account?
Rate limits are per API key. If you have multiple keys, each has its own rate limit.
What happens if I upgrade mid-cycle?
Your rate limit increases immediately upon upgrade. The reset timer remains the same.
Are failed requests counted?
No, only successful responses (2xx status codes) count toward your rate limit. 4xx and 5xx errors don’t count.
Can I request a temporary rate limit increase?
Enterprise customers can request temporary increases. Contact support with your use case.
Monitoring Your Usage
View your API usage in the dashboard:
Real-time usage: Current requests in the window
Historical trends: Daily and monthly usage graphs
Rate limit violations: When and why you hit limits
Usage forecasting: Predict when you’ll need to upgrade
View Usage Dashboard Monitor your API usage and rate limits in real-time
Need Higher Limits?