API Reference

Health

GET/health

Check the API health status. No authentication required.

Overview

The Health endpoint provides a simple way to check if the Lemma API is operational. This endpoint does not require authentication and can be used for monitoring and uptime checks.

Use this endpoint to verify API availability before making authenticated requests or to set up automated health monitoring.

Parameters

This endpoint takes no parameters.

Response Structure

The health endpoint returns a simple response with a msg field indicating the API status. Note: This endpoint does not follow the standard response wrapper format used by other endpoints.

msgstring

Status message. For health endpoint, this will be "running fine" when the API is operational.

Error Responses

Error responses follow the same structure with status: 0 and include an errorCode field:

Example Error Response
{
  "status": 0,
  "errorCode": "",
  "msg": "internal server error"
}

Use Cases

Uptime Monitoring

Set up automated checks to monitor API availability. Alert your team if status changes from "healthy" to "degraded".

Pre-flight Checks

Verify API is operational before making authenticated requests. Useful for batch jobs or scheduled tasks.

Status Pages

Display real-time API status on your own status dashboard or monitoring interface.

Example: Automated Health Check

Python - Monitoring Script
import requests
import time

def check_health():
    try:
        response = requests.get(
            "https://api.lemma.la/health",
            timeout=5
        )
        
        if response.status_code == 200:
            data = response.json()
            if data.get('msg') == 'running fine':
                print("✓ API is healthy")
                return True
            else:
                print(f"⚠️ API status: {data}")
                return False
        else:
            print(f"✗ API returned {response.status_code}")
            return False
            
    except requests.exceptions.Timeout:
        print("✗ Health check timed out")
        return False
    except Exception as e:
        print(f"✗ Health check failed: {e}")
        return False

# Run health check every 60 seconds
while True:
    check_health()
    time.sleep(60)
curl
curl -X GET https://api.lemma.la/health

Response

200 OK
{
  "msg": "running fine"
}