TravelyzerTravelyzerDocs

Health Check

Check the health status of the Travelyzer Places API service.

GET /health

Checks the health status of the service. Use this endpoint to monitor API availability in your surveillance systems.

Endpoint

GET https://places.gotravelyzer.com/health

Authentication

This endpoint does not require authentication and is not counted against your quotas.


Parameters

No parameters required.


Request

curl "https://places.gotravelyzer.com/health"

Response

Success (200 OK)

{
  "ok": true
}

Response Fields

FieldTypeDescription
okbooleantrue if the service is operational

HTTP Codes

CodeStatusDescription
200OKThe service is operational
503Service UnavailableThe service is unavailable or under maintenance

503 Response Example

{
  "ok": false,
  "message": "Service temporarily unavailable"
}

Use Cases

Continuous Monitoring

Check the API status at regular intervals:

#!/bin/bash
 
# Check status every 30 seconds
while true; do
  RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "https://places.gotravelyzer.com/health")
 
  if [ "$RESPONSE" = "200" ]; then
    echo "$(date): API UP"
  else
    echo "$(date): API DOWN (HTTP $RESPONSE)"
    # Trigger an alert here
  fi
 
  sleep 30
done

Pre-use Verification

Check that the API is available before making critical requests:

#!/bin/bash
 
# Check status before launching a batch
HEALTH=$(curl -s "https://places.gotravelyzer.com/health" | jq -r '.ok')
 
if [ "$HEALTH" = "true" ]; then
  echo "API available, starting processing..."
  # Launch batch
else
  echo "API unavailable, processing postponed"
  exit 1
fi

Simple Alert Script

#!/bin/bash
 
API_URL="https://places.gotravelyzer.com/health"
ALERT_EMAIL="ops@example.com"
 
check_health() {
  HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$API_URL" --connect-timeout 5)
 
  if [ "$HTTP_CODE" != "200" ]; then
    echo "ALERT: Travelyzer API unavailable (HTTP $HTTP_CODE)" | \
      mail -s "API Down Alert" "$ALERT_EMAIL"
    return 1
  fi
  return 0
}
 
# Execute
check_health

Best Practices

Check Frequency

EnvironmentRecommended Frequency
ProductionEvery 30 seconds
StagingEvery 1-5 minutes
DevelopmentOn demand

Configure a timeout of 5-10 seconds to avoid false positives:

curl --connect-timeout 5 --max-time 10 "https://places.gotravelyzer.com/health"

Don't Overload

Avoid checking too frequently (e.g., every second). A check every 30 seconds is generally sufficient.


Technical Notes

  • Typical response time: < 50ms
  • This endpoint is not counted against your quotas
  • Use it for your health checks, load balancers, and monitoring systems

Next Steps