# Fetch monitoring data from the API

## GET /health/{serviceId}

> Get health decision for a service

```json
{"openapi":"3.0.3","info":{"title":"Chain.Love Global Health API","version":"1.0.0"},"servers":[{"url":"https://global.chain.love"}],"paths":{"/health/{serviceId}":{"get":{"operationId":"getServiceHealth","summary":"Get health decision for a service","parameters":[{"name":"serviceId","in":"path","required":true,"description":"Service identifier to query.","schema":{"type":"string"}}],"responses":{"200":{"description":"Health decision response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"HealthResponse":{"type":"object","required":["result"],"properties":{"result":{"$ref":"#/components/schemas/HealthResult"}}},"HealthResult":{"type":"object","required":["serviceId","decision","liveVerifiers","avgBlocksLatency","avgTimeLatency","timestamp"],"properties":{"serviceId":{"type":"string","description":"Echoed service identifier."},"decision":{"$ref":"#/components/schemas/Decision"},"liveVerifiers":{"type":"integer","format":"int32","minimum":0,"description":"Number of verifiers currently reporting."},"avgBlocksLatency":{"type":"integer","format":"int64","minimum":0,"description":"Average block lag (in blocks)."},"avgTimeLatency":{"type":"integer","format":"int64","minimum":0,"description":"Average time lag (in seconds)."},"timestamp":{"type":"integer","format":"int64","description":"Unix timestamp (seconds)."}}},"Decision":{"type":"string","description":"Health decision for the service.","enum":["UNKNOWN","UP","DOWN","LATENCY"]},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorDetail":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## The Decision object

```json
{"openapi":"3.0.3","info":{"title":"Chain.Love Global Health API","version":"1.0.0"},"components":{"schemas":{"Decision":{"type":"string","description":"Health decision for the service.","enum":["UNKNOWN","UP","DOWN","LATENCY"]}}}}
```

## The HealthResult object

```json
{"openapi":"3.0.3","info":{"title":"Chain.Love Global Health API","version":"1.0.0"},"components":{"schemas":{"HealthResult":{"type":"object","required":["serviceId","decision","liveVerifiers","avgBlocksLatency","avgTimeLatency","timestamp"],"properties":{"serviceId":{"type":"string","description":"Echoed service identifier."},"decision":{"$ref":"#/components/schemas/Decision"},"liveVerifiers":{"type":"integer","format":"int32","minimum":0,"description":"Number of verifiers currently reporting."},"avgBlocksLatency":{"type":"integer","format":"int64","minimum":0,"description":"Average block lag (in blocks)."},"avgTimeLatency":{"type":"integer","format":"int64","minimum":0,"description":"Average time lag (in seconds)."},"timestamp":{"type":"integer","format":"int64","description":"Unix timestamp (seconds)."}}},"Decision":{"type":"string","description":"Health decision for the service.","enum":["UNKNOWN","UP","DOWN","LATENCY"]}}}}
```

## The HealthResponse object

```json
{"openapi":"3.0.3","info":{"title":"Chain.Love Global Health API","version":"1.0.0"},"components":{"schemas":{"HealthResponse":{"type":"object","required":["result"],"properties":{"result":{"$ref":"#/components/schemas/HealthResult"}}},"HealthResult":{"type":"object","required":["serviceId","decision","liveVerifiers","avgBlocksLatency","avgTimeLatency","timestamp"],"properties":{"serviceId":{"type":"string","description":"Echoed service identifier."},"decision":{"$ref":"#/components/schemas/Decision"},"liveVerifiers":{"type":"integer","format":"int32","minimum":0,"description":"Number of verifiers currently reporting."},"avgBlocksLatency":{"type":"integer","format":"int64","minimum":0,"description":"Average block lag (in blocks)."},"avgTimeLatency":{"type":"integer","format":"int64","minimum":0,"description":"Average time lag (in seconds)."},"timestamp":{"type":"integer","format":"int64","description":"Unix timestamp (seconds)."}}},"Decision":{"type":"string","description":"Health decision for the service.","enum":["UNKNOWN","UP","DOWN","LATENCY"]}}}}
```
