{"id":25828514,"url":"https://github.com/maestor/node-fantrax-stats-parser","last_synced_at":"2026-05-03T21:31:22.250Z","repository":{"id":41904875,"uuid":"203626811","full_name":"maestor/node-fantrax-stats-parser","owner":"maestor","description":"FFHL fantasy league statistics API and data scraper","archived":false,"fork":false,"pushed_at":"2026-04-24T11:45:19.000Z","size":2583,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-24T13:34:06.655Z","etag":null,"topics":["csvtojson","micro","nodejs","sports-stats","typescript"],"latest_commit_sha":null,"homepage":"https://ffhl-stats-api.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maestor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2019-08-21T16:49:45.000Z","updated_at":"2026-04-24T11:43:16.000Z","dependencies_parsed_at":"2026-01-05T04:06:47.124Z","dependency_job_id":null,"html_url":"https://github.com/maestor/node-fantrax-stats-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maestor/node-fantrax-stats-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maestor%2Fnode-fantrax-stats-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maestor%2Fnode-fantrax-stats-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maestor%2Fnode-fantrax-stats-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maestor%2Fnode-fantrax-stats-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maestor","download_url":"https://codeload.github.com/maestor/node-fantrax-stats-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maestor%2Fnode-fantrax-stats-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32586186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["csvtojson","micro","nodejs","sports-stats","typescript"],"created_at":"2025-02-28T17:40:31.606Z","updated_at":"2026-05-03T21:31:22.242Z","avatar_url":"https://github.com/maestor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FFHL Stats API\n\nFFHL Stats API serves FFHL fantasy-hockey data as JSON from a Turso/SQLite database. Fantrax CSV exports and FFHL forum draft history are import sources; runtime responses come from the database and, for some read-mostly routes, generated JSON snapshots.\n\n[Angular UI written for this API](https://github.com/maestor/fantrax-stats-parser-ui)\n\n[Hosted UI showcase](https://ffhl-stats.vercel.app/)\n\n## Quick Start\n\n- Node.js `\u003e=24 \u003c25`\n- npm `\u003e=10`\n\n```bash\ngit clone https://github.com/maestor/node-fantrax-stats-parser.git\ncd node-fantrax-stats-parser\nnpm install\ncp .env.example .env\nnpm run db:migrate\n\n# Choose one data source:\n# 1) Download CSV backup from R2 (requires R2 credentials in .env)\nnpm run r2:download\n\n# 2) Or use existing files already present under csv/\n\nnpm run db:import:stats\nnpm run dev\n```\n\nOpen [http://localhost:3000/api-docs](http://localhost:3000/api-docs) for the local Swagger UI.\n\nIf you need to scrape fresh Fantrax or FFHL forum data instead of using existing CSV/JSON inputs, use [docs/IMPORTING.md](docs/IMPORTING.md).\n\n## API Docs\n\n- Hosted Swagger UI: [https://ffhl-stats-api.vercel.app/api-docs](https://ffhl-stats-api.vercel.app/api-docs)\n- Hosted OpenAPI JSON: [https://ffhl-stats-api.vercel.app/openapi.json](https://ffhl-stats-api.vercel.app/openapi.json)\n- Local docs: start the dev server and open [http://localhost:3000/api-docs](http://localhost:3000/api-docs)\n\nThe hosted demo supports both root-style URLs and `/api/*` URLs. Health routes stay public, while most data routes require an API key via `x-api-key` or `Authorization: Bearer \u003ckey\u003e`.\n\n### Players and Goalies\n\n```bash\ncurl -H \"x-api-key: \u003cyour-key\u003e\" \\\n  \"https://ffhl-stats-api.vercel.app/players/combined/regular?teamId=1\"\n\ncurl -H \"x-api-key: \u003cyour-key\u003e\" \\\n  \"https://ffhl-stats-api.vercel.app/goalies/combined/playoffs?teamId=1\"\n```\n\n### Career\n\n```bash\ncurl -H \"x-api-key: \u003cyour-key\u003e\" \\\n  \"https://ffhl-stats-api.vercel.app/career/players\"\n\n curl -H \"x-api-key: \u003cyour-key\u003e\" \\\n  \"https://ffhl-stats-api.vercel.app/career/highlights/most-teams-owned\"\n```\n\n### Leaderboard\n\n```bash\ncurl -H \"x-api-key: \u003cyour-key\u003e\" \\\n  \"https://ffhl-stats-api.vercel.app/leaderboard/regular\"\n\ncurl -H \"x-api-key: \u003cyour-key\u003e\" \\\n  \"https://ffhl-stats-api.vercel.app/leaderboard/transactions\"\n\ncurl -H \"x-api-key: \u003cyour-key\u003e\" \\\n  \"https://ffhl-stats-api.vercel.app/leaderboard/finals\"\n```\n\n### Draft\n\n```bash\ncurl -H \"x-api-key: \u003cyour-key\u003e\" \\\n  \"https://ffhl-stats-api.vercel.app/draft/original\"\n\ncurl -H \"x-api-key: \u003cyour-key\u003e\" \\\n  \"https://ffhl-stats-api.vercel.app/draft/entry\"\n```\n\n`/draft/entry` includes per-pick `playedInLeague` and `playedForDraftingTeam` flags plus matching team-summary counts and percentages.\n\n### Meta\n\n```bash\ncurl https://ffhl-stats-api.vercel.app/health\n\ncurl -H \"x-api-key: \u003cyour-key\u003e\" \\\n  \"https://ffhl-stats-api.vercel.app/teams\"\n\ncurl -H \"x-api-key: \u003cyour-key\u003e\" \\\n  \"https://ffhl-stats-api.vercel.app/seasons?startFrom=2020\"\n\ncurl -H \"x-api-key: \u003cyour-key\u003e\" \\\n  \"https://ffhl-stats-api.vercel.app/last-modified\"\n```\n\n`/teams` returns each configured team's current `teamAbbr`, and `/leaderboard/finals` includes `teamAbbr` on both `awayTeam` and `homeTeam`.\n\nOpenAPI is the source of truth for route parameters and response schemas.\n\n## Common Commands\n\n```bash\nnpm run dev\nnpm run verify\nnpm run db:migrate\nnpm run db:import:stats\nnpm run playwright:sync:playoffs\nnpm run db:import:finals-results\nnpm run playwright:sync:finals\nnpm run test:integration\nnpm run snapshot:generate\n```\n\n## Agent Workflow\n\nCodex work in this repository defaults to the backend/basic skill set from `maestor/agent-skills`: `intelligence-testing`, `api-contract-sync`, and `local-first-verification`. Those skills live in this repo under `.agents/skills/`. `mutation-testing` is intentionally not part of this project. See [docs/AGENT_SKILLS.md](docs/AGENT_SKILLS.md) for the project-local install command and automatic usage rules.\n\n## Documentation\n\n- [docs/AGENT_SKILLS.md](docs/AGENT_SKILLS.md) - default Codex skill set, project-local install flow, and when to apply each backend skill\n- [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) - development workflow, code standards, project structure, OpenAPI maintenance\n- [docs/TESTING.md](docs/TESTING.md) - test strategy, coverage expectations, integration testing rules\n- [docs/IMPORTING.md](docs/IMPORTING.md) - Fantrax sync/import workflows, FFHL draft sync, draft entity linking/backfill, CSV normalization\n- [docs/DEPLOYMENT.md](docs/DEPLOYMENT.md) - Vercel, Turso, R2, API auth, caching, operational commands\n- [docs/SNAPSHOTS.md](docs/SNAPSHOTS.md) - snapshot-backed endpoints, generation rules, R2 snapshot storage\n- [docs/SCORING.md](docs/SCORING.md) - player and goalie scoring model details\n- [docs/RATING.md](docs/RATING.md) - finals leaderboard rate model details\n\n## Technology\n\nWritten in TypeScript on Node.js. The API uses lightweight local HTTP helpers, [rou3](https://github.com/h3js/rou3) for route matching, Turso/libSQL for the database layer, and local import tooling around Playwright plus `csv-parse`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaestor%2Fnode-fantrax-stats-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaestor%2Fnode-fantrax-stats-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaestor%2Fnode-fantrax-stats-parser/lists"}