Use Case: WebSocket Real-Time Index Streaming
A sample Indexes API pricing simulation for streaming real-time index values over WebSocket.
Use Case: WebSocket Real-Time Index Streaming
This example estimates the cost of streaming real-time index values over the Indexes API WebSocket connection.
Assumptions
| Item | Value |
|---|---|
| Protocol | WebSocket |
| WebSocket endpoint | wss://ws-api.indexes.coinapi.io |
| Indexes | IDX_REFRATE_PRIMKT_BTC_USD, IDX_REFRATE_PRIMKT_ETH_USD, IDX_REFRATE_PRIMKT_SOL_USD |
| Number of indexes | 3 |
| Subscribe actions | 3 subscribe calls |
| Estimated transferred data | 10 GB/day |
| Usage pattern | 24 hours/day |
Example subscribed indexes:
| Index |
|---|
| IDX_REFRATE_PRIMKT_BTC_USD |
| IDX_REFRATE_PRIMKT_ETH_USD |
| IDX_REFRATE_PRIMKT_SOL_USD |
WebSocket data transfer estimate
WebSocket data transfer pricing is tiered daily.
For 10 GB/day:
| Tier | Usage | Cost |
|---|---|---|
| First 8 GB/day | 8 GB | $30.00 |
| 8.1 GB - 16 GB/day | 2 GB | $5.00 |
| Total/day | 10 GB | $35.00 |
Calculation:
8 GB ร $3.75 = $30.00
2 GB ร $2.50 = $5.00
Total:
$35.00/day
Estimated 30-day usage:
$35.00 ร 30 = $1,050.00/month
API call estimate
Each subscribe action counts as one API call.
For this example:
3 subscribe calls รท 1,000 ร $0.60 = $0.0018
The API call cost is minimal in this sample compared with WebSocket data transfer.
Plan comparison
| Plan | Price per Credit | Monthly cost | Included credits | Estimated monthly cost |
|---|---|---|---|---|
| Pay As You Go | $1.00/Credit | No commitment | N/A | $1,050.00 |
| Committed 64 | $0.85/Credit | $64 | ~75.29 credits | $1,038.71 |
| Committed 256 | $0.75/Credit | $256 | ~341.33 credits | $964.67 |
| Committed 512 | $0.70/Credit | $512 | ~731.43 credits | $830.57 |
| Committed 1024 | $0.65/Credit | $1,024 | ~1,575.38 credits | $1,024.00 |
Result
For this sample, Committed 512 has the lowest estimated cost among the listed self-service plans.
Pay As You Go may be simpler for short tests. Higher-volume or long-running WebSocket production usage may benefit from a committed plan or Enterprise discussion.
Caveat
Actual WebSocket data transfer depends on the number of subscribed indexes, update frequency, message size, market activity, reconnect behavior, and whether multiple clients maintain separate WebSocket connections.