API

Rate Limiting

Note: Rate limiting is not currently implemented at the API level in Gigantics. API endpoints do not enforce request rate limits or quotas.

Current Behavior

  • API endpoints accept unlimited requests
  • No rate limit headers are returned
  • No throttling or quota enforcement exists
  • All authenticated requests are processed

Future Considerations

While rate limiting is not currently implemented, you may want to implement client-side rate limiting for:

  1. Preventing accidental overload - Self-imposed limits prevent accidentally flooding endpoints
  2. Respecting server resources - Being a good API citizen
  3. Avoiding timeouts - Slower, controlled requests are more reliable

Implement Request Throttling

Even without server-side limits, consider throttling your requests:

// Simple throttling example
let lastRequest = 0;
const minDelay = 100; // 100ms between requests
 
async function throttledRequest(url) {
  const now = Date.now();
  const timeSinceLastRequest = now - lastRequest;
  if (timeSinceLastRequest < minDelay) {
    await sleep(minDelay - timeSinceLastRequest);
  }
  lastRequest = Date.now();
  return fetch(url);
}

Batch Requests

When possible, batch multiple operations:

  • Download multiple entities in one request if supported
  • Avoid rapid-fire requests for the same data
  • Cache responses when appropriate

Monitor Usage

Track your own request patterns:

  • Log request counts per endpoint
  • Monitor response times
  • Alert on unusual patterns

Monitoring Endpoint Usage

You can monitor API usage through the UI:

  1. Navigate to Project → API Keys
  2. Expand any API key row
  3. View the # calls count for each endpoint
  4. Check the "Last called" timestamp

This helps you understand:

  • Which endpoints are being used most
  • When endpoints were last accessed
  • Usage patterns over time

On this page