uptime.is

Table of Content

General

uptime.is is an homepage which helps you in calculating your SLA percent/time.

To access it, you can either use your browser and navigave to the following url: https://uptime.is.

Or if you wana do it from your termianl you can use curl to talk to there api.

API

The API is for personal usage

The API supports two main paramters: - sla: for calculation using the SLA uptime percentage - down: for calculation using the downtime duration

It is also possible to create more complex calculations, by using the parameter dur for each day of the week and assign it some uptime hours.

$ curl -s "https://get.uptime.is/api?sla=<percentage>"
$ curl -s "https://get.uptime.is/api?sla=<percentage>&dur=24&dur=24&dur=24&dur=24&dur=24&dur=24&dur=24"
$ curl -s "https://get.uptime.is/down?sla=<spenttime>"
$ curl -s "https://get.uptime.is/down?sla=<percentage>&dur=24&dur=24&dur=24&dur=24&dur=24&dur=24&dur=24"

With SLA Uptime Percentage

Lets have a look, how it works with the SLA uptime percentage curl command.

$ curl -s "https://get.uptime.is/api?sla=13.37"

Will result into this:

{
  "SLA": 13.37,
  "dailyDownSecs": 74848.32,
  "dailyDown": "20h 47m 28s",
  "weeklyDownSecs": 523938.24,
  "weeklyDown": "6d 1h 32m 18s",
  "monthlyDownSecs": 2259436.8797999998,
  "monthlyDown": "26d 3h 37m 17s",
  "quarterlyDownSecs": 6778310.6394,
  "quarterlyDown": "78d 10h 51m 51s",
  "yearlyDownSecs": 27113242.5576,
  "yearlyDown": "313d 19h 27m 23s",
  "uptimeURL": "https://uptime.is/13.37",
  "timestamp": 1727349068,
  "runtime": "0.000s"
}

So lest test it with specific durrations for days:

The duration variable starts to fill the weekdays beginning on monday.

If you do speicfy it less then 7 times, the missing ones will be assumed to have 24hrs

curl -s "https://get.uptime.is/api?sla=13.37&dur=24&dur=12&dur=6&dur=3&dur=1&dur=0&dur=0"

Will result into this:

{
  "mondayHours": 24,
  "tuesdayHours": 12,
  "wednesdayHours": 6,
  "thursdayHours": 3,
  "fridayHours": 1,
  "saturdayHours": 0,
  "sundayHours": 0,
  "SLA": 13.37,
  "weeklyDownSecs": 143459.28,
  "weeklyDown": "1d 15h 50m 59s",
  "monthlyDownSecs": 618655.3361357142,
  "monthlyDown": "7d 3h 50m 55s",
  "quarterlyDownSecs": 1855966.0084071427,
  "quarterlyDown": "21d 11h 32m 46s",
  "yearlyDownSecs": 7423864.033628571,
  "yearlyDown": "85d 22h 11m 4s",
  "uptimeURL": "https://uptime.is/complex?sla=13.37&wk=ymgdbaa",
  "timestamp": 1727359709,
  "runtime": "0.001s"
}

With Downtime Duration

In this section, we are looking at the curl command where it uses the downtiem duration for calculation the SLA uptime percentage.

$ curl -s "https://get.uptime.is/api?down=6h60m60s"

Will result into this:

{
  "downtimeSecs": 25260,
  "downtime": "7h 1m 0s",
  "dailySLA": 70.76388888888889,
  "weeklySLA": 95.8234126984127,
  "monthlySLA": 99.03149593619375,
  "quarterlySLA": 99.67716531206459,
  "yearlySLA": 99.91929132801614,
  "downtimeURL": "https://uptime.is/reverse?down=25260",
  "timestamp": 1727349408,
  "runtime": "0.000s"
}
$ curl -s "https://get.uptime.is/api?down=42d21h13m37s"

Will result into this:

{
  "downtimeSecs": 3705217,
  "downtime": "42d 21h 13m 37s",
  "dailySLA": 0,
  "weeklySLA": 0,
  "monthlySLA": 0,
  "quarterlySLA": 52.64558297988942,
  "yearlySLA": 88.16139574497235,
  "downtimeURL": "https://uptime.is/reverse?down=3705217",
  "timestamp": 1727349301,
  "runtime": "0.000s"
}

So lest test it with specific durrations for days:

The duration variable starts to fill the weekdays beginning on monday.

If you do speicfy it less then 7 times, the missing ones will be assumed to have 24hrs

curl -s "https://get.uptime.is/api?down=6h60m60s&dur=24&dur=12&dur=6&dur=3&dur=1&dur=0&dur=0"

Will result into this:

{
  "mondayHours": 24,
  "tuesdayHours": 12,
  "wednesdayHours": 6,
  "thursdayHours": 3,
  "fridayHours": 1,
  "saturdayHours": 0,
  "sundayHours": 0,
  "downtimeSecs": 25260,
  "downtime": "7h 1m 0s",
  "weeklySLA": 84.7463768115942,
  "monthlySLA": 96.46285472349024,
  "quarterlySLA": 98.82095157449675,
  "yearlySLA": 99.70523789362419,
  "downtimeURL": "https://uptime.is/reverse?down=25260&wk=ymgdbaa",
  "timestamp": 1727359876,
  "runtime": "0.000s"
}