[harbor-commons] Public REST API for 990 transparency data#29
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
- FastAPI app with endpoints: /clubs, /clubs/{ein}, /clubs/{ein}/quiet-yield, /clubs/compare
- Rate limiting via slowapi (60 req/min/IP)
- OpenAPI docs at /docs (built-in)
- All reads from Supabase sailing_filer_core via anon key
- 15 unit tests (all mocked, no network access required)
- Updated requirements.txt for harbor-commons and root
Co-authored-by: fullharbor <237832340+fullharbor@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Expose 990 transparency data via REST endpoints
[harbor-commons] Public REST API for 990 transparency data
Mar 11, 2026
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.
990 financial data is currently only accessible via direct Supabase queries. This adds a public FastAPI service reading from
sailing_filer_coreto make it legible to parents, journalists, funders, and researchers.Endpoints (
packages/harbor-commons/src/api/main.py)GET /clubs— paginated, EIN-deduplicated list (latest tax year per org), optionalstatefilterGET /clubs/{ein}— full financial profile, up to 3 years of 990 dataGET /clubs/{ein}/quiet-yield— volunteer labor valuation via existingcalculate_quiet_yield+ BLS benchmarksGET /clubs/compare?eins=ein1,ein2— side-by-side comparison (2–10 clubs)GET /health— healthcheckGET /docs— OpenAPI (built-in)Rate limiting
slowapiat 60 req/min/IP on all endpoints.Supabase access pattern
Reads via anon key (
SUPABASE_ANON_KEY), RLS-protected. Lazy singleton client. No writes.Tests
15 unit tests in
test_api.py— all Supabase calls mocked via monkeypatched_get_supabase. Covers pagination, deduplication, 404s, validation (min 2 / max 10 EINs for compare), and OpenAPI schema correctness.Deps
Added
slowapi>=0.1.9to root and packagerequirements.txt. Advisory DB clean.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.