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-connect.soccermetrics.net/v1/

You’ll get the following response:

HTTP/1.1 200 OK
Server: gunicorn/18.0
Date: Fri, 18 Jul 2014 03:38:01 GMT
Connection: close
Content-Type: application/json
Content-Length: 7670
Access-Control-Allow-Origin: *

{
  "result": {
    "link": {
      "bodyparts": "/v1/bodyparts",
      "cards": "/v1/cards",
      "competitions": "/v1/competitions",
      "confederations": "/v1/confederations",
      "countries": "/v1/countries",
      "domesticCompetitions": "/v1/domestic_competitions",
      "fouls": "/v1/fouls",
      "grouprounds": "/v1/grouprounds",
      "intlCompetitions": "/v1/intl_competitions",
      "knockoutrounds": "/v1/knockoutrounds",
      "managers": "/v1/managers",
      "nameOrder": "/v1/name_order",
      "penaltyOutcomes": "/v1/penalty_outcomes",
      "persons": "/v1/persons",
      "phases": "/v1/phases",
      "players": "/v1/players",
      "positions": "/v1/positions",
      "referees": "/v1/referees",
      "seasons": "/v1/seasons",
      "shotevents": "/v1/shotevents",
      "surfaces": "/v1/surfaces",
      "teams": "/v1/teams",
      "timezones": "/v1/timezones",
      "venues": "/v1/venues",
      "weather": "/v1/weather",
      "personnel": {
        "managers": "/v1/personnel/managers",
        "players": "/v1/personnel/players",
        "referees": "/v1/personnel/referees"
      },
      "club": {
        "events": {
          "actions": "/v1/clubs/events/actions",
          "all": "/v1/clubs/events/all",
          "touches": "/v1/clubs/events/touches"
        },
        "matches": {
          "conditions": "/v1/clubs/matches/conditions",
          "goals": "/v1/clubs/matches/goals",
          "info": "/v1/clubs/matches/info",
          "lineups": "/v1/clubs/matches/lineups",
          "offenses": "/v1/clubs/matches/offenses",
          "penalties": "/v1/clubs/matches/penalties",
          "substitutions": "/v1/clubs/matches/substitutions"
        },
        "stats": {
          "crosses": {
            "corners": "/v1/clubs/stats/crosses/corners",
            "totals": "/v1/clubs/stats/crosses/totals"
          },
          "defense": {
            "actions": "/v1/clubs/stats/defense/actions",
            "blocks": "/v1/clubs/stats/defense/blocks",
            "clearances": "/v1/clubs/stats/defense/clearances",
            "goalline": "/v1/clubs/stats/defense/goalline",
            "tackles": "/v1/clubs/stats/defense/tackles"
          },
          "fouls": {
            "cards": "/v1/clubs/stats/fouls/cards",
            "wins": "/v1/clubs/stats/fouls/wins"
          },
          "goalkeeper": {
            "actions": "/v1/clubs/stats/goalkeeper/actions",
            "goals": "/v1/clubs/stats/goalkeeper/goals",
            "saves": "/v1/clubs/stats/goalkeeper/saves",
            "shots": "/v1/clubs/stats/goalkeeper/shots"
          },
          "goals": {
            "assists": "/v1/clubs/stats/goals/assists",
            "bodyparts": "/v1/clubs/stats/goals/bodyparts",
            "locations": "/v1/clubs/stats/goals/locations",
            "penalties": "/v1/clubs/stats/goals/penalties",
            "totals": "/v1/clubs/stats/goals/totals"
          },
          "passes": {
            "directions": "/v1/clubs/stats/passes/directions",
            "lengths": "/v1/clubs/stats/passes/lengths",
            "locations": "/v1/clubs/stats/passes/locations",
            "totals": "/v1/clubs/stats/passes/totals"
          },
          "setpieces": {
            "corners": "/v1/clubs/stats/setpieces/corners",
            "freekicks": "/v1/clubs/stats/setpieces/freekicks",
            "throwins": "/v1/clubs/stats/setpieces/throwins"
          },
          "shots": {
            "bodyparts": "/v1/clubs/stats/shots/bodyparts",
            "locations": "/v1/clubs/stats/shots/locations",
            "plays": "/v1/clubs/stats/shots/plays",
            "totals": "/v1/clubs/stats/shots/totals"
          },
          "touches": {
            "duels": "/v1/clubs/stats/touches/duels",
            "locations": "/v1/clubs/stats/touches/locations",
            "totals": "/v1/clubs/stats/touches/totals"
          }
        }
      },
      "natl": {
        "events": {
          "actions": "/v1/national/events/actions",
          "all": "/v1/national/events/all",
          "touches": "/v1/national/events/touches"
        },
        "matches": {
          "conditions": "/v1/national/matches/conditions",
          "goals": "/v1/national/matches/goals",
          "info": "/v1/national/matches/info",
          "lineups": "/v1/national/matches/lineups",
          "offenses": "/v1/national/matches/offenses",
          "penalties": "/v1/national/matches/penalties",
          "substitutions": "/v1/national/matches/substitutions"
        },
        "stats": {
          "crosses": {
            "corners": "/v1/national/stats/crosses/corners",
            "totals": "/v1/national/stats/crosses/totals"
          },
          "defense": {
            "actions": "/v1/national/stats/defense/actions",
            "blocks": "/v1/national/stats/defense/blocks",
            "clearances": "/v1/national/stats/defense/clearances",
            "goalline": "/v1/national/stats/defense/goalline",
            "tackles": "/v1/national/stats/defense/tackles"
          },
          "fouls": {
            "cards": "/v1/national/stats/fouls/cards",
            "wins": "/v1/national/stats/fouls/wins"
          },
          "goalkeeper": {
            "actions": "/v1/national/stats/goalkeeper/actions",
            "goals": "/v1/national/stats/goalkeeper/goals",
            "saves": "/v1/national/stats/goalkeeper/saves",
            "shots": "/v1/national/stats/goalkeeper/shots"
          },
          "goals": {
            "assists": "/v1/national/stats/goals/assists",
            "bodyparts": "/v1/national/stats/goals/bodyparts",
            "locations": "/v1/national/stats/goals/locations",
            "penalties": "/v1/national/stats/goals/penalties",
            "totals": "/v1/national/stats/goals/totals"
          },
          "passes": {
            "directions": "/v1/national/stats/passes/directions",
            "lengths": "/v1/national/stats/passes/lengths",
            "locations": "/v1/national/stats/passes/locations",
            "totals": "/v1/national/stats/passes/totals"
          },
          "setpieces": {
            "corners": "/v1/national/stats/setpieces/corners",
            "freekicks": "/v1/national/stats/setpieces/freekicks",
            "throwins": "/v1/national/stats/setpieces/throwins"
          },
          "shots": {
            "bodyparts": "/v1/national/stats/shots/bodyparts",
            "locations": "/v1/national/stats/shots/locations",
            "plays": "/v1/national/stats/shots/plays",
            "totals": "/v1/national/stats/shots/totals"
          },
          "touches": {
            "duels": "/v1/national/stats/touches/duels",
            "locations": "/v1/national/stats/touches/locations",
            "totals": "/v1/national/stats/touches/totals"
          }
        }
      }
    }
  }
}

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, and macro- and micro-level events and summary statistics in club or national team matches. 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-connect.soccermetrics.net/v1/national/matches/info
HTTP/1.1 200 OK
Server: gunicorn/18.0
Date: Fri, 18 Jul 2014 04:01:09 GMT
Connection: close
Content-Type: application/json
Content-Length: 3447
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,HEAD,OPTIONS

