API Usage & Limits

Learn about API rate limits, monitoring usage, billing, and troubleshooting common issues.

Monitoring API Usage

Usage Dashboard

Track API activity in real-time:

Key Metrics:

  • Total requests (today/week/month)
  • Success rate
  • Error rate
  • Average response time
  • Bandwidth used

Screenshot Placeholder: Usage dashboard

Performance Charts:

  • Requests over time
  • Endpoint popularity
  • Error types distribution
  • Response time trends
  • Traffic patterns

Request Logs

Detailed request history:

  • Timestamp
  • Endpoint called
  • HTTP method
  • Status code
  • Response time
  • IP address
  • User agent
  • Request size
  • Response size

Screenshot Placeholder: Request logs

Filtering Options:

  • By date range
  • By endpoint
  • By status (success/error)
  • By API key
  • By response time
  • By IP address

Error Tracking

Monitor and resolve errors:

Common Error Codes:

  • 401: Authentication failed (invalid key)
  • 403: Forbidden (insufficient permissions)
  • 404: Endpoint or resource not found
  • 422: Validation error (invalid parameters)
  • 429: Rate limit exceeded
  • 500: Server error
  • 503: Service unavailable

Screenshot Placeholder: Error logs

Error Details Include:

  • Error message
  • Request parameters
  • Stack trace (when available)
  • Suggested resolution
  • Related documentation

Performance Analytics

Track Performance:

  • Average response time
  • 95th percentile response time
  • Slowest endpoints
  • Peak usage times
  • Geographic latency
  • Error rates by endpoint

Screenshot Placeholder: Performance analytics

Rate Limits & Quotas

Standard Limits

Default Rate Limits:

  • Per minute: 100 requests
  • Per hour: 5,000 requests
  • Per day: 10,000 requests
  • Per month: 100,000 requests

Burst Allowance:

  • Brief spikes allowed
  • Token bucket algorithm
  • Average maintained over time
  • Graceful degradation

Screenshot Placeholder: Rate limit dashboard

Rate Limit Headers

Response Headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1678195200

Use These Headers:

  • Track remaining quota
  • Know when limit resets
  • Implement smart throttling
  • Prevent hitting limits

Exceeding Limits

When You Exceed:

  • 429 status code returned
  • Retry-After header provided
  • Request may be queued
  • Automatic backoff suggested

Screenshot Placeholder: Rate limit exceeded

Example Response:

{
  "error": "rate_limit_exceeded",
  "message": "Too many requests",
  "retry_after": 60,
  "limit": 100,
  "window": "minute"
}

Implementing Backoff

Exponential Backoff:

async function makeRequestWithRetry(url, options, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      const response = await fetch(url, options);
      
      if (response.status === 429) {
        const retryAfter = response.headers.get('Retry-After') || (i + 1) * 2;
        console.log(`Rate limited. Retrying after ${retryAfter}s`);
        await sleep(retryAfter * 1000);
        continue;
      }
      
      return response;
    } catch (error) {
      if (i === maxRetries - 1) throw error;
      await sleep((i + 1) * 1000);
    }
  }
}

Increasing Limits

Request Higher Limits:

  1. Contact support
  2. Provide use case details
  3. Expected traffic volume
  4. Traffic patterns
  5. Business justification

Information Needed:

  • Current usage patterns
  • Expected growth
  • Peak traffic times
  • Integration details
  • Business impact

Screenshot Placeholder: Request limit increase

Enterprise Plans:

  • Custom rate limits
  • Dedicated resources
  • Priority support
  • SLA guarantees
  • Higher quotas

Alerts & Notifications

Alert Configuration

Set up alerts for:

Usage Alerts:

  • Approaching rate limit (80%)
  • Rate limit exceeded
  • Quota almost exhausted
  • Unusual traffic spike

Error Alerts:

  • Error rate exceeds threshold (10%)
  • Specific error types
  • Multiple failed authentications
  • Service degradation

Performance Alerts:

  • Slow response times
  • Timeout increases
  • Latency spikes

Screenshot Placeholder: Alert configuration

Notification Methods

Delivery Options:

  • Email
  • SMS (critical only)
  • Push notification
  • Webhook
  • Slack/Teams integration
  • PagerDuty integration

Alert Severity:

  • Info: General notifications
  • Warning: Approaching thresholds
  • Error: Issues requiring attention
  • Critical: Immediate action needed

API Billing & Costs

Pricing Model

Standard Tier (Included):

  • All API features
  • Standard rate limits
  • Test environment unlimited
  • Documentation and support
  • No additional cost

Screenshot Placeholder: API pricing

What's Included:

  • Venue endpoints
  • Availability checks
  • Reservation management
  • Webhook notifications
  • Standard monitoring
  • Email support

Additional Costs

Optional Upgrades:

  • Higher rate limits
  • Dedicated resources
  • Premium support
  • Custom integrations
  • SLA guarantees
  • Advanced analytics

Enterprise Pricing:

  • Contact sales for quote
  • Custom rate limits
  • Volume discounts
  • Multi-venue pricing
  • Annual contracts

Usage Tracking

Monitor costs:

  • Requests used vs. allowance
  • Projected monthly total
  • Cost per request (enterprise)
  • Overage charges (if applicable)
  • Billing forecast

Screenshot Placeholder: Usage tracking

