Skip to content

Use paginated-transactions feed to beat Starling's 1-year range limit#41

Open
open-dave wants to merge 2 commits into
masterfrom
fix/starling-paginated-transactions
Open

Use paginated-transactions feed to beat Starling's 1-year range limit#41
open-dave wants to merge 2 commits into
masterfrom
fix/starling-paginated-transactions

Conversation

@open-dave

Copy link
Copy Markdown
Collaborator

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 include settled-transactions-between, which is exactly what Starling.get_transaction_feed used — with a window from 1000-01-01 to now (~1000 years).

Both pipelines that call it would break on 4 Aug:

  • starling_to_elastic.pyPopulate elastic workflow (runs every 15 min)
  • starling_to_sheets.pyPopulate spreadsheet workflow

What

  • get_transaction_feed now calls the category-scoped …/category/{categoryUid}/paginated-transactions endpoint, which Starling recommends for ranges > 1 year and which is exempt from the cap.
  • Walks links.next (cursor pagination) until the feed is exhausted, concatenating feedItems. Includes a seen-page guard against loops.
  • The endpoint is category-scoped, so callers now pass the account's defaultCategory (already returned by get_accounts).
  • Unit test updated to cover multi-page cursor pagination; integration test call updated.

Return shape (a flat list of feed items) is unchanged, so generate_elastic_bulk_actions and 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: required min/maxTransactionTimestamp, cursor/pageToFetch; response PaginatedFeedItems = feedItems + links{self,first,prev,next}).

🤖 Generated with Claude Code

open-dave and others added 2 commits June 25, 2026 21:25
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>
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.

1 participant