# Speedtest Tracker in your Mac’s menu bar

See what your internet connection measured, without opening Speedtest Tracker: the newest test, a week of download and upload against the thresholds you set, and the last few tests. You can start a test from the panel, too.

## What you’ll see

- **Health:** in Details, the newest finished test: when it ran, with its download and upload. It turns the health card red when that test failed, with Speedtest Tracker’s reason, and orange when it was under one of the thresholds you set in Speedtest Tracker. It also turns orange when no test has finished for more than a day. Red or orange sends a notification. It turns red once Speedtest Tracker stops answering.
- **Download and Upload:** the last 7 days of completed tests, in Mbps, with the newest on top. When you’ve set thresholds in Speedtest Tracker, each chart draws its threshold as a dashed line. Point at the line for a test’s time and speed.
- **Last test:** the newest completed test’s ping and jitter, the server it tested against, your provider and its packet loss, and the averages for the last 7 days. When the newest test failed, the card says so and how long ago the last completed one ran. Its corner has **Run a test now**, which stays there before your first completed test.
- **Recent tests:** the four newest finished tests, newest first. A failed one says Failed with Speedtest Tracker’s reason. One under your thresholds says so. Click a test to open its result on Speedtest.net.

### Status

- Shows the newest finished test.
- Red when it failed.
- Orange when it was under one of your thresholds, or when no test has finished for over a day.
- Red once Speedtest Tracker stops answering.
- Notifies you when it turns orange or red.

## How it connects

The page reads Speedtest Tracker’s v1 API with an API token, sent as `Authorization: Bearer`.

| Request | When | What it supplies |
| --- | --- | --- |
| `GET /api/v1/results?sort=-created_at&page[size]=4&filter[status]=completed,failed` | Every 10 minutes | The four newest finished tests, for the health line and Recent tests. Tests still waiting or running are left out. |
| `GET /api/v1/results?sort=-created_at&page[size]=1&filter[status]=completed` | Every 10 minutes | The newest completed test, for Last test. |
| `GET /api/v1/stats?filter[start_at]={date.days_ago_6}` | Every 10 minutes | Average download, upload and ping over the last 7 days. |
| `GET /api/v1/results?sort=-created_at&page[size]=200&filter[status]=completed&filter[start_at]={date.days_ago_6}` | Every 10 minutes | The week’s completed tests, for the charts. |
| `POST /api/v1/speedtests/run` | When you press Run a test now | Adds a test to Speedtest Tracker’s queue. Legato then checks `GET /api/v1/results/{id}` every 5 seconds until it finishes. |

