{"_id":"@buzzr/dfs-engine-espn","_rev":"2-fe57929b228cf04f8213cbcfe10795e8","name":"@buzzr/dfs-engine-espn","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@buzzr/dfs-engine-espn","version":"0.1.0","keywords":["espn","dfs","sports-data","gamelog","boxscore","prizepicks","underdog"],"author":{"name":"Sarvesh Chidambaram"},"license":"MIT","_id":"@buzzr/dfs-engine-espn@0.1.0","maintainers":[{"name":"sarveshsea","email":"sarveshjax@gmail.com"}],"homepage":"https://github.com/sarveshsea/dfs-engine-espn","bugs":{"url":"https://github.com/sarveshsea/dfs-engine-espn/issues"},"dist":{"shasum":"9bc24d49be18ac84e0061ded7f804569979f8971","tarball":"https://registry.npmjs.org/@buzzr/dfs-engine-espn/-/dfs-engine-espn-0.1.0.tgz","fileCount":9,"integrity":"sha512-jqO8Eyd7x/5AD2eWLu2HXLd7l/nS8j6c6x++eBS2ckF3DXyVr5y8aFN/j+HurjvofF7IKKCtWiF6UH2SkWRifg==","signatures":[{"sig":"MEUCIQDbgUVRqh6VewhfH38dJkJLZcFiVN5tYLhb3rlUrSTr2gIgG/Lg1EAz7TlFE6mcFEeeTgvqNZB1hOHPRvGnzpIskco=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":151918},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"a328d53febaebc0d6113ac38e5ba165a05c0a486","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run typecheck && npm test && npm run build"},"_npmUser":{"name":"sarveshsea","email":"sarveshjax@gmail.com"},"repository":{"url":"git+https://github.com/sarveshsea/dfs-engine-espn.git","type":"git"},"_npmVersion":"10.9.2","description":"ESPN gamelog/boxscore/injury fetchers adapted for @buzzr/dfs-engine's PlayerGameLogEntryShape. Companion package — depend on this if you want a turnkey data layer.","directories":{},"_nodeVersion":"22.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^2.1.9","typescript":"^5.9.3","@types/node":"^22.19.18","@buzzr/dfs-engine":"^0.2.0"},"peerDependencies":{"@buzzr/dfs-engine":"^0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/dfs-engine-espn_0.1.0_1778464188488_0.4895180534131487","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-05-11T01:49:48.382Z","modified":"2026-06-08T04:21:10.374Z","0.1.0":"2026-05-11T01:49:48.626Z"},"bugs":{"url":"https://github.com/sarveshsea/dfs-engine-espn/issues"},"author":{"name":"Sarvesh Chidambaram"},"license":"MIT","homepage":"https://github.com/sarveshsea/dfs-engine-espn","keywords":["espn","dfs","sports-data","gamelog","boxscore","prizepicks","underdog"],"repository":{"url":"git+https://github.com/sarveshsea/dfs-engine-espn.git","type":"git"},"description":"ESPN gamelog/boxscore/injury fetchers adapted for @buzzr/dfs-engine's PlayerGameLogEntryShape. Companion package — depend on this if you want a turnkey data layer.","maintainers":[{"email":"sarveshjax@gmail.com","name":"sarveshsea"},{"email":"gangisettyrushil@gmail.com","name":"gangisettyrushil8"}],"readme":"# @buzzr/dfs-engine-espn\n\nESPN data adapter for [@buzzr/dfs-engine](https://www.npmjs.com/package/@buzzr/dfs-engine). Fetches gamelogs, boxscores, and injury reports from ESPN's public site API and shapes them into the data structures `dfs-engine` adapters consume.\n\n```bash\nnpm install @buzzr/dfs-engine @buzzr/dfs-engine-espn\n```\n\n## Why a companion package\n\n`@buzzr/dfs-engine` is pure grading + payout math. It accepts a `PlayerGameLogEntryShape` and returns the value to grade against the line. **You're responsible for the data.**\n\nThis package is the \"give me data\" half: fetch from ESPN, convert to the right shape, hand it to dfs-engine. Use it together or substitute your own data source.\n\n## Quickstart\n\n```ts\nimport { fetchPlayerGamelog, gamelogEntryToShape } from '@buzzr/dfs-engine-espn';\nimport { extractStatForProp, matchGameLogEntry } from '@buzzr/dfs-engine';\n\n// Fetch a player's recent gamelog.\nconst entries = await fetchPlayerGamelog('3917376', 'NBA'); // Jayson Tatum\n\n// Pick the entry matching the bet date.\nconst matched = matchGameLogEntry('2026-05-04T20:00:00Z', entries);\nif (!matched) return null;\n\n// Convert to dfs-engine's shape and grade.\nconst shape = gamelogEntryToShape(matched);\nconst points = extractStatForProp('Points', 'NBA', shape, 'prizepicks');\n// → 28\n```\n\n## What's in here\n\n| Module | Function |\n|---|---|\n| `boxscore` | `fetchGameBoxScore(league, eventId)` — per-game stats for live + final games. Returns `BoxScore` with home/away `BoxScoreTeam` blocks. NBA/WNBA/NCAAM/W/NHL coverage. |\n| `gamelog` | `fetchPlayerGamelog(athleteId, league)` — season-level per-game history. NBA/WNBA/NCAAM/W/NFL/MLB/NHL coverage. |\n| `injuries` | `fetchInjuryStatus(athleteId, league)` — current injury status. `isAutoDnpStatus` predicate for \"this leg should auto-DNP.\" |\n| `converter` | `gamelogEntryToShape(entry)` — convert this package's `PlayerGameLogEntry` to dfs-engine's `PlayerGameLogEntryShape`. |\n\n## Custom fetch / timeouts\n\nEvery public fetcher accepts an options bag for `fetch` (override for caching, proxying, or testing) and `timeoutMs`:\n\n```ts\nawait fetchGameBoxScore('NBA', 'event-123', {\n  fetch: myCachedFetch,\n  timeoutMs: 5000,\n});\n```\n\n## Status & limitations\n\n- **NFL / MLB on `fetchGameBoxScore`:** not yet flattened — ESPN's boxscore ships multi-category data (passing / rushing for NFL, batting / pitching for MLB) that this parser doesn't yet collapse correctly. Use `fetchPlayerGamelog` for those leagues meanwhile.\n- **Soccer on gamelog:** not yet implemented; soccer slips currently need a different data source.\n- **ESPN ToS:** Endpoints are public but undocumented. Respect reasonable request volume (~1 req/sec per endpoint empirically safe). Use at your own risk.\n- **Coverage drift:** If ESPN changes a response shape, the parser may silently return null. File an issue with a captured response.\n\n## License\n\nMIT © Sarvesh Chidambaram\n","readmeFilename":"README.md"}