Match Analytics

The Match Analytics resources lets you access advanced player and team analytics related to events in a football match and derived from basic match data.

Match State

GET /v0/analytics/match/(int: matchID)/state

Returns the state of the match, i.e. the scoreline, at a specific match time. If no match time is passed, the final state of the match is returned.

Query Parameter:

Field Type Description
time string Match time in minutes, form of: <normal-time> {-,|:+}[stoppage-time]

Response Parameters:

Field Type Description
match integer The unique ID of the football match.
home_team integer The unique ID of the home team.
away_team integer The unique ID of the away team.
time_mins integer Time of match state, in minutes of match time.
stoppage_mins integer Stoppage time of match state, in minutes of match time.
is_fulltime boolean The unique ID of the team credited with the goal.
home_goals integer Number of goals scored by home team.
away_goals integer Number of goals scored by away team.

Link Parameters:

Field URL Description
match Match Information representation.
home_team Home Teams resource representation.
away_team Away Teams resource representation.

Example #1:

Return the match state midway through the second half.

GET /v0/analytics/match/1000075/state?time=67 HTTP/1.1
Host: api-summary.soccermetrics.net
Accept: application/json
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Sat, 22 Feb 2014 05:28:27 GMT
Server: gunicorn/0.15.0
Content-Length: 368
Connection: close

{
  "meta": {},
  "attribution": {
      "html": "<a href=\"http://www.soccermetrics.net\"><img src=\"http://soccermetrics-mcfc.s3.amazonaws.com/logo/soccermetrics_logo.png\"/></a>",
      "source": {
        "html": "<a href=\"http://www.optasports.com\"><img src=\"http://soccermetrics-mcfc.s3.amazonaws.com/logo/opta_logo.png\"/></a>"
        "logo": "http://soccermetrics-mcfc.s3.amazonaws.com/logo/opta_logo.png",
        "url": "http://www.optasports.com",
        "name": "Opta Sports"
      },
      "text": "Powered by Soccermetrics Research",
      "url": "http://www.soccermetrics.net",
      "logo": "http://soccermetrics-mcfc.s3.amazonaws.com/logo/soccermetrics_logo.png"
  },
  "result": {
    "home_team": 10012,
    "away_team": 10002,
    "is_fulltime": false,
    "stoppage_mins": 0,
    "link": {
      "home_team": "/v0/teams/10012",
      "away_team": "/v0/teams/10002",
      "match": "/v0/matches/1000075/info"
    },
    "away_goals": 1,
    "time_mins": 67,
    "home_goals": 1,
    "match": 1000075
  }
}

Example #2:

The match state deep into stoppage time of the second half.

GET /v0/analytics/match/1000373/state?time=90:2 HTTP/1.1
Host: api-summary.soccermetrics.net
Accept: application/json
HTTP/1.1 200 OK
Server: gunicorn/0.15.0
Date: Sat, 22 Feb 2014 05:42:37 GMT
Connection: close
Content-Type: application/json
Content-Length: 367
Access-Control-Allow-Origin: *

{
  "meta": {},
  "attribution": {
      "html": "<a href=\"http://www.soccermetrics.net\"><img src=\"http://soccermetrics-mcfc.s3.amazonaws.com/logo/soccermetrics_logo.png\"/></a>",
      "source": {
        "html": "<a href=\"http://www.optasports.com\"><img src=\"http://soccermetrics-mcfc.s3.amazonaws.com/logo/opta_logo.png\"/></a>"
        "logo": "http://soccermetrics-mcfc.s3.amazonaws.com/logo/opta_logo.png",
        "url": "http://www.optasports.com",
        "name": "Opta Sports"
      },
      "text": "Powered by Soccermetrics Research",
      "url": "http://www.soccermetrics.net",
      "logo": "http://soccermetrics-mcfc.s3.amazonaws.com/logo/soccermetrics_logo.png"
  },
  "result": {
    "home_team": 10008,
    "away_team": 10012,
    "is_fulltime": false,
    "stoppage_mins": 2,
    "link": {
      "home_team": "/v0/teams/10008",
      "away_team": "/v0/teams/10012",
      "match": "/v0/matches/1000373/info"
    },
    "away_goals": 2,
    "time_mins": 90,
    "home_goals": 1,
    "match": 1000373
  }
}

Example #3:

The full-time match state.

GET /v0/analytics/match/1000373/state HTTP/1.1
Host: api-summary.soccermetrics.net
Accept: application/json
HTTP/1.1 200 OK
Server: gunicorn/0.15.0
Date: Sat, 22 Feb 2014 05:44:52 GMT
Connection: close
Content-Type: application/json
Content-Length: 367
Access-Control-Allow-Origin: *