Troubleshooting

Authentication Errors

401 Unauthorized:

Causes:

  • Invalid API key
  • Expired key
  • Revoked key
  • Missing Authorization header

Solutions:

  • Verify API key is correct
  • Check key not revoked
  • Correct header format: Bearer {key}
  • Ensure key has necessary permissions

Screenshot Placeholder: Auth troubleshooting

Check Your Request:

curl -H "Authorization: Bearer gat_live_..." \
  https://api.grabatable.app/v1/venues/123

Rate Limiting Issues

429 Too Many Requests:

Solutions:

  • Implement exponential backoff
  • Cache responses where possible
  • Batch requests together
  • Review usage patterns
  • Request limit increase
  • Optimize API calls

Best Practices:

// Cache availability for 5 minutes
const cache = new Map();

async function getAvailability(date) {
  const cacheKey = `availability-${date}`;
  
  if (cache.has(cacheKey)) {
    const cached = cache.get(cacheKey);
    if (Date.now() - cached.time < 300000) {
      return cached.data;
    }
  }
  
  const data = await fetchAvailability(date);
  cache.set(cacheKey, { data, time: Date.now() });
  return data;
}

Connection Issues

Timeout or No Response:

Check:

  • Internet connectivity
  • API endpoint URL
  • Firewall rules
  • DNS resolution
  • SSL certificate validity
  • Grab A Table status page

Test with cURL:

curl -v https://api.grabatable.app/v1/health

Invalid Requests

400 Bad Request / 422 Validation Error:

Common Issues:

  • Missing required parameters
  • Invalid parameter format
  • Wrong data types
  • Invalid date/time format
  • Party size out of range

Solution:

  • Review API documentation
  • Validate input data
  • Check parameter types
  • Use testing console
  • Review error message details

Screenshot Placeholder: Validation errors

Server Errors

500 Internal Server Error:

What to Do:

  • Retry request (may be transient)
  • Check status page
  • Review recent changes
  • Contact support if persists
  • Provide request details

503 Service Unavailable:

  • Planned maintenance (check announcements)
  • Temporary outage
  • Retry with backoff
  • Subscribe to status updates

Best Practices

Performance Optimization

Do:

  • ✓ Cache responses appropriately
  • ✓ Batch requests when possible
  • ✓ Use webhooks instead of polling
  • ✓ Implement pagination
  • ✓ Compress request/response
  • ✓ Use conditional requests (ETag)
  • ✓ Minimize payload size

Don't:

  • ✗ Poll excessively for updates
  • ✗ Request unnecessary data
  • ✗ Ignore rate limits
  • ✗ Make redundant API calls
  • ✗ Store stale data too long
  • ✗ Fetch all data at once
  • ✗ Skip error handling

Screenshot Placeholder: Performance tips

Caching Strategy

What to Cache:

  • Venue information (1 hour)
  • Availability (5-15 minutes)
  • Static content (1 day)
  • Configuration (until changed)

What Not to Cache:

  • Reservation confirmations
  • Real-time availability checks
  • User-specific data
  • Time-sensitive operations

Error Handling

Robust Error Handling:

async function createReservation(data) {
  try {
    const response = await fetch(API_URL, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${API_KEY}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(data)
    });
    
    if (!response.ok) {
      const error = await response.json();
      throw new Error(error.message || 'Request failed');
    }
    
    return await response.json();
    
  } catch (error) {
    // Log error for debugging
    console.error('Reservation failed:', error);
    
    // Show user-friendly message
    if (error.message.includes('rate_limit')) {
      return { error: 'Too many requests, please try again shortly' };
    }
    
    if (error.message.includes('unavailable')) {
      return { error: 'This time slot is no longer available' };
    }
    
    return { error: 'Booking failed, please try again' };
  }
}

Development Workflow

Recommended Process:

  1. Use Test Keys: Develop with sandbox
  2. Test Thoroughly: Cover edge cases
  3. Monitor Usage: Track API calls during development
  4. Handle Errors: Implement comprehensive error handling
  5. Implement Retry: With exponential backoff
  6. Cache Wisely: Balance freshness vs. performance
  7. Document: Internal API usage documentation
  8. Deploy Gradually: Phased rollout
  9. Monitor Production: Active monitoring post-launch
  10. Have Fallback: Manual process if API unavailable

Maintenance

Regular Tasks:

  • Weekly: Review error logs
  • Monthly: Analyze usage patterns
  • Quarterly: Review and optimize
  • Annually: Comprehensive audit

API Status & Health

Status Page

Check API health:

  • Current status
  • Incident history
  • Scheduled maintenance
  • Performance metrics
  • Subscribe to updates

Status Page: status.grabatable.app

Screenshot Placeholder: Status page

Health Endpoint

Check API Availability:

GET https://api.grabatable.app/v1/health

Response:

{
  "status": "operational",
  "timestamp": "2026-03-07T10:30:00Z",
  "version": "v1",
  "services": {
    "api": "operational",
    "database": "operational",
    "webhooks": "operational"
  }
}

Next Steps

Need Help?

If you have questions about API usage or limits, contact our support team at [email protected] or via WhatsApp.

API Support Includes:

  • Integration assistance
  • Troubleshooting help
  • Performance optimization
  • Limit increase requests
  • Best practice guidance
×