Public API Documentation

Access real-time Monad blockchain data including staking metrics, validator information, and block statistics. Our public API is free to use with reasonable rate limits.

mainnettestnetBoth networks supported via the network parameter

Quick Start

Make your first API request to get current validator data:

curl "https://www.gmonads.com/api/v1/public/validators/epoch?network=testnet"

Base URL

https://www.gmonads.com/api/v1/public

Rate Limits

30 requests/min

No authentication required. Suitable for most use cases.

Rate Limit Headers

X-RateLimit-Limit:Maximum requests per window
X-RateLimit-Reset:Unix timestamp when limit resets
Retry-After:Seconds to wait (on 429 response)

Response Format

All responses follow a consistent JSON format:

{
  "success": true,
  "data": { ... },
  "meta": {
    "timestamp": "2024-01-15T12:00:00.000Z",
    "network": "testnet",
    ...
  }
}
success- Boolean indicating if the request was successful
data- The requested data (object or array)
meta- Metadata including timestamp, pagination info, etc.

Error Handling

Error responses include helpful information:

{
  "success": false,
  "error": {
    "message": "Rate limit exceeded",
    "code": 429
  },
  "documentation": "https://www.gmonads.com/api"
}

HTTP Status Codes

200Success
400Bad Request - Invalid parameters
404Not Found - Resource does not exist
429Rate Limit Exceeded
500Internal Server Error

Endpoints

Code Examples

JavaScript / TypeScript

async function getBlockStats() {
  const response = await fetch(
    'https://www.gmonads.com/api/v1/public/blocks/1m?network=testnet'
  );

  if (!response.ok) {
    throw new Error(`API error: ${response.status}`);
  }

  const { success, data, meta } = await response.json();
  console.log('Block stats (1-min resolution):', data);
  console.log('Data points:', meta.count);
  return data;
}

Python

import requests

def get_block_stats():
    response = requests.get(
        'https://www.gmonads.com/api/v1/public/blocks/1m',
        params={'network': 'testnet'}
    )
    response.raise_for_status()

    data = response.json()
    print(f"Success: {data['success']}")
    print(f"Data points: {data['meta']['count']}")
    return data['data']

stats = get_block_stats()

Best Practices

Respect Cache Headers

Our API returns Cache-Control headers. Use them to avoid unnecessary requests and stay within rate limits.

Handle Rate Limits Gracefully

Implement exponential backoff when you receive 429 responses. Check the Retry-After header for timing.

Use Appropriate Timeframes

Choose the smallest timeframe that meets your needs. Shorter timeframes return less data and are faster.

Batch Requests When Possible

If you need multiple data points, consider if a single endpoint with a longer timeframe could serve your needs.

Support

Have questions or need help? Reach out to us on X:

@gmonads