{
  "meta": {},
  "attribution": {
      "html": "<a href=\"http://www.soccermetrics.net\"><img src=\"http://soccermetrics-mcfc.s3.amazonaws.com/logo/soccermetrics_logo.png\"/></a>",
      "source": {
        "html": "<a href=\"http://www.optasports.com\"><img src=\"http://soccermetrics-mcfc.s3.amazonaws.com/logo/opta_logo.png\"/></a>"
        "logo": "http://soccermetrics-mcfc.s3.amazonaws.com/logo/opta_logo.png",
        "url": "http://www.optasports.com",
        "name": "Opta Sports"
      },
      "text": "Powered by Soccermetrics Research",
      "url": "http://www.soccermetrics.net",
      "logo": "http://soccermetrics-mcfc.s3.amazonaws.com/logo/soccermetrics_logo.png"
  },
  "result": {
    "home_team": 10008,
    "away_team": 10012,
    "is_fulltime": true,
    "stoppage_mins": 15,
    "link": {
      "home_team": "/v0/teams/10008",
      "away_team": "/v0/teams/10012",
      "match": "/v0/matches/1000373/info"
    },
    "away_goals": 2,
    "time_mins": 90,
    "home_goals": 3,
    "match": 1000373
  }
}
OPTIONS /v0/analytics/match/state

Returns documentation of the match state resource.

Match Segment

GET /v0/analytics/match/(int: matchID)/segment

Returns all segments of a match, which are defined at periods of play in which the players on the pitch are unchanged. Segments contain identification codes of the players on the pitch and players who had been sent off, and are separated by substitution and expulsion events.

The primary intent of the segment is to build adjusted plus/minus models, but there are other applications as well.

Query Parameter:

None

Response Parameters:

Field Type Description
start_time_mins integer Match time at start of segment.
start_stoppage_mins integer Stoppage time at start of segment.
duration integer Duration of segment in minutes.
home_goals integer Number of goals scored by home team during segment.
away_goals integer Number of goals scored by away team during segment.
home_players_on integer Unique IDs of home team players on pitch during segment.
away_players_on integer Unique IDs of away team players on pitch during segment.
home_players_expelled integer Unique IDs of home team players ejected in match, including segment.
away_players_expelled integer Unique IDs of away team players ejected in match, including segment.

Example:

Retrieve all the segments for a match (Manchester City vs Queens Park Rangers in 2011-12).

GET /v0/analytics/match/1000373/segment HTTP/1.1
Host: api-summary.soccermetrics.net
Accept: application/json
HTTP/1.1 200 OK
Server: gunicorn/0.15.0
Date: Sat, 22 Feb 2014 06:38:52 GMT
Connection: close
Content-Type: application/json
Content-Length: 4838
Access-Control-Allow-Origin: *

{
  "meta": {},
  "attribution": {
      "html": "<a href=\"http://www.soccermetrics.net\"><img src=\"http://soccermetrics-mcfc.s3.amazonaws.com/logo/soccermetrics_logo.png\"/></a>",
      "source": {
        "html": "<a href=\"http://www.optasports.com\"><img src=\"http://soccermetrics-mcfc.s3.amazonaws.com/logo/opta_logo.png\"/></a>"
        "logo": "http://soccermetrics-mcfc.s3.amazonaws.com/logo/opta_logo.png",
        "url": "http://www.optasports.com",
        "name": "Opta Sports"
      },
      "text": "Powered by Soccermetrics Research",
      "url": "http://www.soccermetrics.net",
      "logo": "http://soccermetrics-mcfc.s3.amazonaws.com/logo/soccermetrics_logo.png"
  },
  "result": [
    {
      "away_players_expelled": [],
      "home_goals": 1,
      "away_players_on": [
        1000034,
        1000357,
        1000301,
        1000269,
        1000113,
        1000083,
        1000501,
        1000152,
        1000218,
        1000508,
        1000453
      ],
      "home_players_expelled": [],
      "away_goals": 0,
      "home_players_on": [
        1000033,
        1000290,
        1000507,
        1000008,
        1000522,
        1000427,
        1000205,
        1000468,
        1000278,
        1000503,
        1000347
      ],
      "start_time_mins": 0,
      "start_stoppage_mins": 0,
      "duration": 44
    },
    {
      "away_players_expelled": [],
      "home_goals": 0,
      "away_players_on": [
        1000034,
        1000357,
        1000301,
        1000269,
        1000113,
        1000083,
        1000501,
        1000152,
        1000218,
        1000508,
        1000453
      ],
      "home_players_expelled": [],
      "away_goals": 1,
      "home_players_on": [
        1000033,
        1000290,
        1000507,
        1000008,
        1000522,
        1000427,
        1000205,
        1000468,
        1000278,
        1000503,
        1000347
      ],
      "start_time_mins": 44,
      "start_stoppage_mins": 0,
      "duration": 10
    },
    {
      "away_players_expelled": [],
      "home_goals": 0,
      "away_players_on": [
        1000034,
        1000357,
        1000301,
        1000269,
        1000113,
        1000083,
        1000501,
        1000152,
        1000218,
        1000508,
        1000453
      ],
      "home_players_expelled": [],
      "away_goals": 0,
      "home_players_on": [
        1000033,
        1000290,
        1000507,
        1000008,
        1000522,
        1000427,
        1000205,
        1000468,
        1000278,
        1000347,
        1000510
      ],
      "start_time_mins": 55,
      "start_stoppage_mins": 0,
      "duration": 4
    },
    {
      "away_players_expelled": [
        1000034
      ],
      "home_goals": 0,
      "away_players_on": [
        1000357,
        1000301,
        1000269,
        1000113,
        1000083,
        1000501,
        1000152,
        1000218,
        1000508,
        1000453
      ],
      "home_players_expelled": [],
      "away_goals": 1,
      "home_players_on": [
        1000033,
        1000290,
        1000507,
        1000008,
        1000522,
        1000427,
        1000205,
        1000468,
        1000278,
        1000347,
        1000510
      ],
      "start_time_mins": 59,
      "start_stoppage_mins": 0,
      "duration": 10
    },
    {
      "away_players_expelled": [
        1000034
      ],
      "home_goals": 0,
      "away_players_on": [
        1000357,
        1000301,
        1000462,
        1000269,
        1000113,
        1000501,
        1000152,
        1000218,
        1000508,
        1000453
      ],
      "home_players_expelled": [],
      "away_goals": 0,
      "home_players_on": [
        1000033,
        1000290,
        1000507,
        1000008,
        1000522,
        1000427,
        1000205,
        1000468,
        1000278,
        1000347,
        1000510
      ],
      "start_time_mins": 69,
      "start_stoppage_mins": 0,
      "duration": 6
    },
    {
      "away_players_expelled": [
        1000034
      ],
      "home_goals": 0,
      "away_players_on": [
        1000357,
        1000301,
        1000462,
        1000269,
        1000113,
        1000501,
        1000152,
        1000218,
        1000508,
        1000453
      ],
      "home_players_expelled": [],
      "away_goals": 0,
      "home_players_on": [
        1000290,
        1000507,
        1000135,
        1000008,
        1000522,
        1000427,
        1000205,
        1000468,
        1000278,
        1000347,
        1000510
      ],
      "start_time_mins": 75,
      "start_stoppage_mins": 0,
      "duration": 1
    },
    {
      "away_players_expelled": [
        1000034
      ],
      "home_goals": 2,
      "away_players_on": [
        1000357,
        1000301,
        1000462,
        1000269,
        1000113,
        1000501,
        1000152,
        1000218,
        1000508,
        1000453
      ],
      "home_players_expelled": [],
      "away_goals": 0,
      "home_players_on": [
        1000290,
        1000507,
        1000135,
        1000008,
        1000522,
        1000427,
        1000205,
        1000278,
        1000347,
        1000028,
        1000510
      ],
      "start_time_mins": 76,
      "start_stoppage_mins": 0,
      "duration": 19
    }
  ]
}
OPTIONS /v0/analytics/match/segment

