{"_id":"@alex-kaffetzakis/espn-api","_rev":"2-727ef25df43369f4be1ae7554fcd40eb","name":"@alex-kaffetzakis/espn-api","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@alex-kaffetzakis/espn-api","version":"0.1.0","keywords":["espn","espn-api","sports","scoreboard","nfl","nba","mlb","nhl","typescript"],"author":{"name":"Alex Kaffetzakis"},"license":"MIT","_id":"@alex-kaffetzakis/espn-api@0.1.0","maintainers":[{"name":"alex-kaffetzakis","email":"alex@kaffetzakis.com"}],"homepage":"https://github.com/Alex-Kaff/espn-api#readme","bugs":{"url":"https://github.com/Alex-Kaff/espn-api/issues"},"dist":{"shasum":"8182a6abd3be0e197e07a79c360c9ea1d661ffbd","tarball":"https://registry.npmjs.org/@alex-kaffetzakis/espn-api/-/espn-api-0.1.0.tgz","fileCount":159,"integrity":"sha512-2LD9MKMl5ihgCPTmhR4PibE28SzciDlZBCOX4ZAuHjqrOPSXcPK4LsvMvnAxct87Fw/2S5bIh++LL4peHZ1S2g==","signatures":[{"sig":"MEYCIQDHnbunMIS33arwR2lFvh3aQz4NX8oD5LLyXJeFW0HAggIhAImDkapzP3LJWJIlO42bv2qzpurtW6IW5taHgIlI+mGn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":268186},"main":"build/index.js","types":"build/dts/index.d.ts","exports":{".":{"types":"./build/dts/index.d.ts","default":"./build/index.js"}},"gitHead":"a1deb461b3d9b1cd6e80519cba5c788d52a1f928","scripts":{"docs":"rm -rf docs && typedoc --options typedoc.json --basePath /espn-api/","lint":"eslint .","test":"jest . --coverage","build":"tsc","clean":"rm -rf build","prebuild":"npm run clean","format:fix":"prettier --write .","format:check":"prettier . --check","prepublishOnly":"npm run lint && npm test && npm run build"},"_npmUser":{"name":"alex-kaffetzakis","email":"alex@kaffetzakis.com"},"repository":{"url":"git+https://github.com/Alex-Kaff/espn-api.git","type":"git"},"_npmVersion":"10.9.2","description":"TypeScript client for ESPN's public API (site, core, web, cdn, now, fantasy).","directories":{},"_nodeVersion":"23.5.0","dependencies":{"axios":"^1.15.0","luxon":"3.7.2"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.6","jest":"30.2.0","eslint":"9.37.0","ts-jest":"29.4.5","ts-node":"10.9.2","typedoc":"0.28.14","prettier":"3.6.2","@eslint/js":"9.37.0","typescript":"5.9.3","@types/jest":"30.0.0","@types/node":"24.7.1","@types/luxon":"3.7.1","typedoc-material-theme":"^1.4.0","@typescript-eslint/parser":"8.46.0","@typescript-eslint/eslint-plugin":"8.46.0"},"_npmOperationalInternal":{"tmp":"tmp/espn-api_0.1.0_1776436712872_0.15004303888826565","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@alex-kaffetzakis/espn-api","version":"0.2.0","description":"TypeScript client for ESPN's public API (site, core, web, cdn, now, fantasy).","keywords":["espn","espn-api","sports","scoreboard","nfl","nba","mlb","nhl","typescript"],"author":{"name":"Alex Kaffetzakis"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Alex-Kaff/espn-api.git"},"bugs":{"url":"https://github.com/Alex-Kaff/espn-api/issues"},"homepage":"https://github.com/Alex-Kaff/espn-api#readme","main":"build/index.js","types":"build/dts/index.d.ts","exports":{".":{"types":"./build/dts/index.d.ts","default":"./build/index.js"}},"scripts":{"build":"tsc","clean":"rm -rf build","prebuild":"npm run clean","docs":"rm -rf docs && typedoc --options typedoc.json --basePath /espn-api/","format:check":"prettier . --check","format:fix":"prettier --write .","lint":"eslint .","test":"jest . --coverage","prepublishOnly":"npm run lint && npm test && npm run build"},"dependencies":{"axios":"^1.15.0","luxon":"3.7.2"},"devDependencies":{"@eslint/js":"9.37.0","@types/jest":"30.0.0","@types/luxon":"3.7.1","@types/node":"24.7.1","@typescript-eslint/eslint-plugin":"8.46.0","@typescript-eslint/parser":"8.46.0","eslint":"9.37.0","jest":"30.2.0","prettier":"3.6.2","ts-jest":"29.4.5","ts-node":"10.9.2","typedoc":"0.28.14","typedoc-material-theme":"^1.4.0","typescript":"5.9.3","zod":"^4.3.6"},"_id":"@alex-kaffetzakis/espn-api@0.2.0","gitHead":"504e7aa92253d85625336c0585c89b3a18938d5e","_nodeVersion":"23.5.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-u9U0w7MdMWR+cPo5RvxUNP+JgBpaIOfwHPVcCfcZm0B/jE/kJVPQYvlftq7D7Ahr7iHZJHkh3O+yT9CsS6ptfw==","shasum":"e91b4a949556d7e5ac2a1c78bbd5a39bd0014379","tarball":"https://registry.npmjs.org/@alex-kaffetzakis/espn-api/-/espn-api-0.2.0.tgz","fileCount":159,"unpackedSize":338864,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIELTt662FR6fG6kg6WDEEI0ZPLPAh7Ivha+TB2WeqxTJAiEAm+1m5mAHit+R8/1Y4vfokzHLsfViwLvdKXSumvsGIdo="}]},"_npmUser":{"name":"alex-kaffetzakis","email":"alex@kaffetzakis.com"},"directories":{},"maintainers":[{"name":"alex-kaffetzakis","email":"alex@kaffetzakis.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/espn-api_0.2.0_1776684346372_0.522155616642858"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-17T14:38:32.755Z","modified":"2026-04-20T11:25:46.632Z","0.1.0":"2026-04-17T14:38:33.035Z","0.2.0":"2026-04-20T11:25:46.503Z"},"bugs":{"url":"https://github.com/Alex-Kaff/espn-api/issues"},"author":{"name":"Alex Kaffetzakis"},"license":"MIT","homepage":"https://github.com/Alex-Kaff/espn-api#readme","keywords":["espn","espn-api","sports","scoreboard","nfl","nba","mlb","nhl","typescript"],"repository":{"type":"git","url":"git+https://github.com/Alex-Kaff/espn-api.git"},"description":"TypeScript client for ESPN's public API (site, core, web, cdn, now, fantasy).","maintainers":[{"name":"alex-kaffetzakis","email":"alex@kaffetzakis.com"}],"readme":"# @alex-kaffetzakis/espn-api\n\nA TypeScript client for ESPN's public API.\n\n> **Fork notice:** This is a fork of [mikelaferriere/espn-api](https://github.com/mikelaferriere/espn-api), significantly expanded to cover additional ESPN domains (site, core, web, cdn, now, fantasy) with a shared HTTP client, typed errors, and exhaustive types. Published independently on npm as [`@alex-kaffetzakis/espn-api`](https://www.npmjs.com/package/@alex-kaffetzakis/espn-api).\n\n## Install\n\n```bash\nnpm install @alex-kaffetzakis/espn-api\n```\n\n## Quick start\n\n```ts\nimport { Scoreboard, Summary, League } from '@alex-kaffetzakis/espn-api'\n\nconst scoreboard = await Scoreboard.fetch(League.NFL)\nconst summary = await Summary.fetch(League.NFL, scoreboard.events[0].id)\n```\n\n## Configuring the client\n\nAll endpoints share a default HTTP client. You can configure timeouts and retries, or swap in your own Axios instance:\n\n```ts\nimport { setDefaultClient, EspnClient } from '@alex-kaffetzakis/espn-api'\n\nsetDefaultClient(new EspnClient({ timeout: 15_000, retries: 3 }))\n```\n\n## Bring your own HTTP client\n\nEvery endpoint ships a pure URL builder alongside its `fetch*` helper. Use it when you'd rather hand URLs to your own HTTP client (fetch, got, undici, etc.) instead of the bundled axios transport:\n\n```ts\nimport { LeagueData, BASE_URLS, League } from '@alex-kaffetzakis/espn-api'\n\nconst { domain, path } = LeagueData.injuriesUrl(League.NBA)\nconst data = await myClient.get(`${BASE_URLS[domain]}/${path}`)\n```\n\nURL builders are pure — they take the same arguments as the matching `fetch*` helper (minus the client) and return `{ domain, path, params? }`. `BASE_URLS` maps each `domain` to its base URL.\n\nEvery `fetch*` helper also accepts an optional `EspnClient` as its last argument, so you can route specific calls through a custom-configured client without replacing the default:\n\n```ts\nimport { Scoreboard, EspnClient, League } from '@alex-kaffetzakis/espn-api'\n\nconst custom = new EspnClient({ timeout: 5_000 })\nconst sb = await Scoreboard.fetch(League.NFL, undefined, custom)\n```\n\n## Error handling\n\n```ts\nimport {\n  Summary,\n  League,\n  EspnNotFoundError,\n  EspnRateLimitError,\n  EspnApiError,\n} from '@alex-kaffetzakis/espn-api'\n\ntry {\n  await Summary.fetch(League.NFL, 'bad-event-id')\n} catch (err) {\n  if (err instanceof EspnNotFoundError) {\n    // 404\n  } else if (err instanceof EspnRateLimitError) {\n    // 429\n  } else if (err instanceof EspnApiError) {\n    // other HTTP / network errors\n  }\n}\n```\n\n## Covered APIs\n\n- **Site v2** — scoreboard, summary, teams, league, athletes\n- **Core v2/v3** — events, athletes, metadata, college, bracketology\n- **Web** — search\n- **CDN** — games\n- **Now** — news\n- **Fantasy** — league\n\nSee `lib/index.ts` for the full list of exports.\n\n## Development\n\n```bash\nnpm install\nnpm run build\nnpm test\n```\n\nLive integration tests (off by default) hit the real ESPN API:\n\n```bash\nESPN_INTEGRATION=true npm test\n```\n\n## Publishing (maintainer)\n\nReleases are cut manually from a clean working tree.\n\n```bash\n# 1. Bump the version and CHANGELOG.md, commit\nnpm version <patch|minor|major>   # creates the commit + tag\n\n# 2. Log in to npm (once per machine)\nnpm login\n\n# 3. Publish. prepublishOnly runs lint + tests + build first.\nnpm publish --access public\n\n# 4. Push the commit and tag\ngit push && git push --tags\n```\n\n`prepublishOnly` in `package.json` runs `npm run lint && npm test && npm run build` before the publish goes out, so a broken tree won't ship.\n\n## License\n\nMIT — see [LICENSE.md](./LICENSE.md). Original copyright held by Michael Laferriere; fork modifications by Alex Kaffetzakis.\n\n## Disclaimer\n\nNot affiliated with ESPN. This library wraps ESPN's undocumented public endpoints; please use responsibly and respect ESPN's terms of service.\n","readmeFilename":"README.md"}