League Table API Follow
League Table API
This API triggers the calculation of the league table and then returns ;
- A list of the column headings
- For each position, a list of the values by column
- The text to appear in the key at the bottom as a single string in the same manner as the Play-Cricket Table
GET http://play-cricket.com/api/v2/league_table.json?division_id=1234&api_token=xxxxxx Parameters.
api_token : | string | required |
division_id: | Int | required |
The division_id is a unique identifier for the league table. Note each season the division_id changes each season so that an archive of tables for all season can be kept.
An example league table for division_id 110530 is:
The JSON returned relating to this table is
{
"league_table": [
{
"id": 110530,
"name": "Premier Division",
"headings": {
"column_1": "Team",
"column_2": "p",
"column_3": "w24",
"column_4": "w20",
"column_5": "wd",
"column_6": "wd",
"column_7": "ld",
"column_8": "t",
"column_9": "l",
"column_10": "a",
"column_11": "BatP",
"column_12": "BowlP",
"column_13": "Pen",
"column_14": "Pts"
},
"values": [
{
"position": "1",
"team_id": "121996",
"column_1": "Olton & West Warwicks CC",
"column_2": "22",
"column_3": "5",
"column_4": "8",
"column_5": "1",
"column_6": "0",
"column_7": "0",
"column_8": "0",
"column_9": "5",
"column_10": "3",
"column_11": "15",
"column_12": "20",
"column_13": "6",
"column_14": "331"
},
{
"position": "2",
"team_id": "68347",
"column_1": "Attock CC, Warwicks",
"column_2": "22",
"column_3": "3",
"column_4": "8",
"column_5": "2",
"column_6": "0",
"column_7": "3",
"column_8": "0",
"column_9": "2",
"column_10": "4",
"column_11": "16",
"column_12": "20",
"column_13": "1",
"column_14": "313"
},
{
"position": "3",
"team_id": "29315",
"column_1": "Walmley CC",
"column_2": "22",
"column_3": "3",
"column_4": "5",
"column_5": "0",
"column_6": "3",
"column_7": "1",
"column_8": "0",
"column_9": "6",
"column_10": "4",
"column_11": "26",
"column_12": "27",
"column_13": "0",
"column_14": "275"
},
{
"position": "4",
"team_id": "9073",
"column_1": "Rugby CC",
"column_2": "22",
"column_3": "3",
"column_4": "5",
"column_5": "2",
"column_6": "1",
"column_7": "0",
"column_8": "0",
"column_9": "5",
"column_10": "6",
"column_11": "23",
"column_12": "25",
"column_13": "7",
"column_14": "267"
},
{
"position": "5",
"team_id": "44631",
"column_1": "Aston Manor CC",
"column_2": "22",
"column_3": "3",
"column_4": "5",
"column_5": "1",
"column_6": "0",
"column_7": "1",
"column_8": "0",
"column_9": "7",
"column_10": "5",
"column_11": "22",
"column_12": "25",
"column_13": "0",
"column_14": "253"
},
{
"position": "6",
"team_id": "27700",
"column_1": "Stratford-upon-Avon CC",
"column_2": "22",
"column_3": "1",
"column_4": "7",
"column_5": "1",
"column_6": "0",
"column_7": "2",
"column_8": "1",
"column_9": "5",
"column_10": "5",
"column_11": "17",
"column_12": "27",
"column_13": "0",
"column_14": "252"
},
{
"position": "7",
"team_id": "33573",
"column_1": "Solihull Blossomfield CC",
"column_2": "22",
"column_3": "3",
"column_4": "6",
"column_5": "0",
"column_6": "0",
"column_7": "0",
"column_8": "0",
"column_9": "8",
"column_10": "5",
"column_11": "3",
"column_12": "24",
"column_13": "0",
"column_14": "239"
},
{
"position": "8",
"team_id": "11558",
"column_1": "Bedworth CC",
"column_2": "22",
"column_3": "3",
"column_4": "3",
"column_5": "0",
"column_6": "0",
"column_7": "2",
"column_8": "1",
"column_9": "9",
"column_10": "4",
"column_11": "27",
"column_12": "32",
"column_13": "0",
"column_14": "225"
},
{
"position": "9",
"team_id": "145317",
"column_1": "Streetly CC",
"column_2": "22",
"column_3": "3",
"column_4": "4",
"column_5": "0",
"column_6": "0",
"column_7": "1",
"column_8": "0",
"column_9": "8",
"column_10": "6",
"column_11": "10",
"column_12": "31",
"column_13": "2",
"column_14": "217"
},
{
"position": "10",
"team_id": "65134",
"column_1": "Handsworth CC, Warks",
"column_2": "22",
"column_3": "1",
"column_4": "5",
"column_5": "0",
"column_6": "1",
"column_7": "1",
"column_8": "0",
"column_9": "9",
"column_10": "5",
"column_11": "20",
"column_12": "30",
"column_13": "0",
"column_14": "206"
},
{
"position": "11",
"team_id": "67451",
"column_1": "Solihull Municipal CC",
"column_2": "22",
"column_3": "1",
"column_4": "4",
"column_5": "0",
"column_6": "0",
"column_7": "2",
"column_8": "0",
"column_9": "11",
"column_10": "4",
"column_11": "14",
"column_12": "32",
"column_13": "0",
"column_14": "172"
},
{
"position": "12",
"team_id": "234",
"column_1": "Sutton Coldfield CC",
"column_2": "22",
"column_3": "0",
"column_4": "1",
"column_5": "0",
"column_6": "1",
"column_7": "0",
"column_8": "0",
"column_9": "15",
"column_10": "5",
"column_11": "35",
"column_12": "39",
"column_13": "23",
"column_14": "101"
}
],
"key": "p - Played, w24 - Win 24pts (24), w20 - Win 20pts (20), wd - Winning draw >= 75% (10), wd - Winning draw < 75% (10), ld - Losing Draw, t - Tied (10), l - Loss, a - Abandoned (4), BatP - Batting Bonus Points, BowlP - Bowling Bonus Points, Pen - Penalty Points, Pts - Points"
}
The table Headings are returned as a ‘headings’ array.
For each team the values associated with those headings are returned as sub arrays under values, and these are presented in position order with the team’s name and the internal Play-Cricket Team ID.
The final array is the key to the table short codes in the column headings.
The table above within competition management has bee set up with aggregated results, for instance there are 2 types of win and the losses column for these are combined into 1 column for display. The API returns the equivalent of what is shown on the screen not the unaggregated columns.