API Reference@pitchkit/data-providers
impect
Impect open-data loader: event data for all 306 Bundesliga 2023/24 matches, with lineups, squads and players.
import { fetchMatchEvents, isGoal, shots } from "@pitchkit/data-providers/impect";
const events = await fetchMatchEvents(122838); // Werder Bremen 0-4 Bayern
const goals = shots(events).filter(isGoal);The same four layers as the other providers: parse* (pure), load* /
fetch* (network), narrowing selectors, and composable predicates. Three
things to know before you plot anything:
- Two coordinate frames.
start.coordinatesare absolute, and teams swap ends at half time.start.adjCoordinatesturn every event so the acting team attacks towards+x; those are the ones lifted tox/y/endX/endY. Plot either with<Pitch type="impect">: metres from the centre spot, y increasing to the left. - The second half's clock starts at 10,000 seconds. Use
matchSecondsfor a match clock andinMatchOrderto sort. - Set pieces aren't
PASSevents, and own goals aren't shots. A corner or throw-in is its own action type with apassobject, so usehasPassfor every ball played. An own goal is anOWN_GOALevent credited to the team that conceded;scorecounts it.
Impect's data is not openly licensed. Their terms allow non-commercial analytical and research use, forbid redistributing or altering the data, and ask for Impect to be credited, with their logo, in anything published. This package ships none of it and fetches from Impect's own repository.
See
https://github.com/ImpectAPI/open-data
Interfaces
- ImpectEvent
- ImpectGameTime
- ImpectIteration
- ImpectLineups
- ImpectLineupSquad
- ImpectLoadOptions
- ImpectLocation
- ImpectMatchSummary
- ImpectPlayer
- ImpectPoint
- ImpectSquad
Type Aliases
Variables
Functions
- byPlayer
- byTeam
- eventsUrl
- fetchIterations
- fetchLineups
- fetchMatches
- fetchMatchEvents
- fetchPlayers
- fetchSquads
- hasEndLocation
- hasLocation
- hasPass
- hasTargetPoint
- indexPlayersById
- indexSquadsById
- inMatchOrder
- inPeriod
- isCorner
- isDirectFreeKick
- isFailed
- isFreeKick
- isGoal
- isHeader
- isOwnGoal
- isPenalty
- isSetPiece
- isSuccessful
- isThrowIn
- iterationsUrl
- lineupsUrl
- loadIterations
- loadLineups
- loadMatches
- loadMatchEvents
- loadPlayers
- loadSquads
- matchesUrl
- matchSeconds
- ofType
- parseEvents
- parseIterations
- parseLineups
- parseMatches
- parsePlayers
- parseSquads
- passes
- playersUrl
- score
- shots
- squadsUrl
References
DataProviderError
Re-exports DataProviderError
DataProviderErrorKind
Re-exports DataProviderErrorKind
LoadOptions
Re-exports LoadOptions