fix(calendar): expose next_date cursor and fix counter_id → symbol conversion#95
Merged
Merged
Conversation
… results The /v1/quote/finance_calendar endpoint paginates via a next_date cursor. Previously only the first page was returned, causing events on later pages (e.g. CRM.US, PDD.US, MRVL.US for a 2026-05-23→05-30 range) to be silently dropped. - Add next_date to jsontypes.CalendarEventsResponse - Loop in FinanceCalendar until next_date is empty, merging all pages - Deduplicate events by ID across pages Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
The /v1/quote/finance_calendar endpoint paginates via a next_date cursor. Previously next_date was silently dropped, making it impossible for callers to fetch subsequent pages. Now NextDate is returned as-is so callers can follow the cursor themselves. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
CalendarEventInfo.Symbol was returned as raw counter_id (e.g. ST/US/CRM) instead of the standard symbol format (CRM.US). Added a shared internal/counter package with IDToSymbol and updated the calendar converter to apply it. sharelist was also updated to use the shared helper instead of its local copy. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…tem, IndustryPeerNode Three fields were returning raw counter_id format (e.g. ST/US/CRM) instead of symbol format (CRM.US): - quote.DailyOptionVolume.Symbol (from underlying_counter_id) - fundamental.IndustryRankItem.CounterID - fundamental.IndustryPeerNode.CounterID Also migrate fundamental/context.go off its local counterIDToSymbol to the shared internal/counter.IDToSymbol helper. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…rNode These are industry-level counter IDs, not stock symbols, so conversion to symbol format is not appropriate. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Clarify FinanceCalendar pagination doc: "keeping the same end" - Remove fmt import from internal/counter, use string concat - Add unit tests for counter.IDToSymbol Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Merged
hogan-yuan
added a commit
that referenced
this pull request
Jun 2, 2026
## Summary Add CHANGELOG entry for v0.24.2. ## Changes in v0.24.2 ### Fixed - `calendar.CalendarEventsResponse`: expose `NextDate` cursor so callers can follow pagination (`/v1/quote/finance_calendar` returns results across multiple pages via `next_date`) - `calendar.CalendarEventInfo.Symbol`: convert raw `counter_id` (e.g. `ST/US/CRM`) to standard symbol format (`CRM.US`) - `quote.DailyOptionVolume.Symbol`: convert `underlying_counter_id` to symbol format ### Changed - Add `internal/counter.IDToSymbol` as shared `counter_id` → symbol conversion helper; `sharelist` migrated to use it ## Related - #95
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
Fix 1 —
CalendarEventsResponse.NextDateThe
/v1/quote/finance_calendarendpoint paginates via anext_datecursor, but the SDK was silently dropping it. A multi-day range query returns only the first page, causing events on later pages (e.g. CRM.US, PDD.US, MRVL.US for a 2026-05-23→05-30 range) to be missing.NextDateis now returned as-is inCalendarEventsResponse. When non-empty, pass it asstart(keeping the sameend) to fetch the next page.Fix 2 —
counter_id→ symbol conversionTwo fields were returning raw
counter_idformat (e.g.ST/US/CRM) instead of the standard symbol format (CRM.US):calendar.CalendarEventInfo.Symbolquote.DailyOptionVolume.Symbol(fromunderlying_counter_id)A shared
internal/counter.IDToSymbolhelper is introduced;sharelistis migrated to use it instead of its local copy.Changes
calendar/jsontypes/types.goNextDateto raw response typecalendar/types.goNextDateto publicCalendarEventsResponsecalendar/context.goNextDatethrough; convertSymbolviacounter.IDToSymbolquote/context.goDailyOptionVolume.Symbolviacounter.IDToSymbolinternal/counter/counter.goIDToSymbolhelperinternal/counter/counter_test.gosharelist/context.gocounter.IDToSymbolRelated