BIOPUNK//NEWS

API

JSON over the same data the pages render. Read endpoints are open; writes need a session.

  1. GET /api/stories Ranked front page. ?page, ?limit, ?topic, ?sort=top|new|best|ask|show
  2. GET /api/item/:id One story or comment, with its comment tree when it is a story.
  3. GET /api/user/:id Public profile: karma, about, counts.
  4. GET /api/search?q= Full listing search.
  5. GET /api/topics Channels and their submission counts.
  6. POST /api/vote { id, dir: "up"|"down" } — session cookie + X-CSRF-Token required.
  7. POST /api/submit { title, url?, text?, topic? } — returns the new item.
  8. POST /api/comment { parent, text } — returns the new comment.
  9. GET /rss RSS 2.0 of the current front page.

Rate limit: 60 requests/minute per IP on reads, tighter on writes. Be kind — it is one small server in a shared incubator.