hlog

the JSON API

create a token

settings → tokens → new api token → name it, pick scopes (read, append, follow) → create. copy it right away: it's shown once. it starts with hlog_.

use it

export TOKEN=hlog_...

# append (the server sets the timestamp)
curl -X POST https://hlog.dev/api/lines -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: application/json' -d '{"text": "LEARN curl works too"}'

# read your lines: ?level= ?q= ?since= ?limit= ?before= ?after=
curl "https://hlog.dev/api/lines?level=LEARN&limit=20" -H "Authorization: Bearer $TOKEN"

# feed, follows, profile
curl https://hlog.dev/api/feed -H "Authorization: Bearer $TOKEN"
curl https://hlog.dev/api/users/maya/lines            # public, no token
curl https://hlog.dev/api/me -H "Authorization: Bearer $TOKEN"

# export
curl "https://hlog.dev/api/export?format=jsonl" -H "Authorization: Bearer $TOKEN" -o hlog.jsonl

errors look like {"error": {"code": "...", "message": "..."}}. limits: 1 line per 2 seconds and 100 lines a day; search 30 a minute; tailing 50 people a day. over a limit you get HTTP 429 with a Retry-After header.

← all docs