{
  "meta": {},
  "result": {
    "data": {
      "attendance": {
        "description": "The estimated attendance at the match.",
        "type": "integer"
      },
      "awayManager": {
        "description": "The unique ID of the manager of the away team.",
        "type": "uuid"
      },
      "awayManagerName": {
        "description": "Full name of the manager of the away team.",
        "type": "string"
      },
      "awayTeam": {
        "description": "The unique ID of the away team.",
        "type": "uuid"
      },
      "awayTeamName": {
        "description": "The name of the away team.",
        "type": "string"
      },
      "competition": {
        "description": "The unique ID of competition to which the match corresponds.",
        "type": "uuid"
      },
      "competitionName": {
        "description": "Name of competition.",
        "type": "string"
      },
      "firstextraLength": {
        "description": "Length of the first extra time period in minutes.",
        "type": "integer"
      },
      "firsthalfLength": {
        "description": "Length of the first half in minutes.",
        "type": "integer"
      },
      "homeManager": {
        "description": "The unique ID of the manager of the home team.",
        "type": "uuid"
      },
      "homeManagerName": {
        "description": "Full name of the manager of the home team.",
        "type": "string"
      },
      "homeTeam": {
        "description": "The unique ID of the home team.",
        "type": "uuid"
      },
      "homeTeamName": {
        "description": "The name of the home team.",
        "type": "string"
      },
      "id": {
        "description": "",
        "type": "uuid"
      },
      "kickoffTime": {
        "description": "The time of the match kick-off, in 24-hr format (HH:MM).",
        "type": "time"
      },
      "matchDate": {
        "description": "The date of the match, in ISO format (YYYY-MM-DD).",
        "type": "date"
      },
      "phase": {
        "description": "The unique ID of competition phase to which the match corresponds.",
        "type": "integer"
      },
      "phaseName": {
        "description": "Description of competition phase.",
        "type": "string"
      },
      "referee": {
        "description": "The unique ID of the referee who began officiating the match.",
        "type": "uuid"
      },
      "refereeName": {
        "description": "Full name of the referee.",
        "type": "string"
      },
      "season": {
        "description": "The unique ID of season to which the match corresponds.",
        "type": "integer"
      },
      "seasonName": {
        "description": "Season year(s).",
        "type": "string"
      },
      "secondextraLength": {
        "description": "Length of the second extra time period in minutes.",
        "type": "integer"
      },
      "secondhalfLength": {
        "description": "Length of the second half in minutes.",
        "type": "integer"
      },
      "venue": {
        "description": "The unique ID of venue where the match was played.",
        "type": "uuid"
      },
      "venueName": {
        "description": "The name of the match venue.",
        "type": "string"
      }
    },
    "description": "This view shows aggregated overview data for football matches involving national teams."
  }
}

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