PitchKit
API Reference@pitchkit/data-providerswyscoutFunctions

goalsFor()

function goalsFor(events, teamId): number;

Defined in: packages/data-providers/src/wyscout/select.ts:79

One team's score, as the scoreboard showed it at the end of play.

Goal attempts tagged 101 by teamId, plus own goals (tag 102) by the other side. An own goal is not an attempt: it carries 102 rather than 101, on the event of the player who put it in, usually Others on the ball, and that event's teamId is the side that conceded. Shootout kicks, which are penalties in matchPeriod: "P", are left out.

Zero for a team with no events in the feed, rather than crediting it with every own goal in the match.

Parameters

ParameterType
eventsreadonly WyscoutEvent[]
teamIdnumber

Returns

number

On this page