Health Check
curl --request GET \
--url https://api.example.com/{network}/healthcheckimport requests
url = "https://api.example.com/{network}/healthcheck"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/{network}/healthcheck', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/{network}/healthcheck",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{network}/healthcheck"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/{network}/healthcheck")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{network}/healthcheck")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"staus": 123,
"message": "<string>"
}Core Endpoints
Health Check
Check the API status and network availability
GET
/
{network}
/
healthcheck
Health Check
curl --request GET \
--url https://api.example.com/{network}/healthcheckimport requests
url = "https://api.example.com/{network}/healthcheck"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/{network}/healthcheck', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/{network}/healthcheck",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/{network}/healthcheck"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/{network}/healthcheck")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/{network}/healthcheck")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"staus": 123,
"message": "<string>"
}Overview
V2 Available: An enhanced version is available at
/{network}/v2/healthcheck with metadata and API version tracking. See Health Check V2 and the V2 Migration Guide.Supported Networks
- Base
- HyperEVM
- Citrea
- Monad
- Starknet
https://api.fibrous.finance/base/healthcheck
https://api.fibrous.finance/hyperevm/healthcheck
https://api.fibrous.finance/citrea/healthcheck
https://api.fibrous.finance/monad/healthcheck
https://api.fibrous.finance/starknet/healthcheck
Response
number
HTTP status code (200 = healthy)
string
Health status message indicating the API is operational
Example Request
curl "https://api.fibrous.finance/base/healthcheck"
const checkHealth = async (network = 'base') => {
const response = await fetch(
`https://api.fibrous.finance/${network}/healthcheck`
);
const data = await response.json();
if (data.staus === 200) {
console.log(`${network} API is healthy`);
console.log(data.message);
}
return data;
};
// Check health
await checkHealth('base');
import requests
def check_health(network='base'):
url = f"https://api.fibrous.finance/{network}/healthcheck"
response = requests.get(url)
data = response.json()
if data['staus'] == 200:
print(f"{network} API is healthy")
print(data['message'])
return data
# Check health
check_health('base')
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', 'citrea', '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.financeBest Practices
-
Periodic Checks
- Check health before critical operations
- Implement periodic health checks (every 30-60 seconds)
- Cache health status with appropriate TTL
-
Timeout Handling
- Set reasonable timeout for health checks (2-5 seconds)
- Treat timeouts as unhealthy status
- Implement exponential backoff for retries
-
Graceful Degradation
- Have fallback networks configured
- Show user-friendly messages during downtime
- Queue operations when possible
-
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 } }
Related Resources
- API Status Page
- Rate Limits
- Support
- Health Check V2 - Enhanced health check with metadata
- V2 Migration Guide - Migrate to V2 API