skillfed

fastapi-health

Heath check on FastAPI applications.

fastapi-health v0.4.0 237.5K downloads/30d#8,956 on PyPI188
Permissive license MIT Abandoned released

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-health

uv

uv add fastapi-health

poetry

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 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

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Build ToolsTopic :: Software Development :: Libraries :: Python Modules

Tags

fastapi health check endpointmicroservices health check apifastapi health status monitoringhealth check pattern fastapiapi availability checkfastapi dependency health conditionsservice health probe
health-checkmicroservicesobservability

More Python Modules packages