API Reference

Complete documentation for all available endpoints, parameters, and response formats

Base URL

All API endpoints are accessible through the following base URL:

http://test-may-us-01.windnetwork.ai:3000/api

Authentication

Currently, the API does not require authentication for public endpoints. Future versions will support API key authentication for premium features.

API Endpoints

Endpoints

Health & Status

Blocks

Transactions

Accounts

Health Check

GET/health

Returns the health status of the API server.

Response

{
  "status": "ok",
  "version": "1.0.0",
  "timestamp": "2024-03-21T12:00:00Z"
}

WebSocket Endpoints

Account Updates

WS/ws/accounts

WebSocket endpoint for real-time account updates.

Message Format

{
  "type": "account_update",
  "pubkey": "pubkey123...",
  "lamports": 1000000000,
  "timestamp": "2024-03-21T12:00:00Z"
}

Error Responses

All endpoints may return the following error responses:

400 Bad Request

{
  "error": "Invalid request parameters",
  "details": "Detailed error message"
}

404 Not Found

{
  "error": "Resource not found",
  "details": "The requested resource does not exist"
}

500 Internal Server Error

{
  "error": "Internal server error",
  "details": "An unexpected error occurred"
}

Rate Limiting

The API implements rate limiting to ensure fair usage. Current limits:

  • • 100 requests per minute per IP address
  • • 1000 requests per hour per IP address

Rate limit headers are included in all responses:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1616323200

SDK Examples

TypeScript Example

import { WindClient } from '@windnetwork/sdk';

const client = new WindClient('http://test-may-us-01.windnetwork.ai:3000/api');

// Get latest block
const latestBlock = await client.getLatestBlock();

// Get account information
const accountInfo = await client.getAccount('pubkey123...');

// Subscribe to account updates
client.subscribeToAccounts((update) => {
  console.log('Account update:', update);
});

Python Example

import requests

BASE_URL = 'http://test-may-us-01.windnetwork.ai:3000/api'

# Get latest block
response = requests.get(f'{BASE_URL}/blocks/latest')
latest_block = response.json()

# Get account information
response = requests.get(f'{BASE_URL}/account/pubkey123...')
account_info = response.json()

Support

For API support or to report issues, please contact: