--- id: fastapi-health version: "0.4.0" license: MIT license_treatment: permissive maintenance: abandoned --- # fastapi-health — Heath check on FastAPI applications. License: permissive · Maintenance: abandoned · Downloads: 237.5K/mo ## What it is and what it does fastapi-health is a lightweight library that implements the Health Check API pattern for FastAPI applications. It provides a single `health()` function that accepts a list of condition callables and generates a health check endpoint that evaluates each condition and returns an appropriate HTTP response (200 for success, 503 for failure by default). Each condition can return either a boolean or a dictionary; conditions can also use FastAPI's dependency injection system to access resources like database sessions. The package is designed to be minimal and straightforward: you define your health conditions as functions, pass them to `health()`, and attach the result to your FastAPI app as a route. It supports customization of response bodies and HTTP status codes for both success and failure scenarios. The package depends only on fastapi and has no other external runtime dependencies. Use it for: - Kubernetes liveness and readiness probes that check whether your FastAPI service and its dependencies are operational - Load balancer health checks that verify database connectivity and other critical service dependencies before routing traffic - Monitoring dashboards that poll a standardized health endpoint to track service availability across a microservices cluster - Graceful shutdown detection by returning failure status when the service is shutting down or entering maintenance mode ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Adds a health check endpoint to FastAPI applications by evaluating a list of condition callables and returning appropriate success or failure responses. Yes, if you need a simple health check endpoint and can accept that the package is no longer maintained. The library is small, has no known vulnerabilities, and works with Python versions 3.6 through 3.9. However, verify compatibility with your specific FastAPI version before deploying to production, and be prepared to fork or replace it if FastAPI introduces breaking changes. ## Install pip install fastapi-health uv add fastapi-health poetry add fastapi-health ## Installing fastapi-health Before you install: Low install friction with a single runtime dependency on fastapi. However, the package is abandoned—last release was 2021-08-20 and last commit 2023-07-30—so it will not receive bug fixes or updates. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions, making it safe to integrate into most projects without licensing concerns. Quickstart: pip install fastapi-health from fastapi import FastAPI, Depends from fastapi_health import health def is_database_online(session: bool = Depends(lambda: True)): return session app = FastAPI() app.add_api_route("/health", health([is_database_online])) Requires fastapi as a runtime dependency; Python 3.6.1 or later. Verify before relying: - Whether the package remains compatible with FastAPI versions released after 2023-07-30 - Whether condition callables support async functions or only synchronous callables - How the package handles timeouts or long-running health check conditions ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 237.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags fastapi health check endpoint, microservices health check api, fastapi health status monitoring, health check pattern fastapi, api availability check, fastapi dependency health conditions, service health probe, health-check, microservices, observability [View on SkillFed](https://skillfed.io/packages/fastapi-health) · [View on PyPI](https://pypi.org/project/fastapi-health/)