Klodchain API

Public REST API for blockchain data

Fast & Free

No API key required

Rate Limited

10 requests/minute per IP

Real-time Data

Live blockchain data

Base URL

https://klodchain.vercel.app/api/v1

Rate Limiting

All API endpoints are rate limited to 10 requests per minute per IP address.

Rate limit information is included in response headers:

X-RateLimit-Limit: 10
X-RateLimit-Remaining: 9
X-RateLimit-Reset: 1705312200000

When rate limited, you'll receive a 429 Too Many Requests response.

Endpoints

GET
/api/v1/blocks

Get a list of blocks with pagination

Query Parameters

limit(number)default: 20- Number of blocks to return (max 100)
offset(number)default: 0- Number of blocks to skip
order(string)default: desc- Sort order: 'asc' or 'desc'

Response

{
  "success": true,
  "data": [
    {
      "id": "uuid",
      "slot": 12345,
      "blockhash": "abc123...",
      "leader_pubkey": "validator1",
      "transaction_count": 50,
      "timestamp": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "total": 1000,
    "limit": 20,
    "offset": 0,
    "hasMore": true
  }
}
GET
/api/v1/blocks/:slot

Get a specific block by slot number, including its transactions

Path Parameters

slot(number)
Required
- Block slot number

Response

{
  "success": true,
  "data": {
    "id": "uuid",
    "slot": 12345,
    "blockhash": "abc123...",
    "previous_blockhash": "xyz789...",
    "leader_pubkey": "validator1",
    "transaction_count": 3,
    "timestamp": "2024-01-15T10:30:00Z",
    "transactions": [
      {
        "signature": "sig123...",
        "transaction_type": "transfer",
        "from_pubkey": "klod_abc",
        "to_pubkey": "klod_xyz",
        "amount": 100000000,
        "fee": 5000,
        "status": "confirmed"
      }
    ]
  }
}

Quick Example

Fetch the latest 5 blocks using curl:

curl "https://klodchain.vercel.app/api/v1/blocks?limit=5"

Or using JavaScript:

const response = await fetch("https://klodchain.vercel.app/api/v1/blocks?limit=5");
const data = await response.json();
console.log(data);

Built with Next.js & Supabase