Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fastily/is-it-up
📡 A simple API for checking if a website/domain is reachable
https://github.com/fastily/is-it-up
fastapi python3 uptime-monitor
Last synced: about 1 month ago
JSON representation
📡 A simple API for checking if a website/domain is reachable
- Host: GitHub
- URL: https://github.com/fastily/is-it-up
- Owner: fastily
- License: gpl-3.0
- Created: 2022-12-25T09:05:03.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-09T09:03:04.000Z (5 months ago)
- Last Synced: 2024-08-09T10:31:00.945Z (5 months ago)
- Topics: fastapi, python3, uptime-monitor
- Language: Python
- Homepage: https://is-it-up.toolforge.org
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# is-it-up
[![Python 3.11+](https://upload.wikimedia.org/wikipedia/commons/6/62/Blue_Python_3.11%2B_Shield_Badge.svg)](https://www.python.org)
[![License: GPL v3](https://upload.wikimedia.org/wikipedia/commons/8/86/GPL_v3_Blue_Badge.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)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:
```json
{
"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
```bash
# start
python -m is_it_up
```## Production commands
```bash
# run w/ gunicorn
gunicorn -w 2 -k uvicorn.workers.UvicornWorker -b "0.0.0.0:8000" is_it_up.__main__:app
```