Skip to main content
Official SDKs

Official SDKs. Every operation, typed, in your language.

An official uptime monitoring SDK for TypeScript, Python, Go and .NET puts every HostTracker API v2 operation behind a typed method instead of hand-rolled HTTP - each client generated from the same published OpenAPI document, wrapped in one small hand-written layer that behaves identically across all four.

One API token powers the REST API, the SDKs, ht-cli and the MCP server · 30-day trial · no credit card
npm · pip · go get · dotnet add
npm install @hosttracker/sdk
pip install hosttracker
go get github.com/HostTracker/hosttracker-sdk-go
dotnet add package HostTracker.Sdk
Four install commands, one typed surface, 182 operations each
Languages4TypeScript, Python, Go, .NET - all official, all MIT licensed.
Operations182, all typedGenerated from the same published OpenAPI document.
Dependencies0 (TypeScript)ESM and CommonJS, no runtime dependency to audit.
Minimum runtimeNode 20 · Python 3.11 · Go 1.24 · net8.0One line per language, see the compatibility table below.
Checkpoints300+Across 158 cities, reachable from every SDK's instant-check call.
Monitoring since2004The API and the SDKs sit on top of two decades of check history.
Getting started

Up and running in three steps

  1. Mint a token. Sign in and open Integrations - API, tick the scopes this integration needs, and copy the token it mints. It is a long-lived JWT - keep it out of source control, and set it as an environment variable such as HT_TOKEN rather than pasting it into code.
  2. Install the SDK for your stack. Any one of the four commands above - npm install @hosttracker/sdk, pip install hosttracker, go get github.com/HostTracker/hosttracker-sdk-go, or dotnet add package HostTracker.Sdk - installs the whole 182-operation surface, already typed.
  3. Make your first call. In TypeScript, that is six lines:
    import { HostTracker } from '@hosttracker/sdk';
    
    const ht = new HostTracker({ token: process.env.HT_TOKEN });
    
    const page = await ht.monitors.listMonitor({ query: { limit: 10, state: ['down'] } });
    console.log(page.data.length, 'monitors down');
    The other three languages follow the same shape - construct the client with the token, then call a method named after the operation you want. The "Ten lines in each language" section below has one worked example per SDK.
The four clients

One contract, four languages, the same behaviour in each

Every client is generated from the identical OpenAPI document, so switching language never means relearning the API - only the syntax around it changes.

TypeScript / JavaScript

@hosttracker/sdk

Node.js 20 or newer, ESM and CommonJS, zero runtime dependencies. Read calls work in a browser too - the webhook helpers are pure TypeScript with no node:crypto import.

Python

hosttracker

Python 3.11 or newer, typed end to end and built on httpx. Ships a synchronous HostTracker client and an identical AsyncHostTracker for async/await code.

Go

github.com/HostTracker/hosttracker-sdk-go

Go 1.24 or newer, package hosttracker. Every operation is a flat method on the client, context-based throughout - and it is what ht-cli is built on.

.NET

HostTracker.Sdk

Targets net8.0. Thread-safe and long-lived - build one client per process, or register it as a singleton, rather than one per call.

Shared

The hand-written layer

One error type, a retry policy that knows which 429 is which, automatic idempotency keys, cursor paging, job polling, instant-check polling and webhook signature verification - written once per language, behaving identically in all four.

Worked examples

Ten lines in each language

List down monitors - TypeScript

import { HostTracker } from '@hosttracker/sdk';

const ht = new HostTracker({ token: process.env.HT_TOKEN });

const page = await ht.monitors.listMonitor({ query: { limit: 10, state: ['down'] } });
for (const m of page.data) {
  console.log(m.id, m.url, m.state);
}
console.log(page.data.length, 'monitors down');

Create a monitor - Python

import os
from hosttracker import HostTracker

ht = HostTracker(token=os.environ["HT_TOKEN"])

