fastapi-health
Heath check on FastAPI applications.
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 on this page — 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
fastapi-health on PyPI
pip
pip install fastapi-healthuv
uv add fastapi-healthpoetry
poetry add fastapi-healthInstalling 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 the current Python release (>=3.6.1,<4.0.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — fastapi |
| Maintenance | abandoned — 1,820 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 237,494/month — #8,956 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fastapi_health-0.4.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
fastapi-healthchecksAdds configurable health check endpoints to…
permissive · top 15,000 on PyPI
dockerflowProvides helpers and tools for implementing…
copyleft · top 15,000 on PyPI
grpcio-health-checkingProvides a standard health-checking service…
permissive · top 1,000 on PyPI
django-watchmandjango-watchman exposes a status endpoint that…
permissive · top 15,000 on PyPI
fastapi-usersProvides ready-to-use user registration, login,…
permissive · top 5,000 on PyPI
fastapi-injectableEnables FastAPI's Depends() dependency…
permissive · top 15,000 on PyPI
fastapi-decoratorsConverts functions into FastAPI-compatible…
permissive · top 15,000 on PyPI
fastapi-corsConfigures CORS settings for FastAPI…
permissive · top 15,000 on PyPI
fastapi-profilerIntegrates pyinstrument profiling into FastAPI…
permissive · top 15,000 on PyPI
http-exceptionsProvides a set of raisable exception classes…
permissive · top 15,000 on PyPI