Skip to main content

Support Site File Replacement Functions

The API Support packages contain functions to produce API-sourced equivalents of the Champion Data Support site files (Match Summary file and the Match Transaction file). The intention behind these functions is to provide a convenient means of switching over to the API sourced data without having to change the reports, dashboards and processes to match a new format and structure.

  • getPlayerSummaryFile
  • getSquadSummaryFile
  • getAflClubTrxFeed

That said, while every effort has been made to reproduce the support site files exactly, some changes were necessary due to how the AFL API has evolved. This article describes the differences you should expect and cater for in your own downstream applications.

Match Summary File​

The getPlayerSummaryFile and getSquadSummaryFile Function in the R Package replicates the advanced summary files available on the support site for AFLM, using the AFL API as the data source. Both functions make 2 + n API calls, where 'n' is the number of periods in the match (so 12 calls for a completed regular match).

note

These functions are only available for AFL Premiership matches.

As some of the metric columns do not apply to AFLW matches, you cannot generate an AFLW summary file.

Centre Bounce metrics​

While the functions aim to replicate the support site files, we have not replicated the rezoning of β€˜centre bounce’ zoned metrics to the defensive midfield zone. There are 19 metric columns across the both files that can be assigned to the β€˜CB’ zone that were previously re-zoned to be shown in the defensive midfield zone. We have instead transferred these metrics that took place at centre bounce to the 'X' zone.

note

An example of this were that centre bounces were counted in the the defensive midfield in the STOPPAGE metric.

These are metrics affected by the zone change:

Summary File ColumnAPI Metric
CHAIN_METRESCHAIN_METRES
CHAIN_METRES_NETCHAIN_METRES_NET
CHAIN_METRES_NET_STCHAIN_METRES_NET_ST
CHAIN_METRES_REPLYCHAIN_METRES_REPLY
CHAIN_METRES_REPLY_STCHAIN_METRES_REPLY_ST
CHAIN_METRES_STCHAIN_METRES_ST
FIRST_POSSESSION_TO_CLEARFIRST_POSSESSION_CLEARANCE
FIRST_POSSESSIONFIRST_POSSESSION
CLEARANCECLEARANCE
STOPPAGESTOPPAGE
HITOUTHITOUT
HIT_OUT_SHARKEDHITOUT_SHARKED
HIT_OUT_SHARKHITOUT_SHARK
HIT_OUT_TO_ADVANTAGEHITOUT_TO_ADVANTAGE
ST_SCORE_LAUNCHCHAIN_LAUNCH_ST_SCORE
ST_BEHIND_LAUNCHCHAIN_LAUNCH_ST_BEHI
ST_GOAL_LAUNCHCHAIN_LAUNCH_ST_GOAL
RATING_HITOUTSPLAYER_RATING_HITOUT
RANKING_PTSRANKING_POINTS

General differences​

There will still be some metric discrepancies between the numbers returned from the functions and the numbers in the original files. They will likely fall into the following categories:

  • Metric definition update (eg updated, consistent definition of retention in the API)

  • Rounding differences (eg: Metres Gained)

  • Point in time differences (Summary File extracted before/after edits)

  • Other differences (please let us know - to be fixed or to be explained case by case)

Match Transaction File​

Some of the differences below are a result of using the API's match transactions endpoint as the data source, and while it does work from the same source as the support site file, the endpoint has some intentional distinctions that are reflected in this function.

note

Because the transaction file is generated from the API's match transactions endpoint, the getAflClubTrxFeed function therefore requires that your account is licensed to use transactions.

Breaking Change - FIXED_ID vs MATCH_ID​

In the implementation of the getAflClubTrxFeed function, FIXED_ID is now called MATCH_ID. There are no uses of FIXED_ID in the AFL API, which is why that the transition has been made.

NOP​

The STATISTIC_CODEs that previously had reference to the match possession state (ie GEHAN, GEHAO,GEHAP) no longer have this reference to N/O/P. This will result in a smaller subset of possible STATISTIC_CODEs (ie GEHA).

FINAL_STATE = EOQ​

FINAL_STATE for the chains that end in a End of Quarter now return EOQ, rather than returning a blank value.

TRUEX, TRUEY, STDY, STDX rounding differences​

There are small rounding differences between the original TRX Files and the getAflClubTrxFeed function. These are known and the getAflClubTrxFeed should be considered the source of truth for these.

Pressure Player on two-player stats​

The getAflClubTrxFeed function no longer returns duplicate records for the a pressure on a two-player stat. The pressure message will only appear once, on the appropriate record.

Triple Centre Bounce transactions​

The getAflClubTrxFeed function does not include erroneous third centre bounce transactions including umpire PERSON_ID.

50m Penalties​

The getAflClubTrxFeed function will no longer return the umpire on the 50m Penalty. GO50P (Goal from 50M Penalty) will also no longer be returned. Goal with Parameter PENALTY_50M will be how to find Goals from 50M penalty sources.

Kick In XY Locations​

The getAflClubTrxFeed function no longer plots the Kick In Location as the XY coordinates of the result of the kick in, rather plots the location as the top of the goal square.

Pre-Clearance turnover chains​

The getAflClubTrxFeed function assigns the zone of the stoppage to chains that start from a pre-clearance turnover, rather than the physical location of the chain start. For example, the initial zone of a pre-clearance turnover chain from a centre bounce will be β€˜CB’ always.