created = ht.monitors.create_monitor(
    body={
        "name": "Marketing site",
        "type": "http",
        "url": "https://www.example.com",
        "interval": 5,
        "locations": {"pools": ["allworld"]},
    }
)
print(created.id)

Run an instant check and wait - Go

c, err := hosttracker.New(os.Getenv("HT_TOKEN"))
if err != nil {
    log.Fatal(err)
}

res, err := c.RunCheck(ctx, hosttracker.IcCreateRequest{
    Url:  "https://example.com",
    Type: hosttracker.Ptr(hosttracker.IcCreateRequestTypeHttp),
}, nil)
if err != nil {
    log.Fatal(err)
}
for _, ev := range *res.Events {
    fmt.Println(*ev.Location, ev.Error)
}

Verify a webhook - .NET

app.MapPost("/hooks/hosttracker", async (HttpRequest req) => {
    using var buffer = new MemoryStream();
    await req.Body.CopyToAsync(buffer);
    var rawBody = buffer.ToArray();

    var verdict = WebhookSignature.Verify(
        req.Headers.Select(h => new KeyValuePair<string, IEnumerable<string>>(h.Key, h.Value!)),
        rawBody, secrets: new[] { currentSecret, previousSecret });
    if (!verdict.IsValid) return Results.Unauthorized();

    var evt = WebhookEvent.Parse(rawBody);
    if (evt.Event == WebhookEvents.MonitorDown)
        Console.WriteLine(evt.DataAs<WebhookMonitorAlert>()!.Monitor!.Url);
    return Results.Ok();
});
Compatibility

Pick the SDK that matches your stack

LanguagePackageMinimum runtimeAsyncBrowser-safe readsGenerated from
TypeScript / JavaScript@hosttracker/sdk (npm)Node.js 20+Native (Promises)Yesgithub.com/HostTracker/openapi
Pythonhosttracker (PyPI)Python 3.11+Yes, AsyncHostTrackerNo - server-side onlygithub.com/HostTracker/openapi
Gogithub.com/HostTracker/hosttracker-sdk-goGo 1.24+Native (context.Context)No - server-side onlygithub.com/HostTracker/openapi (3.0 twin)
.NETHostTracker.Sdk (NuGet)net8.0Native (async/await)No - server-side onlygithub.com/HostTracker/openapi
Access, limits and safety

One token. Stated limits. Nothing hidden behind "generous".

The same personal API token authenticates the REST API v2, every official SDK, the ht-cli command line client and the MCP server. Mint it once on your HostTracker profile, pick the scopes it may use, and point any of the four at it.

PlanAPI accessReadsWrites
Free, Personal, WebmasterNot included--
30-day trialIncluded10 per minute, 10,000 per month5 per minute, 500 per month
BusinessIncluded60 per minute, 100,000 per month30 per minute, 20,000 per month
EnterpriseIncluded120 per minute, 1,000,000 per month60 per minute, 100,000 per month
  • Scoped tokens. A token carries only the scopes you tick - monitor, contact, webhook, check, status page, report, incident, maintenance, job, account - each as read or write. Grant what the integration needs and nothing else.
  • Long-lived, not revocable. Tokens are JWTs with a lifetime you choose (10 years by default) and cannot be revoked before they expire; an account-wide API switch disables every token at once. Treat a token like a password: keep it out of source control, and add an IP allow-list and a per-token request cap when you mint it.
  • Limits you can read. Every response carries RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset and RateLimit-Policy; a 429 carries Retry-After. Current usage is on the Integrations - API page and at GET /account/quota.
  • Safe retries. Writes accept an Idempotency-Key, so a retried request is never a duplicate; long operations return a job you can poll or have delivered to a webhook.

Full details: authentication and limits in the docs. Plans and prices: pricing.

Frequently Asked Questions

