Skip to main content

Endpoints

MethodEndpointDescription
GET/v1/healthCheck 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 CaseDescription
Service MonitoringCheck if the API is online and responding
Pre-flight ChecksVerify connectivity before starting trading operations
Load Balancer Health ChecksConfigure external load balancers to monitor API availability
Uptime MonitoringSet up automated alerts for service outages

Response Format

The health check returns a simple JSON response indicating the service status:
{
  "status": "SERVING",
  "version": "1.0.0"
}
FieldDescription
statusService status (SERVING = operational)
versionCurrent 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