Skip to content

feat(import): add Splitwise API import for full expense history#660

Closed
Mufaddal5253110 wants to merge 1 commit into
oss-apps:mainfrom
Mufaddal5253110:feature/splitwise-api-import
Closed

feat(import): add Splitwise API import for full expense history#660
Mufaddal5253110 wants to merge 1 commit into
oss-apps:mainfrom
Mufaddal5253110:feature/splitwise-api-import

Conversation

@Mufaddal5253110
Copy link
Copy Markdown

Description

Adds direct Splitwise API import for complete expense history with individual transactions.

What it does:

  • Imports individual expenses (not just net balances) with correct paid_share / owed_share calculations
  • Preserves original createdAt timestamps for proper Activity ordering
  • Uses transactionId to prevent duplicates (safe to re-run)

Files added:

  • src/lib/splitwise-api.ts - API client with pagination
  • src/lib/splitwise-converter.ts - Conversion logic
  • src/server/api/routers/splitwiseApiImport.ts - tRPC endpoints
  • src/pages/import-splitwise-api.tsx - UI for API key entry and group selection
  • src/tests/splitwise-converter.test.ts - 29 test cases

Closes #307
Related to #465 (different approach - direct API vs external tool)

⚠️ ToS Discussion Needed

As noted in #307, Splitwise's API ToS prohibits use for competing services. This PR uses the direct API because the JSON export from export-splitwise only contains net balances, not individual expenses.

Options to discuss:

  1. Keep API import with disclaimer (user provides their own key)
  2. Remove and rely on CSV/JSON import only
  3. Other suggestions?

Demo

  1. User enters Splitwise API key (from secure.splitwise.com/apps)
  2. Selects groups to import
  3. Expenses imported with full history

Checklist

  • I have read CONTRIBUTING.md in its entirety
  • I have performed a self-review of my own code
  • I have added unit tests to cover my changes
  • The last commit successfully passed pre-commit checks
  • Any AI code was thoroughly reviewed by me

@Mufaddal5253110 Mufaddal5253110 mentioned this pull request May 24, 2026
9 tasks
@krokosik
Copy link
Copy Markdown
Collaborator

Sorry, I don't accept 100% vibe coded PRs and this is clearly one of them. Most importantly I cannot accept it due to the fact that it violates the Splitwise API ToS.

@krokosik krokosik closed this May 25, 2026
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.

Splitwise import 2.0

2 participants