HostTracker publishes four official SDKs: TypeScript/JavaScript (@hosttracker/sdk on npm), Python (hosttracker on PyPI), Go (github.com/HostTracker/hosttracker-sdk-go) and .NET (HostTracker.Sdk on NuGet). All four are open source under the MIT licence on github.com/HostTracker, generated from the same published OpenAPI document, and cover every one of the 182 operations in the API v2 surface. If your language of choice is not among them, the OpenAPI document itself is public and works with any standard code generator - see the last question below.

Both, in layers. The typed request and response models and one method per operation are generated straight from the published OpenAPI document and regenerated whenever the API adds an endpoint, so the typed surface is never out of date by hand. Around that generated core sits a small hand-written layer, identical in shape across all four languages, that a generator alone cannot produce: one error type, a retry policy that knows which 429 is which, automatic idempotency keys, cursor paging helpers, job and instant-check polling, and webhook signature verification. The generated files are committed and never hand-edited; everything custom lives beside them in the repository.

Yes. Every SDK is generated from the same OpenAPI document the API v2 publishes, so all 182 operations across the 14 resource groups - Monitors, Monitor types, Results, Incidents, Maintenance, Contacts, Alerts, Reports, Webhooks, Status pages, Account, Monitoring locations, Instant checks and Jobs - are present and typed the day the API ships them. Method names mirror the specification's operationIds (camelCase in TypeScript, PascalCase in Go and .NET, snake_case in Python), so the reference documentation and a given SDK always name the same operation the same way.

TypeScript, Go and .NET are async-native: every call already returns a Promise, is built on a context.Context, or is awaited with async/await, so there is nothing extra to opt into. Python ships both: HostTracker is the synchronous client and AsyncHostTracker exposes the identical method names and options under async/await, built on httpx's async transport. Pick whichever matches the rest of your code base - the request and response shapes are the same either way, and nothing about the API itself is async-only or sync-only.

Read calls, yes. @hosttracker/sdk ships as ESM and CommonJS with zero dependencies, and its webhook helpers are pure TypeScript with no node:crypto import, so nothing in the package forces a Node runtime. What still needs care is your API token: a token minted for server-side use should never ship inside client-side JavaScript, since anyone who can read the bundle can read the token. The safe pattern is to call your own backend for anything that needs write access or a long-lived credential, and reserve direct browser calls for read-only, low-sensitivity data such as public monitor lists.

Retries are automatic and deliberately narrow: a 429 rate_limited and a 503 carrying Retry-After are retried honouring that header, a transport failure on a read is retried with backoff, and 429 quota_exceeded is never retried because waiting cannot help - only the reset or an upgrade can. Idempotency is automatic too: every write (POST, PATCH, PUT or DELETE that is not a paged /q query) gets a fresh Idempotency-Key by default, the same key rides every retry of that call, and the server replays its stored answer instead of doing the work twice. Keys live 24 hours; reusing one with a different body is refused as a conflict, by design.

There is no /v2 or /v3 path split to track: API v2 is versioned by hostname, not by a path prefix, and the API adds endpoints, optional fields and open-vocabulary values without a version bump. Each SDK release is generated from a specific snapshot of the published OpenAPI document, so a newer SDK release simply knows about newer operations and fields; an older release keeps working against the same live API, ignoring what it does not yet know about. Unknown response members are preserved rather than stripped, and open vocabularies such as monitor type or webhook event degrade to a plain string instead of failing to parse.

Yes - the same document these four SDKs are built from is public at github.com/HostTracker/openapi, as both a 3.1 original and a 3.0 twin for generators that do not read 3.1 yet. Point any OpenAPI generator - openapi-generator, oapi-codegen, NSwag or another - at it and you get the whole surface typed for whatever language you need. What you will not get for free are the conventions the official SDKs implement by hand: bearer auth, the problem-document error codes, automatic idempotency keys, Retry-After-aware retries, cursor paging, job polling and webhook signature verification - all written up in the API guides so you can add the parts you actually need.

30-day free trial - no credit card

Ship monitoring with your code

Install the SDK for your stack, mint a token, and your first monitor is ten typed lines away.