Endpoints
| Method | Endpoint | Description |
|---|
GET | /v1/health | Check service health status |
No Authentication RequiredThe health check endpoint is publicly accessible and does not require authentication. This allows monitoring systems to verify service availability without credentials.
When to Use
| Use Case | Description |
|---|
| Service Monitoring | Check if the API is online and responding |
| Pre-flight Checks | Verify connectivity before starting trading operations |
| Load Balancer Health Checks | Configure external load balancers to monitor API availability |
| Uptime Monitoring | Set up automated alerts for service outages |
The health check returns a simple JSON response indicating the service status:
{
"status": "SERVING",
"version": "1.0.0"
}
| Field | Description |
|---|
status | Service status (SERVING = operational) |
version | Current API version |
Example Usage
Check Service Health
curl https://api.preprod.polymarketexchange.com/v1/health
Production Health Check
curl https://api.prod.polymarketexchange.com/v1/health
Quick LinksTest the health endpoint for each environment:
Integration Examples
Monitoring Script
import requests
import time
def check_health(base_url):
try:
response = requests.get(f"{base_url}/v1/health", timeout=5)
if response.status_code == 200:
data = response.json()
print(f"✓ Service is {data['status']}")
return True
else:
print(f"✗ Unexpected status code: {response.status_code}")
return False
except Exception as e:
print(f"✗ Health check failed: {e}")
return False
# Check preprod environment
check_health("https://api.preprod.polymarketexchange.com")
Kubernetes Liveness Probe
livenessProbe:
httpGet:
path: /v1/health
port: 443
scheme: HTTPS
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
Docker Health Check
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
CMD curl -f https://api.preprod.polymarketexchange.com/v1/health || exit 1