Create Topic
Create a new community topic on Topics. Two content types are supported:
| Type | title | body format | Notes |
|---|---|---|---|
post (default) | Optional | Plain text only | Markdown syntax (e.g. **bold**, # heading) is NOT rendered — it appears as literal characters, similar to a tweet. |
article | Required | Markdown | The server converts Markdown to HTML for display. Supports headers, tables, bold, code blocks, etc. |
Only users who have opened a Longbridge account and hold assets are allowed to publish community topics and replies via Longbridge Developers API or CLI. Returns 403 otherwise.
Stock symbols mentioned in the body (e.g. 700.HK, TSLA.US) are automatically recognized and linked as related stocks by the platform. Use tickers to associate additional symbols not explicitly mentioned in the body.
⚠️ Do not abuse symbol linking to associate unrelated stocks. Content moderation may restrict publishing or mute the account.
Rate limit: Max 3 topics per user per minute and 10 per 24 hours. Exceeding the limit returns 429.
⚠️ Rate limit thresholds are for reference only and may be adjusted by the platform at any time.
SDK Links
Python |
Rust |
Go |
Node.js |
Java |
C++ |
Request
| HTTP Method | POST |
| HTTP URL | /v1/content/topics |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| title | string | YES (for article) | Topic title. Required when topic_type is article; optional for post. |
| body | string | YES | Topic body. \n- For post: plain text only — Markdown is not rendered.\n- For article: Markdown is supported. |
| topic_type | string | NO | Content type: post (plain text, default) or article (Markdown). |
| tickers | string[] | NO | Related security symbols, format \{symbol\}.\{market\} (e.g. ["AAPL.US", "700.HK"]). Maximum 10. Note: Symbols mentioned in the body (e.g. 700.HK, TSLA.US) are automatically recognized and linked by the platform. Use tickers to associate additional symbols not explicitly mentioned in the body. |
| hashtags | string[] | NO | Hashtag names (e.g. ["earnings", "fed"]). Maximum 1. |
Request Example
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)
# Short post (plain text)
resp = ctx.create_topic(
title="",
body="Bullish on 700.HK today",
topic_type="post",
tickers=["700.HK"],
)
print(resp)
# Article (Markdown)
resp = ctx.create_topic(
title="My Analysis",
body="**Bullish** on 700.HK because...",
topic_type="article",
tickers=["700.HK"],
license=1,
)
print(resp)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)
resp = await ctx.create_topic(
title="My Analysis",
body="**Bullish** on 700.HK because...",
topic_type="article",
tickers=["700.HK"],
)
print(resp)
if __name__ == "__main__":
asyncio.run(main())const { Config, ContentContext, OAuth } = require('longbridge')
async function main() {
const oauth = await OAuth.build('your-client-id', (_, url) => {
console.log('Open this URL to authorize: ' + url)
})
const config = Config.fromOAuth(oauth)
const ctx = ContentContext.new(config)
// Article (Markdown body)
const resp = await ctx.createTopic({
title: 'My Analysis',
body: '**Bullish** on 700.HK because...',
topicType: 'article',
tickers: ['700.HK'],
})
console.log(resp)
}
main().catch(console.error)import com.longbridge.*;
import com.longbridge.content.*;
class Main {
public static void main(String[] args) throws Exception {
try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get();
Config config = Config.fromOAuth(oauth);
ContentContext ctx = ContentContext.create(config)) {
// Article (Markdown body, title required)
CreateTopicOptions opts = new CreateTopicOptions("My Analysis", "**Bullish** on 700.HK because...")
.setTopicType("article")
.setTickers(new String[]{"700.HK"})
.setLicense(1);
OwnedTopic resp = ctx.createTopic(opts).get();
System.out.println(resp);
}
}
}use std::sync::Arc;
use longbridge::{oauth::OAuthBuilder, content::{ContentContext, CreateTopicOptions}, Config};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open this URL to authorize: {url}")).await?;
let config = Arc::new(Config::from_oauth(oauth));
let ctx = ContentContext::new(config);
// Article (Markdown body, title required)
let opts = CreateTopicOptions {
title: "My Analysis".to_string(),
body: "**Bullish** on 700.HK because...".to_string(),
topic_type: Some("article".to_string()),
tickers: Some(vec!["700.HK".to_string()]),
hashtags: None,
license: Some(1),
};
let resp = ctx.create_topic(opts).await?;
println!("{:?}", resp);
Ok(())
}#include <iostream>
#include <longbridge.hpp>
#ifdef WIN32
#include <windows.h>
#endif
using namespace longbridge;
using namespace longbridge::content;
static void
run(const OAuth& oauth)
{
Config config = Config::from_oauth(oauth);
ContentContext ctx = ContentContext::create(config);
// Article (Markdown body, title required)
CreateTopicOptions opts;
opts.title = "My Analysis";
opts.body = "**Bullish** on 700.HK because...";
opts.topic_type = "article";
opts.tickers = {"700.HK"};
ctx.create_topic(opts, [](auto res) {
if (!res) { std::cout << "failed: " << *res.status().message() << std::endl; return; }
std::cout << "created topic: " << res->id << std::endl;
});
}
int main(int argc, char const* argv[]) {
#ifdef WIN32
SetConsoleOutputCP(CP_UTF8);
#endif
const std::string client_id = "your-client-id";
OAuthBuilder(client_id).build(
[](const std::string& url) {
std::cout << "Open this URL to authorize: " << url << std::endl;
},
[](auto res) {
if (!res) {
std::cout << "authorization failed: " << *res.status().message() << std::endl;
return;
}
run(*res);
});
std::cin.get();
return 0;
}package main
import (
"context"
"fmt"
"log"
"github.com/longbridge/openapi-go/config"
"github.com/longbridge/openapi-go/oauth"
"github.com/longbridge/openapi-go/content"
)
func main() {
o := oauth.New("your-client-id").
OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) })
if err := o.Build(context.Background()); err != nil {
log.Fatal(err)
}
conf, err := config.New(config.WithOAuthClient(o))
if err != nil {
log.Fatal(err)
}
ctx, err := content.NewFromCfg(conf)
if err != nil {
log.Fatal(err)
}
// Article (Markdown body, title required)
opts := content.CreateTopicOptions{
Title: "My Analysis",
Body: "**Bullish** on 700.HK because...",
TopicType: "article",
Tickers: []string{"700.HK"},
}
resp, err := ctx.CreateTopic(context.Background(), opts)
if err != nil {
log.Fatal(err)
}
fmt.Printf("created topic: %s\n", resp.ID)
}Response
Response Headers
- Content-Type: application/json
Response Example
{
"code": 0,
"message": "success",
"data": {
"item": {
"id": "39304657",
"title": "My View on AAPL",
"topic_type": "article",
"tickers": ["AAPL.US"],
"hashtags": ["earnings"],
"created_at": "1742000000"
}
}
}
Response Status
| Status | Description | Schema |
|---|---|---|
| 200 | Success | create_topic_response |
| 403 | Forbidden — user has not opened a Longbridge account or has no assets | None |
| 429 | Too Many Requests — rate limit exceeded (3/min or 10/24h); retry later | None |
| 500 | Internal error | None |
Schemas
create_topic_response
| Name | Type | Required | Description |
|---|---|---|---|
| item | object | true | Newly created topic details |
| ∟ id | string | true | Topic ID |
| ∟ title | string | false | Topic title |
| ∟ description | string | false | Plain-text summary (auto-generated from body) |
| ∟ body | string | false | Full body text (Markdown for article) |
| ∟ topic_type | string | false | Topic type. One of article, post |
| ∟ tickers | string[] | false | Associated security symbols |
| ∟ hashtags | string[] | false | Associated hashtag names |
| ∟ images | object[] | false | Image list |
| ∟∟ url | string | false | Original image URL |
| ∟∟ sm | string | false | Small thumbnail URL |
| ∟∟ lg | string | false | Large thumbnail URL |
| ∟ likes_count | int32 | false | Number of likes |
| ∟ comments_count | int32 | false | Number of replies |
| ∟ views_count | int32 | false | Number of views |
| ∟ shares_count | int32 | false | Number of shares |
| ∟ detail_url | string | false | Direct URL to the topic |
| ∟ author | object | false | Author information |
| ∟∟ member_id | string | false | Author member ID |
| ∟∟ name | string | false | Author display name |
| ∟∟ avatar | string | false | Author avatar URL |
| ∟ created_at | string | true | Unix timestamp (seconds) when the topic was created |
| ∟ updated_at | string | false | Unix timestamp (seconds) of last update |