API Reference@pitchkit/data-providers
wyscout
Wyscout open-data loader.
The Pappalardo et al. dataset: 1,941 matches of event data across the 2017/18 Spanish, Italian, English, German and French first divisions, plus the 2018 World Cup and Euro 2016. Released under CC BY 4.0.
Four layers, each usable on its own: parse* (pure, no network),
load*/fetch* (network), shots/passes/duels (narrowing selectors)
and the is* predicates (composable filters).
import { fetchMatch, shots, isGoal } from "@pitchkit/data-providers/wyscout";
const match = await fetchMatch(2499841); // Huddersfield v Man City
const goals = shots(match.events).filter(isGoal);Three things about this data are load-bearing and easy to get wrong:
- Coordinates are normalised to the attacking direction.
x: 100is always the goal that event's team is attacking, in both halves — so both teams appear to attack left-to-right and nothing flips at half time. - A shot has no end coordinate. Where it went is in its goal-mouth tag
(
shotGoalZone), not inpositions[1], which is a placeholder. HenceendX/endYare absent on shots rather than wrong. - Everything else is a tag too. Accuracy, assists, cards, body part —
all numeric ids on
event.tags.hasTagand the named predicates are how you read them.
Plot it with <Pitch type="wyscout">, whose grid is this one: 0-100 on both
axes, origin top-left, y downward. Note that is not Opta's grid, which
is y-up from the bottom-left.
Interfaces
- WyscoutArea
- WyscoutCompetition
- WyscoutEvent
- WyscoutLoadOptions
- WyscoutMatch
- WyscoutMatchPlayer
- WyscoutPlayer
- WyscoutPlayerRole
- WyscoutPosition
- WyscoutTag
- WyscoutTeam
Type Aliases
Variables
- WYSCOUT_EVENTS_BASE_URL
- WYSCOUT_GOAL_ZONE_TAGS
- WYSCOUT_REFERENCE_BASE_URL
- WYSCOUT_REFERENCE_FILE_IDS
- WYSCOUT_TAGS
Functions
- byPlayer
- byTeam
- duels
- fetchCompetitions
- fetchMatch
- fetchMatchEvents
- fetchTeams
- fouls
- freeKicks
- hasEndLocation
- hasTag
- indexPlayersById
- inMatchOrder
- isAccurate
- isAssist
- isBlocked
- isClearance
- isCounterAttack
- isDangerousBallLost
- isGoal
- isHeadOrBody
- isInterception
- isKeyPass
- isLeftFoot
- isNotAccurate
- isOpportunity
- isOwnGoal
- isRedCard
- isRightFoot
- isSecondYellowCard
- isSendingOff
- isSlidingTackle
- isThrough
- isYellowCard
- loadCompetitions
- loadMatch
- loadMatchEvents
- loadTeams
- lostDuel
- matchSeconds
- matchUrl
- neutralDuel
- ofType
- parseCompetitions
- parseEvents
- parseMatch
- parseMatchPlayers
- parseTeams
- passes
- referenceUrl
- shotGoalZone
- shots
- squadOf
- teamIds
- wonDuel
References
DataProviderError
Re-exports DataProviderError
DataProviderErrorKind
Re-exports DataProviderErrorKind
LoadOptions
Re-exports LoadOptions