API Documentation

Authentication

All API requests require authentication via an API key. Include your key in the X-API-Key header.

curl -H "X-API-Key: YOUR_API_KEY" \
https://api.comet.example/api/v1/blocks

Rate Limits

Rate limits are applied per API key. Check response headers for current limits:

Header Description
X-RateLimit-Limit Requests per minute
X-RateLimit-Remaining Remaining requests in current window
X-RateLimit-Reset Unix timestamp when window resets

Endpoints

Chain

GET /api/v1/chain/summary

Get chain summary including latest height and average block time

Blocks

GET /api/v1/blocks

List blocks with pagination

Parameters: limit (max 100), before (cursor)

GET /api/v1/blocks/{height}

Get block by height

Transactions

GET /api/v1/txs

List transactions

Parameters: limit, offset, failed, height

GET /api/v1/txs/{tx_hash}

Get transaction by hash (includes events)

Events

GET /api/v1/events

List events

Parameters: event_type, tx_hash, limit, offset

Statistics

GET /api/v1/stats

Get pre-computed chain statistics (TPS, avg block time, etc.)

Error Codes

Code Description
401 Missing or invalid API key
404 Resource not found
429 Rate limit exceeded
500 Internal server error