Skip to content

feat(stocks): request stocks/quotes and add WithQuotesFiftyTwoWeek - #28

Open
MarketDataDev02 wants to merge 5 commits into
mainfrom
fix/stocks-quotes-endpoint
Open

MarketDataDev02 wants to merge 5 commits into
mainfrom
fix/stocks-quotes-endpoint

Conversation

@MarketDataDev02

@MarketDataDev02 MarketDataDev02 commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What

  1. Stocks.Quote and Stocks.Quotes (and their CSV and HTML facets, which share the serializer in format_params.go) now request /v1/stocks/quotes/?symbols= instead of /v1/stocks/bulkquotes/. The bulkquotes path is deprecated and no longer in the public API documentation.
  2. New stocks.WithQuotesFiftyTwoWeek(enabled bool) QuotesOption: Quotes can now ask for 52-week high/low data for every symbol in one request. Until now the SDK only offered it on Quote, based on a claim that the API ignored 52week on multi-symbol requests, which no longer holds.

Closes #15

Version impact: minor (2.0.0 -> 2.1.0)

symbol before after breaking
(*Service).Quote unchanged signature, bulkquotes wire path unchanged signature, stocks/quotes wire path no
(*Service).Quotes unchanged signature, bulkquotes wire path unchanged signature, stocks/quotes wire path no
stocks.WithQuotesFiftyTwoWeek absent func(enabled bool) QuotesOption no (new symbol)

No existing exported identifier, signature, type, default or error changed. The new option makes this a minor. CHANGELOG.md carries the entries under ## [Unreleased]. A separate release PR promotes them to ## [2.1.0] before tag-and-release runs (RELEASE_PROCESS §3).

Why the response does not change

Read from the API code (marketDataApi/stock/views.py), with no live call:

/v1/stocks/quotes/ /v1/stocks/bulkquotes/
Handler get_stock_bulk_quotes_handler get_stock_bulk_quotes_handler
Declared parameters getQuotesSchemaParameters() getQuotesSchemaParameters()
Route kwargs none (resolve() gives stock-quotes, {}) none (stock-bulk-quotes, {})
Billing per symbol (MULTI_CREDIT_ENDPOINTS) per symbol
Demo symbols accepted accepted

The handler never branches on the path, so the fields, types and credits a caller sees are the same. marketdata/stocks/types.go::Quote keeps its fields. For 52week with several symbols, the handler calls _add_52_week_columns and never fails the request over it: a symbol whose range it cannot derive comes back null, which the SDK decodes as zero, the same as on Quote.

Other changes

  • Godoc of Quote, Quotes, QuoteOption, QuotesOption, WithFiftyTwoWeek and WithQuotesCandle no longer says the API ignores 52week on multi-symbol requests, and points each method at its own option.
  • Godoc links of Quote and Quotes point at /docs/api/stocks/quotes (the old URL 301s there).
  • internal/apicatalog: /v1/stocks/quotes/ maps to the stocks/quotes catalog endpoint and /v1/stocks/bulkquotes/ moves to outOfScopePaths as deprecated. The 52week row names both options, and the reachability probe sends it through Quotes too.
  • internal/negcompile: the negative case still asserts that the single-quote WithFiftyTwoWeek does not compile on Quotes (the option types stay distinct). The positive case builds Quotes with WithQuotesFiftyTwoWeek.
  • Examples: portfolio-monitor, watchlist-alerter and multi-asset-dashboard get the 52-week range with one Quotes call instead of one Quote per symbol. examples/README.md used to say Quotes and Prices cost 1 credit per request; the public docs (api/stocks/quotes.mdx, credits table) bill per symbol, and so does the API, so the note now says that.
  • Tests, mocks, modal_error.golden (regenerated with -update) and the live wire-shape probe assert the new path.

Review round 1 (2026-10-30, bot review of 5aa8af1)

id ask outcome
316316fc expose multi-symbol 52week on Quotes done in 40752ce: WithQuotesFiftyTwoWeek, catalog, godoc, unit tests, negcompile and the live test TestStocks_Quotes_With52Week
8aae0e02 minor instead of patch done: the new option makes it a minor, and the description and CHANGELOG say 2.1.0
8aae0e02 keep the entry under ## [Unreleased] not applied in round 1, done in round 2 (fdbd7301)

Review round 2 (2026-10-30, bot review of 40752ce)

