[Return]

Post API guide

Kokonotsuba provides a read-only API for fetching post data. You can fetch data from individual posts or whole threads.

Get a single post

GET https://img.heyuri.net/z/koko.php?mode=module&load=postApi&post_uid={post_uid}

Returns JSON with the post data and rendered HTML

Parameters

ParameterTypeDescription
post_uidintegerThe unique ID of the post

Response fields

FieldTypeDescription
post_uidintegerPost unique ID
timestampstringPost timestamp
namestringPoster name
tripcodestringTripcode (formatted)
secure_tripcodestringSecure tripcode
capcodestringStaff capcode
emailstringEmail field
subjectstringPost subject
commentstringRaw comment text
parent_thread_uidintegerUID of the parent thread
parent_post_numberintegerPost number of the thread OP
htmlstringFully rendered post HTML

Example response

{
  "timestamp": "2026-11-03 06:58:30",
  "post_uid": 286886,
  "name": "Anonymous",
  "tripcode": "",
  "secure_tripcode": "",
  "capcode": "",
  "email": "",
  "subject": "",
  "comment": ">>286880\nI agree",
  "text_format": 1,
  "parent_thread_uid": "b817a716e3",
  "parent_post_number": 128450,
  "attachments": [
    {
      "file_id": 0,
      "file_name": "cat",
      "file_extension": ".png",
      "file_size": 48213,
      "file_width": 800,
      "file_height": 600,
      "thumb_width": 250,
      "thumb_height": 187,
      "mime_type": "image/png",
      "md5": "9e107d9d372bb6826bd81d3542a419d6"
    }
  ],
  "html": "<div id=\"pc1_128456\" class=\"reply-container\">...</div>"
}

A post that does not exist answers 404 with the message as a JSON string:

"Post not found!"

Get posts from a thread (paginated)

GET https://img.heyuri.net/z/koko.php?mode=module&load=postApi&pageName=thread&thread_uid={thread_uid}&page={page}

Returns JSON with a page of posts from the specified thread. The OP is always included on every page.

Parameters

ParameterTypeDescription
thread_uidstringThe unique ID of the thread
pageintegerPage number (0-based, optional, defaults to 0)

Response

Returns an object with thread_uid, page, post_count, and posts (array of post objects with the same fields as the single post endpoint).

Example response

{
  "thread_uid": "b817a716e3",
  "page": 0,
  "post_count": 2,
  "posts": [
    { "post_uid": 286850, "parent_post_number": 128450, ... },
    { "post_uid": 286886, "parent_post_number": 128450, ... }
  ]
}

Get thread list (paginated)

GET https://img.heyuri.net/z/koko.php?mode=module&load=postApi&pageName=threads&board_uid={board_uid}&page={page}

Returns a paginated list of thread UIDs for the board, sorted by creation time (newest first).

Parameters

ParameterTypeDescription
board_uidintegerThe numeric board UID (optional, defaults to the current board)
pageintegerPage number (0-based, optional, defaults to 0)

Response

Returns an object with page, threads_per_page, thread_count, and threads (array of thread objects).

FieldTypeDescription
thread_uidstringUnique ID of the thread
subjectstringSubject of the opening post
last_bump_timestringTimestamp of the last bump
thread_created_timestringTimestamp of when the thread was created
post_countintegerTotal number of posts in the thread

Example response

{
  "page": 0,
  "threads_per_page": 15,
  "thread_count": 1,
  "threads": [
    {
      "thread_uid": "b817a716e3",
      "subject": "Cat thread",
      "last_bump_time": "2026-11-03 06:58:30",
      "thread_created_time": "2026-10-28 14:02:11",
      "post_count": 42
    }
  ]
}

Find the source of a text quote

GET https://img.heyuri.net/z/koko.php?mode=module&load=postApi&pageName=quote&thread_uid={thread_uid}&before_uid={post_uid}&text={text}

Returns the nearest earlier post of the thread that a ">text", ">file.jpg" or ">No.123" quote refers to, in the same shape as a single post. Responds 404 when nothing matches.

Parameters

ParameterTypeDescription
thread_uidstringThe unique ID of the thread
before_uidintegerThe post_uid of the quoting post. Only posts before it are searched
textstringThe quoted text without its leading ">", at most 300 characters. A number is looked up as a post number, and a name with an extension also matches attachment file names
quoted0 | 1Set to 1 for a ">>text" quote of a quote, which only matches posts that quote something themselves

Example response

{ "post_uid": 286850, "parent_post_number": 128450, ... }

The same object as a single post. When no earlier post matches, it answers 404 with "Post not found!".