# H@H Update Metadata API

Public, read-only metadata for observed Hentai@Home client releases. All API endpoints below are relative to this service's origin and return JSON. Example versions and hashes are illustrative.

## Endpoints

- `GET /latest`: most recently observed release; `404` if none is recorded.
- `GET /get?v=1.6.5`: exact version; `400` for a missing or oversized `v`, `404` for an unknown version.
- `GET /versions`: `{ "versions": [...] }`, with up to 10 observed releases, newest first.
- `GET /status`: latest completed check and last known login state; not cached.

## Release object

```json
{
  "version": "1.6.5",
  "artifacts": {
    "bin": { "url": "https://repo.e-hentai.org/hath/HentaiAtHome_1.6.5.zip", "size_bytes": 115237, "sha256": "a42224c24008dbf895e2d178b1fa25589715788214f7ed526d1957217aaa912e" },
    "src": { "url": "https://repo.e-hentai.org/hath/HentaiAtHome_1.6.5_src.zip", "size_bytes": 110896, "sha256": "d2aab9bf9029c59b2f4a6e2ea8e8e1a0a4db66d22109c03aea57df58a6b8619d" }
  },
  "reward_eligible": true,
  "discovered_at": "2026-09-16T03:17:00.000Z"
}
```

`size_bytes` is in bytes; `sha256` is the hexadecimal SHA-256 from the upstream page. `discovered_at` is when this service first observed the release, not its official release date. `reward_eligible` is an estimate based on the two most recently observed versions. Versions published before monitoring began or missed between checks are not automatically recovered, so history and eligibility may be incomplete. The API returns links and metadata, not the files.

## Status object

Before the first check: `{ "last_check": null, "login_state": "unknown" }`. Otherwise `last_check` contains `started_at`, `finished_at`, `result`, and `version` (nullable). `result` is `success`, `login_expired`, `net_error`, `parse_failure`, `rate_limited` (HTTP 429), or `unknown_error`. `login_state` is `valid`, `expired`, or `unknown`; unrelated failures retain the last known state.

## Freshness

The default check runs daily at 03:17 UTC. `/latest` and `/versions` advertise a 24-hour HTTP cache lifetime. `/get` advertises 24 hours for reward-eligible releases and 30 days with `immutable` for others. KV replication and downstream HTTP caches can delay updates; `/get` also has a one-hour KV cache. A cache refresh failure may leave an older response until a later refresh or expiry.

This document is available at `/index.md`. A request to `/` with `Accept: text/markdown` receives a redirect to it. Browsers are redirected from `/` to `/index.html`.
