Skip to main content

Connection URLs

Production (SSL/WSS)

wss://data.quantcite.com/api/v1/ws
Important: Authentication is done via WebSocket message, not URL parameter for enhanced security.

Connection Flow

1

Establish Connection

Connect to the secure WebSocket endpoint (no API key in URL).
const ws = new WebSocket('wss://data.quantcite.com/api/v1/ws');
2

Receive Welcome Message

Upon successful connection, you’ll receive a welcome message with available commands.
{
  "type": "welcome",
  "message": "Connected to QuantCite WebSocket API",
  "available_commands": [
    "authenticate", "subscribe_aggregated", "get_exchanges", "get_pairs"
  ]
}
3

Authenticate Session

Send authentication message to verify your API key and get session details.
{
  "type": "authenticate",
  "api_key": "demo_key_123"
}

Connection Health

Ping/Pong Messages

Maintain connection health using ping/pong messages: Send Ping:
{
  "type": "ping"
}
Receive Pong:
{
  "type": "pong",
  "timestamp": "2025-08-19T20:45:13.392607",
  "server_time": "2025-08-19T20:45:13.392607",
  "latency_ms": 2.5
}

Connection Monitoring

Monitor your connection status:
  • Send ping messages every 30 seconds
  • Handle connection drops gracefully
  • Implement exponential backoff for reconnections
  • Monitor data usage in real-time

Error Handling

Connection Errors

Common connection issues and solutions:
Error: Connection refused or immediate disconnectSolution: Verify your API key is valid and active
curl "https://data.quantcite.com/api/v1/data-usage/YOUR_API_KEY"
Error: Connection throttled or rejectedSolution: Implement proper rate limiting based on your tier
  • Basic: 600 req/min
  • Premium: 1,200 req/min
  • Developer: 1,000 req/min
  • Enterprise: 10,000 req/min
Error: Connection terminated due to data usageSolution: Monitor your 50GB monthly limit
{
  "type": "data_limit_exceeded",
  "message": "Monthly data limit of 50GB exceeded"
}

Best Practices

Connection Management

  • Use persistent connections
  • Implement automatic reconnection
  • Handle network interruptions gracefully
  • Monitor connection latency

Resource Usage

  • Monitor data consumption
  • Unsubscribe from unused symbols
  • Implement proper error handling
  • Use ping/pong for health checks
The QuantCite API uses WebSocket and REST connections. HTTP endpoints are only available for health checks and data usage monitoring.