Returns documentation of the match segment resource.

Total Shot Ratio (Match)

GET /v0/analytics/match/(int: matchID)/tsr

Returns the Total Shot Ratio (TSR) statistic of the two teams competing in the football match, which is the ratio of all shots taken by a team to the total number of shots taken by both teams.

Query Parameter:

None

Response Parameters:

Field Type Description
match integer The unique ID of the football match.
home_team integer The unique ID of the home team.
away_team integer The unique ID of the away team.
home_team_name string The name of the home team.
away_team_name string The name of the away team.
home_team_tsr float The Total Shot Ratio of the home team.
away_team_tsr float The Total Shot Ratio of the away team.

Link Parameters:

Field URL Description
match Match Information representation.
home_team Home Teams resource representation.
away_team Away Teams resource representation.

Example #1:

Return the TSR of both teams in a match.

GET /v0/analytics/match/1000013/tsr HTTP/1.1
Host: api-summary.soccermetrics.net
Accept: application/json
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Wed, 02 Apr 2014 03:22:23 GMT
Server: ngx_openresty/1.2.8.6
Content-Length: 449
Connection: keep-alive

{
  "meta": {},
  "attribution": {
      "html": "<a href=\"http://www.soccermetrics.net\"><img src=\"http://soccermetrics-mcfc.s3.amazonaws.com/logo/soccermetrics_logo.png\"/></a>",
      "source": {
        "html": "<a href=\"http://www.optasports.com\"><img src=\"http://soccermetrics-mcfc.s3.amazonaws.com/logo/opta_logo.png\"/></a>"
        "logo": "http://soccermetrics-mcfc.s3.amazonaws.com/logo/opta_logo.png",
        "url": "http://www.optasports.com",
        "name": "Opta Sports"
      },
      "text": "Powered by Soccermetrics Research",
      "url": "http://www.soccermetrics.net",
      "logo": "http://soccermetrics-mcfc.s3.amazonaws.com/logo/soccermetrics_logo.png"
  },
  "result": [
    {
      "away_team": 10010,
      "match": 1000013,
      "home_team_tsr": 0.4787234042553192,
      "home_team": 10014,
      "home_team_name": "Sunderland",
      "away_team_tsr": 0.5212765957446809,
      "away_team_name": "Newcastle United",
      "link": {
        "away_team": "/v0/teams/10010",
        "home_team": "/v0/teams/10014",
        "match": "/v0/matches/1000013/info"
      }
    }
  ]
}
OPTIONS /v0/analytics/match/tsr

Returns documentation of the match Total Shot Ratio resource.