Guides
Rate Limits
Understanding VecTrade API rate limits, quotas, and optimization strategies.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Understanding VecTrade API rate limits, quotas, and optimization strategies.
| Plan | Requests/min | Monthly API calls | Burst | Concurrent |
|---|---|---|---|---|
| Free | 30 | 10,000 | 5 | 2 |
| Standard | 120 | 100,000 | 20 | 5 |
| Professional | 300 | 500,000 | 50 | 20 |
| Enterprise | Custom | Custom | Custom | Custom |
| Header | Description | Example |
|---|---|---|
X-VQ-RateLimit-Limit | Max requests per window | 1000 |
X-VQ-RateLimit-Remaining | Requests remaining in window | 987 |
X-VQ-RateLimit-Reset | Window reset time (Unix timestamp) | 1715800060 |
Retry-After | Seconds to wait (only on 429) | 2 |
# Python — retries are automatic
client = VecTrade(max_retries=3) # Default: 2
try:
quote = client.quotes.get("AAPL")
except RateLimitError as e:
# Only raised after all retries exhausted
print(f"Rate limited. Wait {e.retry_after}s")
// TypeScript — retries are automatic
const client = new VecTrade({ maxRetries: 3 });
try {
const quote = await client.quotes.get('AAPL');
} catch (e) {
if (e instanceof RateLimitError) {
console.log(`Wait ${e.retryAfter}s`);
}
}
# Access rate limit info from response metadata
quote = client.quotes.get("AAPL")
print(f"Remaining: {client.last_response.rate_limit.remaining}")
print(f"Resets at: {client.last_response.rate_limit.reset_timestamp}")
# ❌ 5 requests (5 rate limit tokens)
for symbol in ["AAPL", "GOOGL", "MSFT", "AMZN", "NVDA"]:
client.quotes.get(symbol)
# ✅ 1 request (1 rate limit token)
quotes = client.quotes.batch(["AAPL", "GOOGL", "MSFT", "AMZN", "NVDA"])
# ❌ Polling every 5 seconds (720 requests/hour)
while True:
quote = client.quotes.get("AAPL")
time.sleep(5)
# ✅ Webhook (0 requests — server pushes to you)
client.webhooks.create(
url="https://your-app.com/webhooks",
events=["quote.update"],
symbols=["AAPL"],
)
from functools import lru_cache
@lru_cache(maxsize=100, ttl=60) # Cache 60 seconds
def get_fundamentals(symbol: str):
return client.fundamentals.get(symbol)
quote = client.quotes.get("AAPL", fields=["price", "volume"])
| Scenario | HTTP Status | Error Type | SDK Exception | Retryable |
|---|---|---|---|---|
| Too many requests/minute | 429 | rate_limit_error | RateLimitError | Yes (auto) |
| Monthly quota exhausted | 429 | quota_exceeded | QuotaExceededError | No |
QuotaExceededError is NOT retryable — you’ve exhausted your monthly allocation.
Upgrade your plan at vectrade.io/vtrade/developer.