id ask outcome
fdbd7301 keep the entries under ## [Unreleased] done in 27012f6. RELEASE_PROCESS §3 promotes the section "in a normal PR", so a separate release PR promotes it to ## [2.1.0] before tag-and-release runs
ba656118 update docs/stocks/quotes.md in this PR not applied here: docs/.sync-manifest.txt lists the file as owned by the docs sync workflow ("do not edit them by hand"), so the next sync would overwrite an edit here. The fix goes in MarketDataApp/documentation, and the synced page has to land before the 2.1.0 tag (RELEASE_PROCESS §3, step 3)

Siblings

Proof

Run on the devbox from the pushed tree (40752ce). The later commits only touch CHANGELOG.md and revert the lint pin, so the Go code is the same:

Check Result
gofmt -l . clean
go vet ./... and go vet -tags=integration ./integration/... clean
go test -race ./... (golang:1.24) all packages ok
go test -race -coverprofile ./marketdata/... ./internal/... 100.0%
examples/optionterm, examples/stockterm, examples/tuitest (go vet, go test -race) ok
internal/negcompile: stocks_quotes_52week.go (negative), stocks_quotes_split.go (positive) pass
golangci-lint v2.15.0 (checksummed release binary) 0 issues
Mutation: quotePath back to stocks/bulkquotes/ 5 tests fail (TestQuotePath_Params, TestQuote, TestHTMLService_Quote, TestWithAPIVersion, TestCatalogReachability)
Mutation: quotesPath back to stocks/bulkquotes/ 5 tests fail (TestQuotesPath_Params, TestQuotes, TestGetQuotes, TestQuotes_APIError, TestQuotes_NonOkStatus)
Mutation: drop 52week from quotesPath 2 tests fail (TestQuotesPath_FiftyTwoWeek, TestQuotes_WithQuotesFiftyTwoWeek)
git grep -i bulkquote only CHANGELOG.md, the outOfScopePaths entry and the schema fixture openapi_v1.json

The live suite runs in this PR's CI. At 40752ce the Integration Tests job passed against /v1/stocks/quotes/, including the new TestStocks_Quotes_With52Week, which asserts a non-zero 52-week range for both symbols.

CI: golangci-lint pin

Lint fails on this PR until #30 merges: golangci-lint v2.13.1 cannot read the version 5 export data that Go 1.27.3 (the runner's stable) writes, and reports typecheck errors inside the runner's stdlib. This PR carried the same bump in 5aa8af1, reverted in 9cc9508 so that #30 owns it. Once #30 is in main, a merge of main into this branch turns Lint green.

Not in this PR

The public Go SDK page for Quotes (docs/stocks/quotes.md, synced from MarketDataApp/documentation) lists stocks.QuoteOption, stocks.WithFiftyTwoWeek and stocks.WithExtended for Quotes, which do not compile there. It needs QuotesOption, WithQuotesFiftyTwoWeek, WithQuotesExtended and WithQuotesCandle. That fix goes in the documentation repository, since the next sync would overwrite an edit here, and it has to sync before the 2.1.0 tag.

Quote and Quotes, and their CSV and HTML facets, sent
/v1/stocks/bulkquotes/, which is deprecated and no longer in the public
API documentation. They now send /v1/stocks/quotes/?symbols=. The API
routes both paths to the same handler with the same declared parameters,
so the fields, types and billing a caller sees do not change, and no
exported identifier changes.

The OpenAPI allowlist now maps /v1/stocks/quotes/ to the stocks/quotes
catalog endpoint and lists /v1/stocks/bulkquotes/ as out of scope. Its
old reason for skipping /v1/stocks/quotes/ (no 52week or candle support)
no longer holds. Tests, mocks, the stockterm golden file and the live
wire-shape probe assert the new path. CHANGELOG promotes 2.0.1.

Closes #15
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (901e855) to head (27012f6).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #28   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           44        44           
  Lines         3140      3144    +4     
=========================================
+ Hits          3140      3144    +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Lint failed on every pull request with typecheck errors inside the
runner's stdlib: v2.13.1 cannot read the version 5 export data that the
runner's Go 1.27.3 writes. v2.15.0 reads it and reports 0 issues on
this tree under golang:1.27.3.
@marketdata-code-review

marketdata-code-review Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🟡 Needs changes — Code review

