feat: add shareholders, screener, short-trades, rank, top-movers, valuation-comparison APIs#92
Merged
Conversation
This was referenced May 20, 2026
…ank APIs - fundamental: ShareholderTop, ShareholderDetail, ValuationComparison (3 new methods) - quote: HkShortPositions, ShortTrades with auto market detection (2 new methods) - market: StockEvents (POST), RankCategories, RankList (3 new methods) - screener: new package with ScreenerContext — RecommendStrategies, UserStrategies, Strategy, Search, Indicators (5 new methods) All responses use json.RawMessage for forward-compatible raw data access. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…fied)
short_positions now auto-detects market from symbol suffix:
- .HK → GET /v1/quote/short-positions/hk (HKEX daily data)
- other → GET /v1/quote/short-positions/us (FINRA bi-monthly data)
Response is ShortPositionsResponse{Data json.RawMessage} since HK and US
have different shapes. HkShortPositions and ShortPositionStats removed.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ata APIs The Go HTTP client already extracts the `data` field from the API envelope before deserializing into the target struct. Wrapping in an intermediate struct with `json:"data"` caused double-unwrapping, producing null Data. Fix: use json.RawMessage directly as the deserialization target in ShareholderTop, ShareholderDetail, ValuationComparison, StockEvents, RankCategories, RankList, all screener methods. Also add missing json:"data" tags to market/types.go and screener/types.go response structs. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Renames method and response type: - `StockEvents` → `TopMovers` (method on MarketContext) - `StockEventsResponse` → `TopMoversResponse` (response type) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…rtPositions method)
3f9e1b3 to
a18b1ca
Compare
Replace json.RawMessage returns with typed structs across 5 new APIs:
- ShortPositions/ShortTrades: []*ShortPositionsItem / []*ShortTradesItem
with unified US+HK fields, timestamp → RFC 3339
- RankList: RankListResponse{Bmp, Lists []*RankListItem}, counter_id → symbol
- TopMovers: TopMoversResponse{Events []*TopMoversEvent, NextParams},
counter_id → symbol, timestamp → RFC 3339
- ValuationComparison: ValuationComparisonResponse{List []*ValuationComparisonItem},
counter_id → symbol, history date → RFC 3339
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
API wraps the array in {"counter_id":"...","data":[...]} object.
Changed both methods to use an outer struct, then extract inner data.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
hogan-yuan
added a commit
to longbridge/developers
that referenced
this pull request
May 22, 2026
…cs + CLI v0.22.0 release notes (#1013) ## Summary SDK documentation and CLI release notes for 13 new APIs. Branch cut from main. Related SDK PRs: [openapi #527](longbridge/openapi#527), [openapi-go #92](longbridge/openapi-go#92) ### New SDK docs (3 locales: zh-CN, zh-HK, en) **FundamentalContext:** `shareholder_top`, `shareholder_detail`, `valuation_comparison` **MarketContext:** `stock_events`, `rank_categories`, `rank_list` **QuoteContext:** `short_positions` (updated to US+HK unified), `short_trades` (new) **New ScreenerContext:** `screener_recommend_strategies`, `screener_user_strategies`, `screener_strategy`, `screener_search`, `screener_indicators` ### CLI v0.22.0 release notes `shareholder --top/--object-id`, `short-trades`, `compare`, `top-movers`, `screener`, `rank` ## Test plan - [ ] `autocorrect --lint docs/` — No issues ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds 13 new APIs across 4 contexts, ported from longbridge-mcp PR #49 and longbridge-terminal PR #209.
All responses use typed structs — not raw JSON:
counter_idfields converted to symbol format (e.g.ST/US/TSLA→TSLA.US)timestampfields converted to RFC 3339 (e.g."2026-05-19T14:48:17Z")ShortPositions/ShortTradesuse unified US+HK structs with market-specific optional fieldsFundamentalContext (3 new methods)
ShareholderTop(ctx, symbol)/v1/quote/shareholders/topShareholderDetail(ctx, symbol, objectID)/v1/quote/shareholders/holdingValuationComparison(ctx, symbol, currency, comparisonSymbols)/v1/quote/compare/valuationQuoteContext (1 extended + 1 new)
ShortPositions(ctx, symbol, count)/v1/quote/short-positions/hkor/usShortTrades(ctx, symbol, count)/v1/quote/short-trades/hkor/usMarketContext (3 new methods)
TopMovers(ctx, markets, sort, date, limit)/v1/quote/market/stock-eventsStockEventsRankCategories(ctx)/v1/quote/market/rank/categoriesRankList(ctx, key, needArticle)/v1/quote/market/rank/listScreenerContext (new package, 5 methods)
ScreenerRecommendStrategies(ctx)/v1/quote/screener/strategies/recommendScreenerUserStrategies(ctx)/v1/quote/screener/strategies/mineScreenerStrategy(ctx, id)/v1/quote/screener/strategyScreenerSearch(ctx, market, strategyID, page, size)/v1/quote/screener/searchScreenerIndicators(ctx)/v1/quote/screener/indicatorsBreaking changes
MarketContext.StockEventsrenamed toTopMovers;StockEventsResponse→TopMoversResponseHkShortPositionsremoved; useShortPositions(ctx, symbol, count)which auto-detects marketShortPositionsResponseis now{Data []*ShortPositionsItem}(typed) instead of raw JSONTest plan
go build ./...✅go vet ./...✅🤖 Generated with Claude Code