title: Health Check description: Check the health status of the API service

Health Check

Check the health status of the API service.

Endpoint

GET /health

Description

Check the health status of the API service. This endpoint returns the current status, service name, and version information.

Headers

No authentication required.

Example Request

curl https://api.translateplus.io/health
import requests

url = "https://api.translateplus.io/health"
response = requests.get(url)
print(response.json())
fetch('https://api.translateplus.io/health')
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
const https = require('https');

const options = {
  hostname: new URL('https://api.translateplus.io').hostname,
  path: '/health',
  method: 'GET'
};

const req = https.request(options, (res) => {
  let responseData = '';
  res.on('data', (chunk) => {
    responseData += chunk;
  });
  res.on('end', () => {
    console.log(JSON.parse(responseData));
  });
});

req.on('error', (error) => {
  console.error('Error:', error);
});

req.end();
<?php

$url = 'https://api.translateplus.io/health';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    $result = json_decode($response, true);
    echo 'Status: ' . $result['status'] . "\n";
    echo 'Service: ' . $result['service'] . "\n";
    echo 'Version: ' . $result['version'] . "\n";
} else {
    echo 'Error: ' . $response;
}

Success Response (200 OK)

When the service is healthy:

{
  "status": "ok",
  "service": "translateplus-api",
  "version": "2.0.0"
}

Response Fields

| Field | Type | Description | |-------|------|-------------| | status | string | Service status: "ok" when healthy, "error" when there are issues | | service | string | Service identifier: "translateplus-api" | | version | string | API version number: "2.0.0" |

Error Response (503 Service Unavailable)

When the service encounters issues:

{
  "status": "error",
  "service": "translateplus-api",
  "version": "2.0.0"
}

Status Codes

| Status Code | Description | |-------------|-------------| | 200 | Service is healthy. Response contains status: "ok" | | 503 | Service has issues. Response contains status: "error" |

Use Cases