Use paginated-transactions feed to beat Starling's 1-year range limit#41
Open
open-dave wants to merge 2 commits into
Open
Use paginated-transactions feed to beat Starling's 1-year range limit#41open-dave wants to merge 2 commits into
open-dave wants to merge 2 commits into
Conversation
Starling is enforcing a one-year cap on the transactions-between / settled-transactions-between endpoints from 4 August 2026; requests with a wider window will be rejected with HTTP 400. get_transaction_feed queried settled-transactions-between with a >1000-year window, so both the elastic and sheets pipelines would have started failing. Switch to the category-scoped paginated-transactions endpoint, which is exempt from the cap, walking links.next until the feed is exhausted. Callers now pass the account's defaultCategory. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <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.
Why
Starling emailed (24 Jun 2026) that from 4 August 2026 (final extension) the Transaction Feed endpoints will reject any request with a date range > 1 year with
HTTP 400 Bad Request. Affected endpoints includesettled-transactions-between, which is exactly whatStarling.get_transaction_feedused — with a window from1000-01-01to now (~1000 years).Both pipelines that call it would break on 4 Aug:
starling_to_elastic.py→ Populate elastic workflow (runs every 15 min)starling_to_sheets.py→ Populate spreadsheet workflowWhat
get_transaction_feednow calls the category-scoped…/category/{categoryUid}/paginated-transactionsendpoint, which Starling recommends for ranges > 1 year and which is exempt from the cap.links.next(cursor pagination) until the feed is exhausted, concatenatingfeedItems. Includes a seen-page guard against loops.defaultCategory(already returned byget_accounts).Return shape (a flat list of feed items) is unchanged, so
generate_elastic_bulk_actionsand the sheets formatting are untouched.Testing
pytest tests/test_starling.py -v→ 6 passed locally.Endpoint contract verified against Starling's OpenAPI spec (
paginated-transactions: requiredmin/maxTransactionTimestamp,cursor/pageToFetch; responsePaginatedFeedItems=feedItems+links{self,first,prev,next}).🤖 Generated with Claude Code