fastily / is-it-up

📡 A simple API for checking if a website/domain is reachable

Home Page:https://is-it-up.toolforge.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is-it-up

Python 3.11+ License: GPL v3

A simple API for checking if a website/domain is online. Useful for troubleshooting network issues (e.g. is it just me or is it down for everyone?).

Usage

GET /check

Takes a single URL parameter, website and queries it to see if it is up. Retuns the http status code, the time at which this domain was last queried as an iso 8601 timestamp, and a boolean indiciating if this result was cached (i.e. whether someone else already made this request in the past 5m).

  • Responses are cached for 5m
  • Only the domain will be queried. If you pass a URL wtih a path, it will be truncated.
  • Input is restricted to alpha-numeric characters, periods, and hyphens.

Example request:

/check?website=www.google.com

Example response:

{
    "status": 200,
    "last_checked": "2023-12-04T10:21:36+00:00",
    "cached": false
}

Configuration

is-it-up can be configured via environment variables:

  • show_docs - indicates if the /docs endpoint should be exposed via http redirect from /. Disabling this causes a generic error to be shown when visiting /. Defaults to true

Development commands

# start
python -m is_it_up

Production commands

# run w/ gunicorn
gunicorn -w 2 -k uvicorn.workers.UvicornWorker -b "0.0.0.0:8000" is_it_up.__main__:app

About

📡 A simple API for checking if a website/domain is reachable

https://is-it-up.toolforge.org

License:GNU General Public License v3.0


Languages

Language:Python 97.0%Language:Shell 1.8%Language:Procfile 1.1%