feat(fundamental): add MacrodataIndicators and Macrodata methods#98
Merged
Conversation
…thods
Two new methods on FundamentalContext:
- EconomicIndicatorList: GET /v1/quote/macrodata (list all ~619 indicators)
- EconomicIndicator: GET /v1/quote/macrodata/{indicator_code} (historical data)
New types: MultiLanguageText, EconomicIndicatorInfo, EconomicIndicatorData,
EconomicIndicatorResponse.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- StartDate: string -> *time.Time - ReleaseAt/NextReleaseAt: string -> *time.Time (optional) Use parseOptionalTimestamp helper (returns nil for zero/empty values). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…List/Macrodata Method names now match the API path /v1/quote/macrodata. Type names (EconomicIndicatorInfo, EconomicIndicatorData, etc.) unchanged. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Input params now accept time.Time and are serialized as RFC3339 (2024-01-01T00:00:00Z) to match API requirements. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
start_date -> start_time: YYYY-MM-DDT00:00:00Z end_date -> end_time: YYYY-MM-DDT23:59:59Z Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
EconomicIndicatorInfo -> MacrodataIndicatorInfo EconomicIndicatorData -> MacrodataRecord EconomicIndicatorResponse -> MacrodataResponse Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
MacrodataIndicatorInfo -> MacrodataIndicator MacrodataRecord -> Macrodata Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- EconomicIndicatorListResponse: json:"data" -> json:"list" (actual API field) - start_date/release_at/next_release_at: parse as RFC3339 string not unix seconds 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
Two new methods on
FundamentalContext:MacrodataIndicators(ctx, offset, limit)—GET /v1/quote/macrodata— list all macroeconomic indicators (~619 total)Macrodata(ctx, indicatorCode, startDate, endDate, limit)—GET /v1/quote/macrodata/{indicator_code}— fetch historical data for one indicatorstartDate/endDateaccept"YYYY-MM-DD"strings and are sent to the API asYYYY-MM-DDT00:00:00Z/YYYY-MM-DDT23:59:59Z.New Types
MultiLanguageTextMacrodataIndicatorMacrodataMacrodataResponseInfo MacrodataIndicator+Data []MacrodataTime field formats
All timestamp fields (
StartDate,ReleaseAt,NextReleaseAt) are returned as*time.Time(UTC) — consistent with other SDK methods.Related