That’s 24 requests an hour while your Mac is awake, and the four go together, so after Run a test now the charts show the new test too. Each test Speedtest Tracker keeps includes the full speed test output, about 3.5 KB, so the week’s request is the large one: about 600 KB for a test every hour. The charts draw at most 200 tests, about 700 KB. If you test more often than every 50 minutes or so, they show the newest 200 and say so in their title. Legato doesn't read an answer over 1 MB. If the week's ever grows past that, every card keeps its last answer with a note, and after three tries the page turns red as if Speedtest Tracker had stopped answering. Speedtest Tracker’s [API documentation](https://docs.speedtest-tracker.dev/api/authorization) covers the token and its abilities.

Speedtest Tracker stores each test’s time without a time zone, in its `APP_TIMEZONE`, which its docs say to leave at UTC. Completed tests also carry the speed test’s own time, which the page reads. A failed test only has the stored time, so the page reads it as UTC. With a different `APP_TIMEZONE`, a failed test’s time is off by that zone’s difference from UTC.

[Sources and buttons](https://legatobar.com/docs/sources.md) explains each part of a page.

## Set it up

1. **Make a token.** In Speedtest Tracker, open **API Tokens** and create one with **Read results**. Add **Run speedtest** if you want the Run a test now button. A token without it gets a refusal when you press the button, and the rest of the page works.
2. **Save it in Legato.** In Settings → Secrets, save the token under `speedtest-tracker`, bound to your Speedtest Tracker’s address. You can also link a [1Password reference](https://legatobar.com/docs/1password.md).
3. **Add the page.** Paste the prompt into your agent, or download the page and run `/Applications/Legato.app/Contents/Helpers/legato set speedtest-tracker speedtest-tracker.json`.
4. **Point it at Speedtest Tracker.** Change `http://speedtest.local:8080` to your Speedtest Tracker’s address on both sources, with its port. If you reach it over https with a self-signed certificate, use its IP address or a `.local` name, which Legato can trust.

The cards fill within a minute. A mistyped token is the usual reason they don’t: the page then notes that Speedtest Tracker refused it.

### Prompt for your agent

```prompt
Add a Legato page for Speedtest Tracker, starting from https://legatobar.com/examples/speedtest-tracker.json.

Add the page as it is and change http://speedtest.local:8080 on both sources to my Speedtest Tracker’s address. I’ll save my API token as speedtest-tracker in Settings → Secrets myself.

Use the local Legato MCP tools or /Applications/Legato.app/Contents/Helpers/legato.
Use list_pages first and choose an unused page ID. Do not overwrite an existing page. If I explicitly ask to update one, read its full body with get_page, preserve unrelated cards and settings, and use if_match with that version. On version_mismatch, read again before merging.
Ask me only for non-secret setup details that are missing. Never ask me to paste a password, token or API key into chat, page JSON or command arguments. Tell me to save it in Settings → Secrets for the service host, or link it from 1Password there.
Use the downloadable page, not the illustration’s sample data. Never invent readings. Fix any invalid_page paths and verify that the page loads. Do not press buttons that change the service or real devices to test it.
```

### Download the page

```json
{
  "$schema": "./.schemas/page.schema.json",
  "title": "Speedtest Tracker",
  "icon": "speedometer",
  "sources": {
    "now": {
      "url": "http://speedtest.local:8080",
      "secret": "speedtest-tracker",
      "auth": {
        "type": "bearer"
      },
      "every": "10m",
      "requests": {
        "last": "/api/v1/results?sort=-created_at&page%5Bsize%5D=4&filter%5Bstatus%5D=completed,failed",
        "good": "/api/v1/results?sort=-created_at&page%5Bsize%5D=1&filter%5Bstatus%5D=completed",
        "stats": "/api/v1/stats?filter%5Bstart_at%5D={date.days_ago_6}",
        "week": "/api/v1/results?sort=-created_at&page%5Bsize%5D=200&filter%5Bstatus%5D=completed&filter%5Bstart_at%5D={date.days_ago_6}"
      },
      "derive": [
        {
          "name": "any",
          "value": {
            "count": "last.data"
          }
        },
        {
          "name": "tests",
          "value": {
            "each": "last.data",
            "fields": {
              "id": "id",
              "data": "data",
              "created_at": "created_at",
              "status": "status",
              "healthy": "healthy",
              "download_bits": "download_bits",
              "upload_bits": "upload_bits",
              "ping": "ping",
              "utc_day": {
                "path": "created_at",
                "match": "^([0-9-]+) "
              },
              "utc_time": {
                "path": "created_at",
                "match": " ([0-9:]+)$"
              }
            }
          }
        },
        {
          "name": "last_at",
          "value": {
            "path": "tests[0].data.timestamp",
            "default": {
              "template": "{tests[0].utc_day}T{tests[0].utc_time}Z"
            }
          }
        },
        {
          "name": "last_age",
          "value": {
            "since": "last_at"
          }
        },
        {
          "name": "last_down",
          "value": {
            "path": "last.data[0].download_bits",
            "scale": 1e-06,
            "round": 0
          }
        },
        {
          "name": "last_up",
          "value": {
            "path": "last.data[0].upload_bits",
            "scale": 1e-06,
            "round": 0
          }
        },
        {
          "name": "good_day",
          "value": {
            "path": "good.data[0].created_at",
            "match": "^([0-9-]+) "
          }
        },
        {
          "name": "good_time",
          "value": {
            "path": "good.data[0].created_at",
            "match": " ([0-9:]+)$"
          }
        },
        {
          "name": "good_at",
          "value": {
            "path": "good.data[0].data.timestamp",
            "default": {
              "template": "{good_day}T{good_time}Z"
            }
          }
        },
        {
          "name": "avg_down",
          "value": {
            "path": "stats.data.download.avg_bits",
            "scale": 1e-06,
            "round": 0
          }
        },
        {
          "name": "avg_up",
          "value": {
            "path": "stats.data.upload.avg_bits",
            "scale": 1e-06,
            "round": 0
          }
        },
        {
          "name": "rows",
          "value": {
            "each": "tests",
            "fields": {
              "key": {
                "template": "{id|raw}"
              },
              "at": {
                "path": "data.timestamp",
                "default": {
                  "template": "{utc_day}T{utc_time}Z"
                }
              },
              "failed": {
                "path": "status",
                "values": {
                  "failed": 1
                },
                "default": 0
              },
              "slow": {
                "path": "healthy",
                "values": {
                  "false": 1
                },
                "default": 0
              },
              "down": {
                "path": "download_bits",
                "scale": 1e-06,
                "round": 0
              },
              "up": {
                "path": "upload_bits",
                "scale": 1e-06,
                "round": 0
              },
              "ping": {
                "path": "ping",
                "round": 0
              },
              "message": {
                "path": "data.message",
                "default": "Speedtest Tracker gave no reason"
              },
              "url": "data.result.url"
            }
          }
        },
        {
          "name": "week_count",
          "value": {
            "count": "week.data"
          }
        }
      ]
    }
  },
  "cards": [
    {
      "id": "health",
      "type": "status",
      "placement": "page_info",
      "label": "Speedtest Tracker",
      "state": "unknown",
      "width": "full",
      "source": {
        "ref": "now",
        "failed": {
          "state": "critical",
          "detail": "Speedtest Tracker isn't answering",
          "after": 3
        },
        "map": {
          "state": {
            "if": {
              "path": "any",
              "equals": 0
            },
            "then": {
              "template": "unknown"
            },
            "else": {
              "if": {
                "path": "last.data[0].status",
                "equals": "failed"
              },
              "then": {
                "template": "critical"
              },
              "else": {
                "if": {
                  "path": "last.data[0].healthy",
                  "equals": false
                },
                "then": {
                  "template": "warning"
                },
                "else": {
                  "if": {
                    "path": "last_age",
                    "gt": 93600
                  },
                  "then": {
                    "template": "warning"
                  },
                  "else": {
                    "template": "ok"
                  }
                }
              }
            }
          },
          "detail": {
            "if": {
              "path": "any",
              "equals": 0
            },
            "then": {
              "template": "No finished tests yet"
            },
            "else": {
              "if": {
                "path": "last.data[0].status",
                "equals": "failed"
              },
              "then": {
                "template": "Last test failed {last_at|ago}: {last.data[0].data.message|clip:70}"
              },
              "else": {
                "if": {
                  "path": "last.data[0].healthy",
                  "equals": false
                },
                "then": {
                  "template": "Below your thresholds {last_at|ago} · {last_down} ↓ · {last_up} ↑ Mbps"
                },
                "else": {
                  "if": {
                    "path": "last_age",
                    "gt": 93600
                  },
                  "then": {
                    "template": "Last test {last_at|ago}"
                  },
                  "else": {
                    "template": "Last test {last_at|ago} · {last_down} ↓ · {last_up} ↑ Mbps"
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "id": "download",
      "type": "sparkline",
      "width": "half",
      "label": "Download",
      "unit": "Mbps",
      "points": [
        0,
        0
      ],
      "change": false,
      "source": {
        "ref": "now",
        "when": {
          "path": "week_count",
          "gte": 2
        },
        "map": {
          "label": {
            "if": {
              "path": "week.meta.total",
              "gt": 200
            },
            "then": {
              "template": "Download · newest 200"
            },
            "else": {
              "template": "Download"
            }
          },
          "points": {
            "each": "week.data",
            "sort": "id",
            "value": {
              "path": "download_bits",
              "scale": 1e-06,
              "round": 0
            }
          },
          "times": {
            "each": "week.data",
            "sort": "id",
            "value": "data.timestamp"
          },
          "labels": {
            "each": "week.data",
            "sort": "id",
            "template": "{data.timestamp|weekday} {data.timestamp|clock}"
          },
          "axis_labels": {
            "each": "week.data",
            "sort": "id",
            "template": "{data.timestamp|weekday}"
          },
          "target": "week.data[0].benchmarks.download.benchmark_value"
        }
      },
      "target_label": "Threshold"
    },
    {
      "id": "upload",
      "type": "sparkline",
      "width": "half",
      "label": "Upload",
      "unit": "Mbps",
      "points": [
        0,
        0
      ],
      "change": false,
      "source": {
        "ref": "now",
        "when": {
          "path": "week_count",
          "gte": 2
        },
        "map": {
          "label": {
            "if": {
              "path": "week.meta.total",
              "gt": 200
            },
            "then": {
              "template": "Upload · newest 200"
            },
            "else": {
              "template": "Upload"
            }
          },
          "points": {
            "each": "week.data",
            "sort": "id",
            "value": {
              "path": "upload_bits",
              "scale": 1e-06,
              "round": 0
            }
          },
          "times": {
            "each": "week.data",
            "sort": "id",
            "value": "data.timestamp"
          },
          "labels": {
            "each": "week.data",
            "sort": "id",
            "template": "{data.timestamp|weekday} {data.timestamp|clock}"
          },
          "axis_labels": {
            "each": "week.data",
            "sort": "id",
            "template": "{data.timestamp|weekday}"
          },
          "target": "week.data[0].benchmarks.upload.benchmark_value"
        }
      },
      "target_label": "Threshold"
    },
    {
      "id": "facts",
      "type": "facts",
      "label": "Last test",
      "items": [
        {
          "key": "Ping",
          "value": "—"
        },
        {
          "key": "Average, 7 days",
          "value": "—"
        },
        {
          "key": "Server",
          "value": "—"
        },
        {
          "key": "Provider",
          "value": "—"
        },
        {
          "key": "Packet loss",
          "value": "—"
        }
      ],
      "actions": [
        {
          "label": "Run a test now",
          "icon": "play.fill",
          "method": "POST",
          "path": "/api/v1/speedtests/run",
          "completion": {
            "path": "/api/v1/results/{data.id|raw}",
            "done": {
              "path": "data.status",
              "in": [
                "completed",
                "failed",
                "skipped"
              ]
            },
            "success": {
              "path": "data.status",
              "equals": "completed"
            },
            "interval": 5,
            "timeout": 300
          }
        }
      ],
      "actions_placement": "corner",
      "source": {
        "ref": "now",
        "map": {
          "label": {
            "if": {
              "path": "good.data[0].id",
              "exists": false
            },
            "then": {
              "template": "No completed tests yet"
            },
            "else": {
              "if": {
                "path": "last.data[0].status",
                "equals": "failed"
              },
              "then": {
                "template": "Last completed test · {good_at|ago}"
              },
              "else": {
                "template": "Last test"
              }
            }
          },
          "items[0].value": {
            "if": {
              "path": "good.data[0].id",
              "exists": true
            },
            "then": {
              "if": {
                "path": "good.data[0].data.ping.jitter",
                "exists": true
              },
              "then": {
                "template": "{good.data[0].ping|round} ms · jitter {good.data[0].data.ping.jitter|round:1} ms"
              },
              "else": {
                "template": "{good.data[0].ping|round} ms"
              }
            },
            "else": {
              "template": "—"
            }
          },
          "items[1].value": {
            "if": {
              "path": "good.data[0].id",
              "exists": true
            },
            "then": {
              "template": "{avg_down} ↓ · {avg_up} ↑ Mbps · {stats.data.ping.avg|round} ms"
            },
            "else": {
              "template": "—"
            }
          },
          "items[2].value": {
            "if": {
              "path": "good.data[0].id",
              "exists": true
            },
            "then": {
              "if": {
                "path": "good.data[0].data.server.location",
                "exists": true
              },
              "then": {
                "template": "{good.data[0].data.server.name} · {good.data[0].data.server.location}"
              },
              "else": {
                "template": "{good.data[0].data.server.name}"
              }
            },
            "else": {
              "template": "—"
            }
          },
          "items[3].value": {
            "if": {
              "path": "good.data[0].id",
              "exists": true
            },
            "then": {
              "template": "{good.data[0].data.isp}"
            },
            "else": {
              "template": "—"
            }
          },
          "items[4].value": {
            "if": {
              "path": "good.data[0].id",
              "exists": true
            },
            "then": {
              "if": {
                "path": "good.data[0].data.packetLoss",
                "exists": true
              },
              "then": {
                "if": {
                  "path": "good.data[0].data.packetLoss",
                  "equals": 0
                },
                "then": {
                  "template": "0%"
                },
                "else": {
                  "template": "{good.data[0].data.packetLoss|round:1}%"
                }
              },
              "else": {
                "template": "Not reported"
              }
            },
            "else": {
              "template": "—"
            }
          }
        }
      }
    },
    {
      "id": "recent",
      "type": "list",
      "label": "Recent tests",
      "max_items": 4,
      "items": [],
      "source": {
        "ref": "now",
        "empty": {
          "text": "No finished tests yet",
          "when": {
            "path": "any",
            "equals": 0
          }
        },
        "map": {
          "items": {
            "each": "rows",
            "fields": {
              "key": "key",
              "text": {
                "if": {
                  "path": "failed",
                  "equals": 1
                },
                "then": {
                  "template": "Failed"
                },
                "else": {
                  "template": "{down} ↓ · {up} ↑ Mbps · {ping} ms"
                }
              },
              "subtitle": {
                "if": {
                  "path": "failed",
                  "equals": 1
                },
                "then": {
                  "template": "{message|clip:80}"
                },
                "else": {
                  "if": {
                    "path": "slow",
                    "equals": 1
                  },
                  "then": {
                    "template": "Below your thresholds"
                  }
                }
              },
              "detail": {
                "template": "{at|ago}"
              },
              "url": "url"
            }
          }
        }
      }
    }
  ]
}
```

## Questions

### What does Run a test now do?

The same as Speedtest in Speedtest Tracker: it adds a test to the queue, against the server Speedtest Tracker would pick itself. The button stays busy until the test finishes, usually within a minute, and the cards update then. A test uses real bandwidth: a gigabit line moves a gigabyte or two. Spotlight and Shortcuts can press it too.

### Where do the thresholds come from?

From Speedtest Tracker’s **Thresholds** settings. The charts draw the ones the newest completed test was checked against. With thresholds off, the charts have no dashed line and only a failed test counts as a problem.

### Why is the page orange when nothing failed?

Either the newest test was under one of your thresholds, or no test has finished for more than a day. Speedtest Tracker doesn’t share its schedule, so the page can’t tell a stopped schedule from a long gap. If you only run tests by hand, the page turns orange a day after the last one.

### Which Speedtest Tracker does it need?

1.14.7 or later. Before that release, the API read a date in `filter[start_at]` as an exact match, so the charts and the week's averages would be empty. It was checked on 1.15.1.

Legato is independent and isn’t affiliated with or endorsed by Speedtest Tracker or Ookla.

## Verification

The page’s rules were checked against Speedtest Tracker 1.15.1’s answers on 15 Nov 2026, on a server filled with a month of made-up hourly results: evening dips, tests under the thresholds, failed tests and a stretch before thresholds were set. One real test was run through the API to check a test’s shape while it waits and runs. Illustrations use a made-up provider, servers and numbers. See the [service index](https://legatobar.com/services/) for other examples.
