UptimeTea

API Documentation

The UptimeTea API is easy to use and free for all plans.

Get watcher

Returns a single watcher with its check history: the 100 most recent checks in the range, response time averaged into at most 100 points, check counts per HTTP status code, uptime per period and per day for the last 30 days. Cron job and heartbeat watchers list their last 20 callbacks in recent_callbacks instead of checks.

GET https://api.uptimetea.com/watchers/:id

Query parameters

  • rangeSTRING

    Time range for checks: 24h, 7d, 30d or 90d.

  • start_dateSTRING

    Custom start date (ISO 8601), used with end_date instead of range.

  • end_dateSTRING

    Custom end date (ISO 8601), used with start_date instead of range.

Headers

  • AuthorizationREQUIREDSTRING
    Bearer $TOKEN

Response body

{
  "id": "uuid",
  "title": "My Website",
  "category": "website",
  "url": "https://example.com",
  "status": "success",
  "tags": ["production"],
  "last_checked_at": "2024-01-15T10:30:00Z",
  "uptime_percentage": 99.5,
  "consecutive_failures": 0,
  "check_interval": 300,
  "notify_email": true,
  "notify_sms": false,
  "notify_call": false,
  "on_call_schedule_id": null,
  "escalation_policy_id": null,
  "in_maintenance": false,
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "expected_content": "Welcome",
  "content_case_sensitive": false,
  "content_regex": false,
  "sla_target": 99.9,
  "sla_breached": false,
  "uptime": {
    "24h": 100,
    "7d": 99.9,
    "30d": 99.95,
    "90d": 99.93
  },
  "checks": [
    {
      "id": "uuid",
      "status_code": 200,
      "response_time": 234,
      "status": "success",
      "checked_at": "2024-01-15T10:30:00Z",
      "error_message": null
    }
  ],
  "total_checks": 10080,
  "average_response_time": 234.56,
  "response_time_series": [
    {
      "checked_at": "2024-01-08T10:30:00Z",
      "response_time": 228
    }
  ],
  "status_code_counts": [
    {
      "status_code": 200,
      "count": 10072
    },
    {
      "status_code": null,
      "count": 8
    }
  ],
  "daily_uptime": [
    {
      "date": "2024-01-15",
      "uptime": 100
    }
  ]
}

Code examples

curl -X GET "https://api.uptimetea.com/watchers/$WATCHER_ID?range=7d" \
  -H "Authorization: Bearer $TOKEN"
// Get watcher
const response = await fetch('https://api.uptimetea.com/watchers/WATCHER_ID?range=7d', {
  headers: {
    'Authorization': 'Bearer ' + yourToken
  }
});

const data = await response.json();
console.log(data);
# Get watcher
import requests

headers = {'Authorization': f'Bearer {your_token}'}

response = requests.get(
    'https://api.uptimetea.com/watchers/WATCHER_ID?range=7d',
    headers=headers
)

print(response.json())
// Get watcher
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://api.uptimetea.com/watchers/WATCHER_ID?range=7d", nil)
    req.Header.Set("Authorization", "Bearer "+yourToken)

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    data, _ := io.ReadAll(resp.Body)
    fmt.Println(resp.Status, string(data))
}
# Get watcher
require 'net/http'
require 'uri'

uri = URI('https://api.uptimetea.com/watchers/WATCHER_ID?range=7d')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Get.new(uri)
request['Authorization'] = "Bearer #{your_token}"

response = http.request(request)
puts response.code, response.body
<?php
// Get watcher
$ch = curl_init('https://api.uptimetea.com/watchers/WATCHER_ID?range=7d');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $yourToken
]);

$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);