Popular Sharelists
Get popular/trending sharelists from the community.
SDK Links
Python |
Rust |
Go |
Node.js |
Java |
C++ |
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| count | integer | NO | Maximum number of results, default 20 |
Request Example
from longbridge.openapi import SharelistContext, Config, OAuthBuilder
oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url))
config = Config.from_oauth(oauth)
ctx = SharelistContext(config)
resp = ctx.popular(10)
print(resp)import asyncio
from longbridge.openapi import AsyncSharelistContext, 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 = AsyncSharelistContext.create(config)
resp = await ctx.popular(10)
print(resp)
if __name__ == "__main__":
asyncio.run(main())const { Config, SharelistContext, 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 = SharelistContext.new(config)
const resp = await ctx.popular(10)
console.log(resp)
}
main().catch(console.error)import com.longbridge.*;
import com.longbridge.sharelist.*;
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);
SharelistContext ctx = SharelistContext.create(config)) {
var resp = ctx.popular(10).get();
System.out.println(resp);
}
}
}use std::sync::Arc;
use longbridge::{oauth::OAuthBuilder, sharelist::SharelistContext, 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 = SharelistContext::new(config);
let resp = ctx.popular(10).await?;
println!("{:?}", resp);
Ok(())
}package main
import (
"context"
"fmt"
"log"
"github.com/longbridge/openapi-go/config"
"github.com/longbridge/openapi-go/oauth"
"github.com/longbridge/openapi-go/sharelist"
)
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)
}
c, err := sharelist.NewFromCfg(conf)
if err != nil {
log.Fatal(err)
}
defer c.Close()
resp, err := c.Popular(context.Background(), 10)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", resp)
}Response
Response Example
{
"code": 0,
"message": "success",
"data": {
"list": [
{ "id": 123, "name": "AI Picks", "description": "Top AI infrastructure stocks" },
{ "id": 456, "name": "EV Leaders", "description": "Electric vehicle sector leaders" }
]
}
}
Response Status
| Status | Description | Schema |
|---|---|---|
| 200 | Success | SharelistListResponse |
| 400 | Bad request | None |
Schemas
SharelistListResponse
| Name | Type | Required | Description |
|---|---|---|---|
| sharelists | object[] | false | User’s own sharelists, see SharelistInfo |
| subscribed_sharelists | object[] | false | Subscribed sharelists, see SharelistInfo |
| tail_mark | string | false | Pagination cursor for subscribed list |
SharelistInfo
| Name | Type | Required | Description |
|---|---|---|---|
| id | integer | true | Sharelist ID |
| name | string | false | Sharelist name |
| description | string | false | Description |
| cover | string | false | Cover image URL |
| subscribers_count | integer | false | Number of subscribers |
| chg | string | false | Day change percentage |
| this_year_chg | string | false | Year-to-date change percentage |
| subscribed | boolean | false | Whether the current user is subscribed |
| sharelist_type | integer | false | Type: 0=regular, 3=official, 4=industry |
| industry_code | string | false | Industry code (for industry sharelists) |
| stocks | object[] | false | Constituent stocks, see SharelistStock |
SharelistStock
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | true | Security symbol |
| code | string | false | Ticker code |
| name | string | false | Security name |
| market | string | false | Market |
| intro | string | false | Brief description |
| last_done | string | false | Latest price |
| change | string | false | Day change percentage |
| trade_status | integer | false | Trade status code |
| latency | boolean | false | Whether quote data is delayed |
| unread_change_log_category | string | false | Unread change log category |