Skip to main content
GET
/
{network}
/
healthcheck
{
  "staus": 123,
  "message": "<string>"
}

Overview

The Health Check endpoint allows you to verify the API status and check if a specific network is operational. This is useful for monitoring, debugging, and implementing fallback logic in your application.

Supported Networks

  • Base
  • HyperEVM
  • Scroll
  • Starknet
https://api.fibrous.finance/base/healthcheck

Response

staus
number
HTTP status code (200 = healthy)
message
string
Health status message indicating the API is operational

Example Request

curl "https://api.fibrous.finance/base/healthcheck"

Example Response

{
  "staus": 200,
  "message": "{Base} Fibrous Finance Router is alive and well - routing your tokens faster than you can say \"impermanent loss\""
}

Use Cases

Monitoring

Monitor API availability in your application dashboard

Fallback Logic

Implement fallback to alternative networks if one is down

Load Balancing

Route traffic based on network latency

Debugging

Verify API connectivity when troubleshooting

Implementation Example

class FibrousClient {
  constructor() {
    this.networks = ['base', 'hyperevm', 'scroll', 'starknet'];
  }
  
  async getHealthyNetwork() {
    const healthChecks = await Promise.all(
      this.networks.map(async (network) => {
        try {
          const response = await fetch(
            `https://api.fibrous.finance/${network}/health`
          );
          const data = await response.json();
          return {
            network,
            status: data.status,
            latency: data.latency?.rpc || Infinity
          };
        } catch (error) {
          return {
            network,
            status: 'unhealthy',
            latency: Infinity
          };
        }
      })
    );
    
    // Find the healthiest network with lowest latency
    const healthy = healthChecks
      .filter(check => check.status === 'healthy')
      .sort((a, b) => a.latency - b.latency);
    
    return healthy[0]?.network || null;
  }
  
  async executeSwapWithFallback(swapParams) {
    const network = await this.getHealthyNetwork();
    
    if (!network) {
      throw new Error('No healthy networks available');
    }
    
    console.log(`Using ${network} network`);
    
    // Execute swap on the selected network
    return this.executeSwap(network, swapParams);
  }
}

Status Page

For real-time status updates and historical uptime data, visit our status page: https://status.fibrous.finance

Best Practices

  1. Periodic Checks
    • Check health before critical operations
    • Implement periodic health checks (every 30-60 seconds)
    • Cache health status with appropriate TTL
  2. Timeout Handling
    • Set reasonable timeout for health checks (2-5 seconds)
    • Treat timeouts as unhealthy status
    • Implement exponential backoff for retries
  3. Graceful Degradation
    • Have fallback networks configured
    • Show user-friendly messages during downtime
    • Queue operations when possible
  4. Monitoring Integration
    // Example: Datadog monitoring
    async function monitorHealth() {
      const health = await checkHealth('base');
      
      statsd.gauge('fibrous.api.latency.rpc', health.latency.rpc);
      statsd.gauge('fibrous.api.latency.database', health.latency.database);
      
      if (health.status !== 'healthy') {
        statsd.increment('fibrous.api.unhealthy');
        // Alert your team
      }
    }