Getting StartedΒΆ

You can get started with the FMRD-Summary API by using cURL to view all of the available resources:

$ curl -i -X GET https://api-summary.soccermetrics.net/v0/

You’ll get the following response:

HTTP/1.1 200 OK
Server: gunicorn/0.15.0
Date: Mon, 02 Sep 2013 05:13:01 GMT
Connection: close
Content-Type: application/json
Content-Length: 3204
Access-Control-Allow-Origin: *

{
  "result": {
    "link": {
      "managers": "/v0/managers",
      "venues": "/v0/venues",
      "weather": "/v0/weather",
      "penaltyOutcomes": "/v0/penalty_outcomes",
      "bodyparts": "/v0/bodyparts",
      "surfaces": "/v0/surfaces",
      "competitions": "/v0/competitions",
      "shotevents": "/v0/shotevents",
      "referees": "/v0/referees",
      "persons": "/v0/persons",
      "seasons": "/v0/seasons",
      "confederations": "/v0/confederations",
      "countries": "/v0/countries",
      "fouls": "/v0/fouls",
      "positions": "/v0/positions",
      "teams": "/v0/teams",
      "players": "/v0/players",
      "cards": "/v0/cards",
      "stats": {
        "setpieces": {
          "corners": "/v0/stats/setpieces/corners",
          "freekicks": "/v0/stats/setpieces/freekicks",
          "throwins": "/v0/stats/setpieces/throwins",
          "keyplays": "/v0/stats/setpieces/keyplays"
        },
        "passes": {
          "directions": "/v0/stats/passes/directions",
          "lengths": "/v0/stats/passes/lengths",
          "locations": "/v0/stats/passes/locations",
          "totals": "/v0/stats/passes/totals"
        },
        "touches": {
          "duels": "/v0/stats/touches/duels",
          "locations": "/v0/stats/touches/locations",
          "totals": "/v0/stats/touches/totals"
        },
        "crosses": {
          "corners": "/v0/stats/crosses/corners",
          "totals": "/v0/stats/crosses/totals"
        },
        "fouls": {
          "cards": "/v0/stats/fouls/cards",
          "wins": "/v0/stats/fouls/wins"
        },
        "defense": {
          "goalline": "/v0/stats/defense/goalline",
          "blocks": "/v0/stats/defense/blocks",
          "tackles": "/v0/stats/defense/tackles",
          "actions": "/v0/stats/defense/actions",
          "clearances": "/v0/stats/defense/clearances"
        },
        "goals": {
          "penalties": "/v0/stats/goals/penalties",
          "bodyparts": "/v0/stats/goals/bodyparts",
          "locations": "/v0/stats/goals/locations",
          "assists": "/v0/stats/goals/assists",
          "totals": "/v0/stats/goals/totals"
        },
        "shots": {
          "bodyparts": "/v0/stats/shots/bodyparts",
          "plays": "/v0/stats/shots/plays",
          "locations": "/v0/stats/shots/locations",
          "totals": "/v0/stats/shots/totals"
        },
        "goalkeeper": {
          "actions": "/v0/stats/goalkeeper/actions",
          "saves": "/v0/stats/goalkeeper/saves",
          "goals": "/v0/stats/goalkeeper/goals",
          "shots": "/v0/stats/goalkeeper/shots"
        }
      },
      "personnel": {
        "players": "/v0/personnel/players",
        "managers": "/v0/personnel/managers",
        "referees": "/v0/personnel/referees"
      },
      "events": {
        "offenses": "/v0/events/offenses",
        "penalties": "/v0/events/penalties",
        "goals": "/v0/events/goals",
        "substitutions": "/v0/events/substitutions"
      },
      "matches": {
        "info": "/v0/matches/info",
        "lineups": "/v0/matches/lineups",
        "conditions": "/v0/matches/conditions"
      }
    }
  }
}

When you access the service root, you will receive links to all of the basic resources and those resources grouped by their function in a football match – personnel, match information, match events, and match statistics. From here you can make GET requests to other resources.

Note

A browser-based HTTP client is another great tool for examining API resources with the full range of HTTP methods. We use Postman and the Dev HTTP Client and like both.

Let’s take a look at what kind of data is represented by a resource. For example we make an OPTIONS request to the match information resource:

$ curl -i -X OPTIONS https://api-summary.soccermetrics.net/v0/matches/info
HTTP/1.1 200 OK
Server: gunicorn/0.15.0
Date: Sun, 18 Aug 2013 07:45:57 GMT
Connection: close
Content-Type: application/json
Content-Length: 2117
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,HEAD,OPTIONS

{
  "result": {
    "data": {
      "firsthalfLength": {
        "type": "integer",
        "description": "Length of the first half in minutes."
      },
      "awayManagerName": {
        "type": "string",
        "description": "The full name of the away team manager."
      },
      "seasonName": {
        "type": "string",
        "description": "Season year(s)."
      },
      "competition": {
        "type": "integer",
        "description": "Unique ID of competition."
      },
      "awayTeamName": {
        "type": "string",
        "description": "Name of away team."
      },
      "id": {
        "type": "integer",
        "description": "Unique ID of football match."
      },
      "homeManager": {
        "type": "integer",
        "description": "Unique ID of home team manager."
      },
      "awayTeam": {
        "type": "integer",
        "description": "Unique ID of away team."
      },
      "homeTeamName": {
        "type": "string",
        "description": "Name of home team."
      },
      "venueName": {
        "type": "string",
        "description": "Name of match venue."
      },
      "matchday": {
        "type": "integer",
        "description": "Matchday to which league match corresponds."
      },
      "awayManager": {
        "type": "integer",
        "description": "Unique ID of away team manager."
      },
      "matchDate": {
        "type": "date",
        "description": "Date of match in ISO format (YYYY-MM-DD)."
      },
      "referee": {
        "type": "integer",
        "description": "Unique ID of match referee."
      },
      "homeManagerName": {
        "type": "string",
        "description": "Full name of home team manager."
      },
      "season": {
        "type": "integer",
        "description": "Unique ID of football season."
      },
      "attendance": {
        "type": "integer",
        "description": "The estimated attendance at the match."
      },
      "competitionName": {
        "type": "string",
        "description": "Name of football competition."
      },
      "homeTeam": {
        "type": "integer",
        "description": "Unique ID of home team."
      },
      "kickoffTime": {
        "type": "time",
        "description": "Time of match kickoff in 24-hour format (HH:MM)."
      },
      "refereeName": {
        "type": "string",
        "description": "Full name of match referee."
      },
      "venue": {
        "type": "integer",
        "description": "Unique ID of match venue."
      },
      "secondhalfLength": {
        "type": "integer",
        "description": "Length of the second half in minutes."
      }
    },
    "description": "This view shows aggregated overview data of a football match.\n"
  }
}

We think the OPTIONS functionality will be useful for self-describing the API, automating web service clients, and facilitating type-checking.