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).
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.
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 Column | API Metric |
---|---|
CHAIN_METRES | CHAIN_METRES |
CHAIN_METRES_NET | CHAIN_METRES_NET |
CHAIN_METRES_NET_ST | CHAIN_METRES_NET_ST |
CHAIN_METRES_REPLY | CHAIN_METRES_REPLY |
CHAIN_METRES_REPLY_ST | CHAIN_METRES_REPLY_ST |
CHAIN_METRES_ST | CHAIN_METRES_ST |
FIRST_POSSESSION_TO_CLEAR | FIRST_POSSESSION_CLEARANCE |
FIRST_POSSESSION | FIRST_POSSESSION |
CLEARANCE | CLEARANCE |
STOPPAGE | STOPPAGE |
HITOUT | HITOUT |
HIT_OUT_SHARKED | HITOUT_SHARKED |
HIT_OUT_SHARK | HITOUT_SHARK |
HIT_OUT_TO_ADVANTAGE | HITOUT_TO_ADVANTAGE |
ST_SCORE_LAUNCH | CHAIN_LAUNCH_ST_SCORE |
ST_BEHIND_LAUNCH | CHAIN_LAUNCH_ST_BEHI |
ST_GOAL_LAUNCH | CHAIN_LAUNCH_ST_GOAL |
RATING_HITOUTS | PLAYER_RATING_HITOUT |
RANKING_PTS | RANKING_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.
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.