Longbridge Developers
Get Started

Topic Replies

Get a paginated list of replies for a specific topic. Browse the discussion on Topics.

Each reply includes author info, body (plain text), engagement counts, and a reply_to_id field: "0" indicates a top-level reply; any other value identifies the parent reply for nested replies.

>_ CLI
longbridge topic replies 6993508780031016960
longbridge topic replies 6993508780031016960 --page 2 --size 20

Request

HTTP MethodGET
HTTP URL/v1/content/topics/
/comments

Path Parameters

NameTypeRequiredDescription
topic_idstringYESTopic ID (e.g. 6993508780031016960)

Query Parameters

NameTypeRequiredDescription
pageint32NOPage number (1-based). Defaults to 1.
sizeint32NOItems per page, range 1–50. Defaults to 20.

Request Example

>_ CLI
longbridge topic replies 6993508780031016960
longbridge topic replies 6993508780031016960 --page 2 --size 20
from longbridge.openapi import ContentContext, Config, OAuthBuilder

oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url))
config = Config.from_oauth(oauth)
ctx = ContentContext(config)

replies = ctx.list_topic_replies("6993508780031016960", page=1, size=20)
for r in replies:
    print(r.author.name, r.body)
import asyncio
from longbridge.openapi import AsyncContentContext, Config, OAuthBuilder

async def main() -> None:
    oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url))
    config = Config.from_oauth(oauth)
    ctx = AsyncContentContext.create(config)

    replies = await ctx.list_topic_replies("6993508780031016960", page=1, size=20)
    for r in replies:
        print(r.author.name, r.body)

if __name__ == "__main__":
    asyncio.run(main())
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/longbridge/openapi-go/config"
	"github.com/longbridge/openapi-go/content"
)

func main() {
	conf, err := config.NewFromEnv()
	if err != nil {
		log.Fatal(err)
	}
	ctx, err := content.NewFromCfg(conf)
	if err != nil {
		log.Fatal(err)
	}
	replies, err := ctx.ListTopicReplies(context.Background(), "6993508780031016960",
		&content.ListTopicRepliesOptions{Page: 1, Size: 20},
	)
	if err != nil {
		log.Fatal(err)
	}
	for _, r := range replies {
		fmt.Printf("[%s] %s: %s\n", r.ID, r.Author.Name, r.Body)
	}
}
use std::sync::Arc;
use longbridge::{oauth::OAuthBuilder, content::{ContentContext, ListTopicRepliesOptions}, Config};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?;
    let config = Arc::new(Config::from_oauth(oauth));
    let ctx = ContentContext::new(config);
    let replies = ctx.list_topic_replies(
        "6993508780031016960",
        ListTopicRepliesOptions { page: Some(1), size: Some(20) },
    ).await?;
    for r in &replies {
        println!("{}: {}", r.author.name, r.body);
    }
    Ok(())
}

Response

Response Headers

  • Content-Type: application/json

Response Example

{
  "code": 0,
  "message": "success",
  "data": {
    "items": [
      {
        "id": "7001234567890123456",
        "topic_id": "6993508780031016960",
        "body": "Great analysis!",
        "reply_to_id": "0",
        "author": {
          "member_id": "10087",
          "name": "John Smith",
          "avatar": "https://example.com/avatar2.jpg"
        },
        "images": [],
        "likes_count": 5,
        "comments_count": 2,
        "created_at": "1742001500"
      },
      {
        "id": "7001234567890123457",
        "topic_id": "6993508780031016960",
        "body": "I disagree on the valuation part.",
        "reply_to_id": "7001234567890123456",
        "author": {
          "member_id": "10088",
          "name": "Alice Lee",
          "avatar": "https://example.com/avatar3.jpg"
        },
        "images": [],
        "likes_count": 1,
        "comments_count": 0,
        "created_at": "1742001800"
      }
    ]
  }
}

Response Status

StatusDescriptionSchema
200Successtopic_replies_response
500Internal errorNone

Schemas

topic_replies_response

NameTypeRequiredDescription
itemsobject[]trueList of replies
∟ idstringtrueReply ID
∟ topic_idstringtrueParent topic ID
∟ bodystringfalseReply body (plain text)
∟ reply_to_idstringfalseParent reply ID; "0" = top-level reply
∟ authorobjectfalseAuthor info
∟∟ member_idstringfalseAuthor member ID
∟∟ namestringfalseAuthor display name
∟∟ avatarstringfalseAuthor avatar URL
∟ imagesobject[]falseAttached images
∟∟ urlstringfalseOriginal image URL
∟∟ smstringfalseSmall thumbnail URL
∟∟ lgstringfalseLarge image URL
∟ likes_countint32falseLikes count
∟ comments_countint32falseNested replies count
∟ created_atstringtrueCreation time as Unix timestamp (seconds)