Skip to content

Fix Alpaca SIP requests up to today on the free plan - #153

Merged
stefan-jansen merged 4 commits into
ml4t:mainfrom
0x0f0f0f:fix/alpaca-sip-free-plan
Nov 24, 2026
Merged

stefan-jansen merged 4 commits into
ml4t:mainfrom
0x0f0f0f:fix/alpaca-sip-free-plan

Conversation

@0x0f0f0f

@0x0f0f0f 0x0f0f0f commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #151.

Alpaca Basic SIP requests can explicitly set sip_delay_minutes=15 to 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 raise DataValidationError.

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 4e09921 is preserved. The maintainer follow-up fixes the paid-plan default and boundary/error handling rather than silently truncating paid data.

Verification at 03544bfcdff6abb71fb59455b054fa707c94775e:

  • Independent public fetch_ohlcv regressions 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.
  • Final focused provider/SIP checks: 136 passed with ResourceWarning treated as an error; includes mixed timestamp-start/date-only-end bounds.
  • Ruff lint/format, ty and commit hooks passed.
  • Final-head hosted CI, documentation, security and ecosystem qualification are running. This is not a claim of completed final-head qualification. The existing lockfile audit dependency is owned by fix(ci): restore documentation and dependency audit gates #147.

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.

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
stefan-jansen marked this pull request as ready for review November 24, 2026 20:16
@stefan-jansen
stefan-jansen merged commit 0a8df4d into ml4t:main Nov 24, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Alpaca SIP requests up to today fail on the free plan, reported as an invalid API key

2 participants