events()
returns Event[] Every recognised match event in a canonical shape.
Sportec notes: Passes, shots, fouls, cards, subs, ball-claiming recoveries. Tackles deferred.
Sportec's open DFL feed is XML — the adapter ships both the parser (parseMeta, parseEvents) and the full canonical pipeline on top. Events route through the Opta family under the hood and get rebranded with Sportec's original event IDs so nothing leaks.
fromSportec.shots(metaXml, eventsXml) ShotEvent[] <ShotMap />, your own React view, a server-side
report, or an analysis script.
Sportec publishes an open DFL feed for the Bundesliga as XML. The adapter ships both
the XML parser (parseMeta, parseEvents) and the canonical
pipeline on top — you can hand in raw XML strings or pre-parsed objects.
import { fromSportec } from "@withqwerty/campos-adapters";
const meta = fromSportec.parseMeta(metaXml);
const events = fromSportec.parseEvents(eventXml);
const normalisedEvents = fromSportec.events(meta, events);
const shots = fromSportec.shots(meta, events);
const passes = fromSportec.passes(meta, events);
const lineups = fromSportec.matchLineups(meta); events()
returns Event[] Every recognised match event in a canonical shape.
Sportec notes: Passes, shots, fouls, cards, subs, ball-claiming recoveries. Tackles deferred.
shots()
returns ShotEvent[] Just the shots, ready to plot.
passes()
returns PassEvent[] Pass trajectories with start, end, and result.
matchLineups()
returns MatchLineups Home and away team sheets with starters and bench.
formations()
returns FormationTeamData Kickoff tactical shape for one side.
matchContext()
returns MatchContext Attack direction and period metadata.
Supported cards plot from this adapter with no extra work. Partial cards plot, but read the scope note. Dimmed cards need a surface this provider doesn't ship.
Plot events, shots, passes, and formations directly on the pitch.
Time-series and xG-driven views from shots().
These charts are adapter-independent — they take pre-aggregated inputs.
If you're reading XML from disk or a feed subscription, hand the strings straight to fromSportec.shots(metaXml, eventXml). If you're working from a preprocessing step that already produced SportecMeta and
SportecEvent[] arrays, those pass through unchanged. The parser functions
are exposed for pipelines that need them standalone.
The current adapter ships a real event subset: passes, shots, fouls, cards, substitutions, and ball-claiming recoveries. Tackling taxonomy and several other-ball-action categories remain intentionally deferred until the canonical event vocabulary is ready to represent them faithfully.
Sportec's DFL event model overlaps substantially with Opta's. The adapter
translates Sportec events into the Opta event shape, runs them through
fromOpta, and rebrands outputs with provider: "sportec"
and the original Sportec event IDs — no Opta IDs leak into your data.
The DFL publishes Sportec XML for select matches as open data. Teams and broadcasters with licences receive the full feed. The adapter treats both the same — it reads the XML shape, not the access level.
Concrete credits for the projects that did the underlying research or laid the reference tables we read from.
Provider type-ID → canonical kind mapping, coordinate transformers, and direction-by-period normalisation patterns. Our reference for Opta, StatsBomb, Wyscout, Stats Perform, and Sportec.