Switches stock Quote and Quotes requests to the canonical route, adds multi-symbol 52-week support, and updates tests and examples. Version impact: minor (2.0.0 -> 2.1.0). Runtime behavior is well exercised, but the release-note placement and public resource documentation remain incomplete.

Rating patch 4/6 (works with reservations) · proof 6/6 (comprehensive) · overall 4/6

Findings

Should fix

  • CHANGELOG.md:8-18 Use a minor release entry (contract, fdbd7301)
    The version impact is now correctly minor, but the feature notes are under a prematurely promoted, dated 2.1.0 section while Unreleased is empty. Keep these entries under ## [Unreleased] until the release is promoted.

    CHANGELOG.md:8-18 shows an empty ## [Unreleased] followed by ## [2.1.0] - 2026-10-30 containing this PR's notes.

symbol before after breaking
(*Service).Quote unchanged signature; bulkquotes wire path unchanged signature; stocks/quotes wire path no
(*Service).Quotes unchanged signature unchanged signature; accepts the new option implementation no
stocks.QuoteOption same interface same interface no
stocks.WithFiftyTwoWeek func(bool) QuoteOption unchanged no
stocks.QuotesOption same interface same interface no
stocks.WithQuotesFiftyTwoWeek absent func(bool) QuotesOption no
stocks.WithQuotesCandle func(bool) QuotesOption unchanged no
stocks.Quote same exported fields and types unchanged; comments updated no
  • docs/stocks/quotes.md:17-29 Update the Quotes resource page (docs, ba656118)
    The public page still says Quotes accepts QuoteOption and directs callers to single-quote options, so its 52-week example does not compile. Update it in this PR to use QuotesOption and document WithQuotesFiftyTwoWeek, WithQuotesExtended, and WithQuotesCandle.

    docs/stocks/quotes.md:17 declares opts ...QuoteOption; lines 27-29 list WithFiftyTwoWeek and WithExtended, and lines 142-144 pass stocks.WithFiftyTwoWeek(true) to Quotes.

Since last review

  • Resolved: 8aae0e02, 316316fc
  • 0 still open, 2 new

Reviewed 40752ce · revision 2 · codex (gpt-5.6-sol) · claude unavailable · rules: default, sdk

The API derives 52weekHigh and 52weekLow for multi-symbol requests on
/v1/stocks/quotes/, so Quotes now accepts WithQuotesFiftyTwoWeek and
sends 52week=true. A symbol whose range the API cannot derive comes back
null and keeps zero values. Quote keeps WithFiftyTwoWeek, and the two
option types stay distinct.

Godoc, the API catalog, the negative-compile corpus, the unit tests and
a live test for two symbols follow the new option. Three example apps
fetch the 52-week range with one Quotes call instead of one Quote per
symbol, and the examples README states the per-symbol billing the
public docs describe. CHANGELOG moves the section to 2.1.0.
@MarketDataDev02 MarketDataDev02 changed the title fix(stocks): request stocks/quotes instead of the deprecated bulkquotes feat(stocks): request stocks/quotes and add WithQuotesFiftyTwoWeek Oct 30, 2026
This reverts commit 5aa8af1. #30 carries the same
bump, so this PR no longer touches tests.yml and picks it up from main.
The release PR promotes the section to [2.1.0] before tag-and-release
runs, as RELEASE_PROCESS section 3 describes.
@MarketDataDev02

Copy link
Copy Markdown
Collaborator Author

Round 2:

  • fdbd7301: done in 27012f6. The entries are under ## [Unreleased], and a separate release PR promotes them to ## [2.1.0] before tag-and-release runs.
  • ba656118: not changed here. docs/stocks/quotes.md is in docs/.sync-manifest.txt, which marks it as owned by the docs sync workflow ("do not edit them by hand"), so the next sync would overwrite an edit in this repository. The fix goes in MarketDataApp/documentation and has to sync before the 2.1.0 tag.
  • 5aa8af1 (the golangci-lint bump) is reverted in 9cc9508 because ci(lint): bump golangci-lint to v2.15.0 for Go 1.27.3 #30 carries it. Lint stays red here until ci(lint): bump golangci-lint to v2.15.0 for Go 1.27.3 #30 merges, then a merge of main fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stocks Quote/Quotes still call the deprecated stocks/bulkquotes endpoint

1 participant