Show HN: Build on textlog

stagas1 pts0 comments

API · textlogskip to contentdevelopers<br>Build on textlog<br>The public API is a small way to build feeds, profile cards, post embeds, and live widgets. Reading needs no account or API key. Writing is available to every account with a bearer token.<br>Base URL<br>https://textlog.cc/api/v1All API endpoints allow cross-origin requests. The machine-readable specification is at /api/openapi.json.<br>Endpoints<br>POST/auth/requestEmail a sign-in code to an existing account.<br>POST/auth/verifyExchange the code for a session token.<br>DELETE/auth/sessionSign out by revoking the token you are using.<br>GET/meGet the signed-in account.<br>PATCH/meUpdate your bio.<br>POST/postsCreate a post, or reply by including parent_id.<br>GET/posts/:idGet a single public post.<br>PATCH/posts/:idEdit a post you own.<br>DELETE/posts/:idDelete a post you own. Replies remain and the post becomes a “(deleted)” tombstone.<br>GET/posts/:id/repliesGet the latest direct replies.<br>POST/posts/:id/reportReport a post.<br>GET/users/:handleGet a public profile and its counts.<br>GET/users/:handle/postsGet a user's latest posts and replies.<br>POST/users/:handle/followFollow a user.<br>DELETE/users/:handle/followUnfollow a user.<br>POST/users/:handle/blockBlock a user.<br>DELETE/users/:handle/blockUnblock a user.<br>GET/feeds/latestGet the latest public posts and replies.<br>GET/feeds/hotGet posts ranked by recent activity and replies.<br>GET/tags/:tag/postsGet the latest posts carrying a hashtag.<br>GET/search?q=:querySearch public posts by text.<br>GET/firehoseStream new posts as server-sent events.<br>RSS and Atom<br>Feed collections are also available as RSS 2.0 or Atom 1.0. Add .rss or .atom to the collection address and enter it manually in a feed reader.<br>/feeds/latest.rss<br>/feeds/hot.atom<br>/users/:handle/posts.rss<br>/tags/:tag/posts.atomPublic data archive<br>Download the latest daily, read-only snapshot as dump.zip. It contains paginated JSON files for public handles and bios, posts and reply links, mentions, hashtags, and follow relationships. The accounts are frozen: the archive contains no login credentials, contact details, record timestamps, blocks, reports, deleted content, or other private data.<br>curl -O https://textlog.cc/dump.zipEmbeds<br>Add a read-only textlog card to any website with an iframe. Copy an example and replace the handle, hashtag, or post number. Feed embeds show the five newest notes and all links open textlog. See every format together on the live embed examples page.

Appearance uses the theme, accent, and font query parameters.<br>Themes: system, light, dark, sepia, and dracula.<br>Accents: theme, sage, purple, cyan, pink, amber, blue, and rust.<br>Fonts: system, sf, menlo, monaco, consolas, cascadia, courier, lucida, dejavu, liberation, ubuntu, noto, droid, source, roboto, fira, jetbrains, and hack.<br>Pagination<br>Collections accept limit from 1–100 (default 20). Pass the opaque pagination.next_cursor value back as cursor to fetch the next page.<br>curl 'https://textlog.cc/api/v1/feeds/latest?limit=10'Search<br>Search is public and uses the same prefix matching as the website. Separate words must all match.<br>curl 'https://textlog.cc/api/v1/search?q=quiet+notes&limit=10'Firehose<br>The firehose is live-only and includes top-level posts and replies. Each new post arrives as a post event. Reconnects begin from that moment and do not replay missed events.<br>const events = new EventSource('https://textlog.cc/api/v1/firehose')<br>events.addEventListener('post', event => {<br>const post = JSON.parse(event.data)<br>})Writing<br>Every account can use the write endpoints. Authenticate with a bearer token; no separate API access setting is required.<br>Sign in with the code emailed alongside your magic link. Accounts are only created in a browser, so the API cannot sign anyone up.<br>curl -X POST https://textlog.cc/api/v1/auth/request \<br>-H 'content-type: application/json' -d '{"email":"you@example.com"}'

curl -X POST https://textlog.cc/api/v1/auth/verify \<br>-H 'content-type: application/json' -d '{"email":"you@example.com","code":"123456"}'The returned token is an ordinary session. It is listed under account security and can be revoked there. Send it as a bearer token. Cookies are never accepted for writes.<br>curl -X POST https://textlog.cc/api/v1/posts \<br>-H "authorization: Bearer $TOKEN" \<br>-H 'content-type: application/json' -d '{"body":"hello from an app"}'Limits and errors<br>API reads are limited to 120 requests per minute per IP. Firehose clients may hold three simultaneous connections per IP. Writes are limited to 60 per hour per account, and posting keeps the same limit as the website: three posts every five minutes. A limited response uses 429 and includes Retry-After.<br>"error": { "code": "not_found", "message": "Post not found" }

post posts textlog https public account

Related Articles