{"id":34255106,"url":"https://github.com/jongan69/college-financial-estimate-api","last_synced_at":"2026-03-12T02:01:59.061Z","repository":{"id":323237888,"uuid":"1092588002","full_name":"jongan69/college-financial-estimate-api","owner":"jongan69","description":"A python api for estimating college degree prices","archived":false,"fork":false,"pushed_at":"2025-11-09T21:29:29.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-19T23:45:22.532Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jongan69.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-08T22:48:50.000Z","updated_at":"2025-11-09T21:29:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jongan69/college-financial-estimate-api","commit_stats":null,"previous_names":["jongan69/college-financial-estimate-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jongan69/college-financial-estimate-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Fcollege-financial-estimate-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Fcollege-financial-estimate-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Fcollege-financial-estimate-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Fcollege-financial-estimate-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jongan69","download_url":"https://codeload.github.com/jongan69/college-financial-estimate-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jongan69%2Fcollege-financial-estimate-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30412239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T00:40:14.898Z","status":"online","status_checked_at":"2026-03-12T02:00:07.260Z","response_time":114,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-16T12:31:56.208Z","updated_at":"2026-03-12T02:01:59.056Z","avatar_url":"https://github.com/jongan69.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# College Financial API\n\nA FastAPI application that estimates the total cost of college degrees for U.S. universities using the College Scorecard API.\n\n## Features\n\n✅ **Caching** - In-memory caching to avoid duplicate external API requests  \n✅ **Compare Endpoint** - Compare costs across multiple universities  \n✅ **Program Cost Endpoint** - Get cost information for specific programs/fields of study  \n✅ **Inflation Adjustment** - Optional inflation adjustment for cost estimates  \n\n## Installation\n\n```bash\npip install -r requirements.txt\n```\n\nOr install individually:\n```bash\npip install fastapi uvicorn requests python-dotenv\n```\n\n## Configuration\n\nCreate a `.env` file in the root directory:\n\n```env\nAPI_KEY=your_key_here\nDATA_API_KEY=your_key_here\n```\n\nGet your free API key from: https://api.data.gov/signup/\n\n## Running Locally\n\n```bash\nexport API_KEY=\"your_key_here\"\nuvicorn main:app --reload\n```\n\nThen visit:\n- API: http://127.0.0.1:8000\n- Interactive Docs: http://127.0.0.1:8000/docs\n\n## API Documentation\n\n### Interactive Documentation\n\nVisit the interactive documentation page:\n- **Deployed**: https://college-financial-api.gradtrack.workers.dev/docs\n- **Local**: http://127.0.0.1:8000/docs (when running locally)\n\nThe docs page includes:\n- Complete API reference\n- Parameter descriptions\n- Example requests and responses\n- Try-it links for each endpoint\n\n## API Endpoints\n\n### GET `/degree-cost`\nGet the total cost of a degree for a single university.\n\n**Parameters:**\n- `university` (required): Full name of the university\n- `degree` (optional): Degree level (default: \"Bachelor\")\n- `years` (optional): Number of years (default: 4)\n- `adjust_inflation` (optional): Adjust costs for inflation (default: false)\n\n**Example:**\n```\nhttp://127.0.0.1:8000/degree-cost?university=University%20of%20Florida\u0026years=4\u0026adjust_inflation=true\n```\n\n### GET `/compare`\nCompare costs across multiple universities (up to 10).\n\n**Parameters:**\n- `universities` (required): Comma-separated list of university names\n- `degree` (optional): Degree level (default: \"Bachelor\")\n- `years` (optional): Number of years (default: 4)\n- `adjust_inflation` (optional): Adjust costs for inflation (default: false)\n\n**Example:**\n```\nhttp://127.0.0.1:8000/compare?universities=University%20of%20Florida,University%20of%20California\u0026years=4\n```\n\n### GET `/program-cost`\nGet cost for a specific program/field of study at a university.\n\n**Parameters:**\n- `university` (required): Full name of the university\n- `program` (optional): Field of study (e.g., \"Computer Science\", \"Business\")\n- `degree` (optional): Degree level (default: \"Bachelor\")\n- `years` (optional): Number of years (default: 4)\n- `adjust_inflation` (optional): Adjust costs for inflation (default: false)\n\n**Example:**\n```\nhttp://127.0.0.1:8000/program-cost?university=University%20of%20Florida\u0026program=Computer%20Science\u0026years=4\n```\n\n## Caching\n\nThe API uses in-memory caching to avoid duplicate external API requests. Cache is stored in memory for the duration of the application runtime.\n\n## Response Format\n\nAll endpoints return JSON with the following structure:\n\n```json\n{\n  \"university\": \"University of Florida\",\n  \"degree\": \"Bachelor\",\n  \"years\": 4,\n  \"in_state_total\": 45600,\n  \"out_of_state_total\": 180000,\n  \"breakdown\": {\n    \"tuition_in_state\": 6380,\n    \"tuition_out_state\": 28659,\n    \"room_board\": 10190,\n    \"other_expenses\": 3330\n  },\n  \"inflation_adjusted\": false\n}\n```\n\n## Deployment to Cloudflare Workers\n\nThe API is deployed serverlessly on Cloudflare Workers (no local server needed).\n\n**Live API**: `https://college-financial-api.gradtrack.workers.dev`\n\n### Deploy\n\n```bash\n# Install Wrangler CLI\nnpm install -g wrangler\n# or\nbun install -g wrangler\n\n# Login to Cloudflare\nwrangler login\n\n# Set API key secret\nwrangler secret put API_KEY\n\n# Deploy\n./deploy_workers.sh\n# or\nwrangler deploy\n```\n\n### Test Deployed API\n\n```bash\n# Test root endpoint\ncurl https://college-financial-api.gradtrack.workers.dev/\n\n# Test degree cost\ncurl \"https://college-financial-api.gradtrack.workers.dev/degree-cost?university=MIT\"\n\n# Run test suite\npython3 test_deployed_api.py\n```\n\n## Testing\n\n### Local Testing\n\n```bash\n# Run test suite\npython3 test_api.py\n```\n\n### Deployed API Testing\n\n```bash\npython3 test_deployed_api.py\n```\n\n## Notes\n\n- The College Scorecard API has limited program-specific cost data. The `/program-cost` endpoint provides base university costs with program availability information.\n- Inflation adjustment uses a 3% annual inflation rate by default.\n- The API uses in-memory caching to reduce external API calls.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjongan69%2Fcollege-financial-estimate-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjongan69%2Fcollege-financial-estimate-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjongan69%2Fcollege-financial-estimate-api/lists"}