About uptime.is

[ simple / flexible / compare / reverse / about ]

About uptime.is

digi.no has published a story about uptime.is.

uptime.is API 💯

For ad-hoc personal usage, uptime.is is providing an API. For heavy usage, or to create a site, app or some other tool intended to be used by users other than yourself or in an enterprise or commercial environment, please get in touch to discuss a suitable arrangement.

API endpoint and HTTP method

The uptime.is API is available at https://get.uptime.is/api using the GET method (POST is not supported).

Simple SLA calculator

In its most simple form, the calculator outputs downtime duration in hours, minutes and seconds given a specified uptime percentage.

The SLA uptime percentage is specified as a parameter named sla.

$ curl -s 'https://get.uptime.is/api?sla=99.9'
{
  "SLA": 99.9,
  "uptimeURL": "https://uptime.is/99.9",
  "nines": "three nines",
  "ninesURL": "https://uptime.is/three-nines",
  "dailyDownSecs": 86.39999999999418,
  "dailyDown": "1m 26s",
  "weeklyDownSecs": 604.7999999999302,
  "weeklyDown": "10m 4s",
  "monthlyDownSecs": 2608.1459999996987,
  "monthlyDown": "43m 28s",
  "quarterlyDownSecs": 7824.437999999096,
  "quarterlyDown": "2h 10m 24s",
  "yearlyDownSecs": 31297.751999996384,
  "yearlyDown": "8h 41m 37s"
}

The calculator outputs acceptable downtime durations given the provided SLA uptime percentage.

Complex SLA calculator

Simple SLA calculator described above assumes 24/7 uptime requirement (with certain approximations further documented in the source). In real world, the requirements are often more relaxed, e.g. 8 hours on working days. To accommodate for this scenario, the SLA calculator supports complex mode, where it is possible to specify uptime requirement for each day of week.

The SLA uptime percentage is specified as a parameter named sla. The durations are specified as parameters named dur and repeated for each day of week (i.e. 7 times and defaulting to 24, if not provided).

$ curl -s
'https://get.uptime.is/api?sla=99.9&dur=8&dur=8&dur=8&dur=8&dur=8&dur=0&dur=0'
{
  "mondayHours": 8,
  "tuesdayHours": 8,
  "wednesdayHours": 8,
  "thursdayHours": 8,
  "fridayHours": 8,
  "saturdayHours": 0,
  "sundayHours": 0,
  "SLA": 99.9,
  "uptimeURL": "https://uptime.is/complex?sla=99.9&wk=iiiiiaa",
  "nines": "three nines",
  "weeklyDownSecs": 143.9999999999709,
  "weeklyDown": "2m 23s",
  "monthlyDownSecs": 620.9871428570173,
  "monthlyDown": "10m 20s",
  "quarterlyDownSecs": 1862.9614285710518,
  "quarterlyDown": "31m 2s",
  "yearlyDownSecs": 7451.845714284207,
  "yearlyDown": "2h 4m 11s"
}

The calculator outputs acceptable downtime durations given the provided SLA uptime percentage.

Simple reverse SLA calculator

Reverse SLA calculator performs the opposite operation, and converts downtime duration into corresponding SLA uptime percentage. The downtime duration may be provided as a number of seconds (e.g. 42) or as a combination of hours, minutes and/or seconds of downtime using the h, m or s units (e.g. 13m 37s).

The downtime duration is specified as a parameter named down.

 $ curl -s 'https://get.uptime.is/api?down=1h20m'
{
  "downtimeSecs": 4800,
  "downtime": "1h 20m",
  "downtimeURL": "https://uptime.is/reverse?down=4800",
  "dailySLA": 94.44444444444444,
  "weeklySLA": 99.20634920634922,
  "monthlySLA": 99.81596122302969,
  "quarterlySLA": 99.9386537410099,
  "yearlySLA": 99.98466343525247
}

The calculator outputs SLA uptime percentage which would allow the specified downtime with defined uptime calculation durations.

Complex reverse SLA calculator

The reverse SLA calculator accepts the durations in the same way as the complex SLA calculator.

$ curl -s
'https://get.uptime.is/api?down=1h20m&dur=8&dur=8&dur=8&dur=8&dur=8&dur=0&dur=0'
{
  "mondayHours": 8,
  "tuesdayHours": 8,
  "wednesdayHours": 8,
  "thursdayHours": 8,
  "fridayHours": 8,
  "saturdayHours": 0,
  "sundayHours": 0,
  "downtimeSecs": 4800,
  "downtime": "1h 20m",
  "downtimeURL": "https://uptime.is/reverse?down=4800&wk=iiiiiaa",
  "weeklySLA": 96.66666666666667,
  "monthlySLA": 99.2270371367247,
  "quarterlySLA": 99.74234571224156,
  "yearlySLA": 99.93558642806039
}

The calculator outputs SLA uptime percentage which would allow the specified downtime with defined uptime calculation durations.