Repository navigation
Fix Alpaca SIP requests up to today on the free plan - #153
Merged
Merged
Conversation
update-all asks up to today, which a free plan answers with HTTP 403 for the SIP feed, reported as an invalid API key. A SIP stock request now ends sip_delay_minutes (default 15) before now; 0 disables the cut. 401/403 errors carry Alpaca's own message.
stefan-jansen
marked this pull request as ready for review
November 24, 2026 20:16
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.
Closes #151.
Alpaca Basic SIP requests can explicitly set
sip_delay_minutes=15to exclude the restricted recent window. The default is zero so paid subscribers keep access to their full requested range. Older bounds, other feeds and crypto remain unchanged. Invalid delay values raiseDataValidationError.Clipping that puts the end before the start returns the canonical empty frame without making an invalid HTTP request, in both synchronous and asynchronous workflows. Date-only end bounds cover the complete UTC date. HTTP 401 and 403 remain non-retried authentication/access failures and retain Alpaca's response body, including genuine subscription restrictions.
The provider guide includes the explicit Basic-plan configuration. The original contributor commit
4e09921is preserved. The maintainer follow-up fixes the paid-plan default and boundary/error handling rather than silently truncating paid data.Verification at
03544bfcdff6abb71fb59455b054fa707c94775e:fetch_ohlcvregressions on the original contributor implementation: 9 failed, 1 passed. These cover paid recent history, clipped empty/future/midnight windows, actual subscription responses, and invalid delay types.Tests exercise the actual provider pipeline with deterministic HTTP responses; the maintainer review made no live credentialed provider requests. The original submission disclosed Claude Code assistance; its author and commit remain attributed. Maintainer review and regression repairs also used an AI coding agent.