curl "https://data.quantcite.com/api/v1/data-usage/YOUR_API_KEY"
const apiKey = 'YOUR_API_KEY';
const response = await fetch(`https://data.quantcite.com/api/v1/data-usage/${apiKey}`);
const usageData = await response.json();
console.log(`Usage: ${usageData.data_usage.used_gb}GB / ${usageData.data_usage.limit_gb}GB`);
console.log(`Remaining: ${usageData.data_usage.remaining_gb}GB`);
import requests
api_key = "YOUR_API_KEY"
response = requests.get(f"https://data.quantcite.com/api/v1/data-usage/{api_key}")
usage_data = response.json()
print(f"Tier: {usage_data['billing_tier']}")
print(f"Usage: {usage_data['data_usage']['used_gb']}GB / {usage_data['data_usage']['limit_gb']}GB")
print(f"Days until reset: {usage_data['billing_period']['days_until_reset']}")
{
"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"
}
{
"error": "api_key_not_found",
"message": "The provided API key was not found",
"timestamp": "2025-01-30T10:30:00Z"
}
Public HTTP Endpoints
Monitor Data Usage
Monitor your current data usage and limits
GET
/
api
/
v1
/
data-usage
/
{api_key}
curl "https://data.quantcite.com/api/v1/data-usage/YOUR_API_KEY"
const apiKey = 'YOUR_API_KEY';
const response = await fetch(`https://data.quantcite.com/api/v1/data-usage/${apiKey}`);
const usageData = await response.json();
console.log(`Usage: ${usageData.data_usage.used_gb}GB / ${usageData.data_usage.limit_gb}GB`);
console.log(`Remaining: ${usageData.data_usage.remaining_gb}GB`);
import requests
api_key = "YOUR_API_KEY"
response = requests.get(f"https://data.quantcite.com/api/v1/data-usage/{api_key}")
usage_data = response.json()
print(f"Tier: {usage_data['billing_tier']}")
print(f"Usage: {usage_data['data_usage']['used_gb']}GB / {usage_data['data_usage']['limit_gb']}GB")
print(f"Days until reset: {usage_data['billing_period']['days_until_reset']}")
{
"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"
}
{
"error": "api_key_not_found",
"message": "The provided API key was not found",
"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
string
required
Your QuantCite API key for which to retrieve usage information.
Response
string
Unique identifier for your user account.
string
Your account username.
string
Your current subscription tier (basic, premium, developer, enterprise).
boolean
Whether your API key is currently active and valid.
object
Detailed data usage information for the current billing period.
Show data_usage object
Show data_usage object
number
Amount of data consumed in gigabytes for the current billing period.
number
Monthly data limit in gigabytes (50GB for all tiers).
number
Remaining data allowance in gigabytes.
number
Percentage of monthly data limit consumed.
number
Exact bytes consumed in the current billing period.
number
Monthly data limit in bytes.
object
object
string
ISO 8601 timestamp when the usage data was retrieved.
curl "https://data.quantcite.com/api/v1/data-usage/YOUR_API_KEY"
const apiKey = 'YOUR_API_KEY';
const response = await fetch(`https://data.quantcite.com/api/v1/data-usage/${apiKey}`);
const usageData = await response.json();
console.log(`Usage: ${usageData.data_usage.used_gb}GB / ${usageData.data_usage.limit_gb}GB`);
console.log(`Remaining: ${usageData.data_usage.remaining_gb}GB`);
import requests
api_key = "YOUR_API_KEY"
response = requests.get(f"https://data.quantcite.com/api/v1/data-usage/{api_key}")
usage_data = response.json()
print(f"Tier: {usage_data['billing_tier']}")
print(f"Usage: {usage_data['data_usage']['used_gb']}GB / {usage_data['data_usage']['limit_gb']}GB")
print(f"Days until reset: {usage_data['billing_period']['days_until_reset']}")
{
"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"
}
{
"error": "api_key_not_found",
"message": "The provided API key was not found",
"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.
