Skip to main content
GET
https://data.quantcite.com
/
api
/
v1
/
data-usage
/
{api_key}
curl "https://data.quantcite.com/api/v1/data-usage/YOUR_API_KEY"
{
  "user_id": "cb88461f-421a-4ac8-9722-afe248a40ae6",
  "username": "trader123",
  "billing_tier": "premium",
  "api_key_active": true,
  "data_usage": {
    "used_gb": 12.5,
    "limit_gb": 50.0,
    "remaining_gb": 37.5,
    "usage_percentage": 25.0,
    "bytes_used": 13421772800,
    "bytes_limit": 53687091200
  },
  "billing_period": {
    "reset_date": "2025-01-15T00:00:00Z",
    "days_until_reset": 15,
    "next_reset": "2025-02-15T00:00:00Z"
  },
  "status": {
    "limit_exceeded": false,
    "warning_threshold": false,
    "api_key_status": "active"
  },
  "timestamp": "2025-01-30T10:30:00Z"
}
Monitor your current data usage and limits for your API key. This endpoint provides detailed information about your monthly data consumption, billing period, and account status.

Path Parameters

api_key
string
required
Your QuantCite API key for which to retrieve usage information.

Response

user_id
string
Unique identifier for your user account.
username
string
Your account username.
billing_tier
string
Your current subscription tier (basic, premium, developer, enterprise).
api_key_active
boolean
Whether your API key is currently active and valid.
data_usage
object
Detailed data usage information for the current billing period.
billing_period
object
Information about the current billing cycle.
status
object
Current account and usage status indicators.
timestamp
string
ISO 8601 timestamp when the usage data was retrieved.
curl "https://data.quantcite.com/api/v1/data-usage/YOUR_API_KEY"
{
  "user_id": "cb88461f-421a-4ac8-9722-afe248a40ae6",
  "username": "trader123",
  "billing_tier": "premium",
  "api_key_active": true,
  "data_usage": {
    "used_gb": 12.5,
    "limit_gb": 50.0,
    "remaining_gb": 37.5,
    "usage_percentage": 25.0,
    "bytes_used": 13421772800,
    "bytes_limit": 53687091200
  },
  "billing_period": {
    "reset_date": "2025-01-15T00:00:00Z",
    "days_until_reset": 15,
    "next_reset": "2025-02-15T00:00:00Z"
  },
  "status": {
    "limit_exceeded": false,
    "warning_threshold": false,
    "api_key_status": "active"
  },
  "timestamp": "2025-01-30T10:30:00Z"
}

Usage Monitoring Best Practices

Automated Monitoring

import requests
import time

def monitor_usage(api_key, threshold=40.0):
    """Monitor data usage and alert when threshold is reached"""
    response = requests.get(f"https://data.quantcite.com/api/v1/data-usage/{api_key}")
    
    if response.status_code == 200:
        data = response.json()
        used_gb = data['data_usage']['used_gb']
        limit_gb = data['data_usage']['limit_gb']
        
        if used_gb >= threshold:
            print(f"WARNING: High usage detected: {used_gb}GB / {limit_gb}GB")
            return True
    
    return False

# Check usage every hour
while True:
    monitor_usage("your_api_key")
    time.sleep(3600)  # 1 hour

Usage Dashboard

async function createUsageDashboard(apiKey) {
    const response = await fetch(`https://data.quantcite.com/api/v1/data-usage/${apiKey}`);
    const data = await response.json();
    
    const usage = data.data_usage;
    const billing = data.billing_period;
    
    console.log(`
    ╔══════════════════════════════════════╗
    ║           QUANTCITE USAGE            ║
    ╠══════════════════════════════════════╣
    ║ Tier: ${data.billing_tier.toUpperCase().padEnd(28)}
    ║ Used: ${usage.used_gb}GB / ${usage.limit_gb}GB${' '.repeat(20 - `${usage.used_gb}GB / ${usage.limit_gb}GB`.length)}
    ║ Remaining: ${usage.remaining_gb}GB${' '.repeat(23 - `${usage.remaining_gb}GB`.length)}
    ║ Usage: ${usage.usage_percentage.toFixed(1)}%${' '.repeat(25 - `${usage.usage_percentage.toFixed(1)}%`.length)}
    ║ Reset in: ${billing.days_until_reset} days${' '.repeat(20 - `${billing.days_until_reset} days`.length)}
    ╚══════════════════════════════════════╝
    `);
}

Error Responses

Invalid API Key

Status Code: 404 Not Found
{
  "error": "api_key_not_found",
  "message": "The provided API key was not found",
  "timestamp": "2025-01-30T10:30:00Z"
}

Suspended Account

Status Code: 401 Unauthorized
{
  "error": "account_suspended",
  "message": "Your account has been suspended. Contact support.",
  "timestamp": "2025-01-30T10:30:00Z"
}

Integration Tips

Regular Monitoring

Check usage regularly to avoid hitting the 50GB monthly limit. Set up automated alerts at 80% usage.

Usage Optimization

Monitor usage patterns to optimize your WebSocket subscriptions and reduce data consumption.

Billing Awareness

Track billing periods and plan your data usage accordingly. Usage resets monthly.

Error Handling

Implement proper error handling for invalid API keys and suspended accounts.
This endpoint does not require admin authentication and can be called by providing your API key as a path parameter. It does not count against your rate limits or data usage.