Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
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.
X-VQ-RateLimit-Limit
1000
X-VQ-RateLimit-Remaining
987
X-VQ-RateLimit-Reset
1715800060
Retry-After
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"])
rate_limit_error
RateLimitError
quota_exceeded
QuotaExceededError