Welcome to our blog about how to build a World Cup 2022 application with Sportmonks’ Football API. This is one of the biggest and most-watched sports events worldwide. And you can imagine why it is that popular, Brazil, Argentina, Spain, Germany, England, Portugal, France and all other top-tier countries worldwide will participate and battle to become the World Champion!

In this how-to guide, we will explain how to request the following data from our API:

  • Full season schedule
  • (live) Standings
  • Team squads
  • Season top scorers
  • Team jerseys

Please keep in mind that your subscription needs to include the World Cup (League ID: 732) to access any of the World Cup data. The links to the requests (in this blog) will work once you put your API Token in the request, as long as the World Cup is included in your subscription.

In Postman, we have prepared some World Cup 2022 requests to give you a kickstart.

Let’s find out how you can gather all the World Cup data you need to build your perfect World Cup Qatar 2022 application.

World Cup 2022 schedule

Your fans want to see the World Cup schedule, so you need to implement a nice and clear schedule overview. Maybe you want to create visuals like the one below. You would need the complete schedule, including knockout games, which haven’t yet been determined when the season starts.

So, how do you show a schedule when it’s not complete?

Our development team has added a property on both fixture and team responses called is_placeholder. This property indicates if the resource is used to display dummy data. The false of this property will always be a boolean value.

The is_placeholder property will tell you that the data is not final or is used for placeholder purposes. The id of a fixture will remain the same when data is merged into it.

You can use the season by id endpoint with the includes stages.fixtures.localTeam and stages.fixtures.visitorTeam to retrieve all the stages with the fixtures and the two teams involved:

Request:
https://soccer.sportmonks.com/api/v2.0/seasons/18017?api_token={YOURTOKEN}&include=stages.fixtures.localTeam,stages.fixtures.visitorTeam

Response:

{
  "data": {
    "id": 18017,
    "name": "2022",
    "league_id": 732,
    "is_current_season": true,
    "current_round_id": 238362,
    "current_stage_id": 77452386,
    "stages": {
      "data": [
        {
          "id": 77452381,
          "name": "Final",
          "type": "Knock Out",
          "league_id": 732,
          "season_id": 18017,
          "sort_order": 5,
          "has_standings": false,
          "has_outgroup_matches": 0,
          "fixtures": {
            "data": [
              
            ]
          }
        },
        {
          "id": 77452382,
          "name": "3rd Place Final",
          "type": "Knock Out",
          "league_id": 732,
          "season_id": 18017,
          "sort_order": 3,
          "has_standings": false,
          "has_outgroup_matches": 0,
          "fixtures": {
            "data": [
              
            ]

 

We’ve added the official match numbers of the World Cup fixtures in the details field. This also helps you draw a nice visual.

World Cup 2022 Schedule

Group stage standings

The World Cup 2022 group stages and teams are announced. Are you interested in an overview of all the groups? You can best use our standings by season id endpoint for this:
https://soccer.sportmonks.com/api/v2.0/standings/season/18017?api_token={YOURTOKEN}

This will return all the group standings with the teams involved. Are you only interested in one group? No problem, you can filter the standings by group_ids:
https://soccer.sportmonks.com/api/v2.0/standings/season/18017?api_token={YOURTOKEN}&group_ids=246691

You can filter multiple group ids separated by a comma.

In our World Cup 2022 all-in package, you will have access to predictions, news and all advanced features.

Team squads and jerseys

Now we have the schedule and the groups, it might be interesting to show the squads participating. The easiest way to request this is to use our teams by season id endpoint with the include squad.player.
https://soccer.sportmonks.com/api/v2.0/teams/season/18017?api_token={YOURTOKEN}&include=squad.player

Of course, if you want the teams separately you can use the team squad by team and season id endpoint.

We also have all the team jerseys available for the participating teams. You can request them via:
https://soccer.sportmonks.com/api/v2.0/leagues/732/shirts?api_token={YOURTOKEN}

Top scorers

Interesting stats for your application users are top goal, card and assist scorers. This way people can see which players are doing well, or which players are underperforming.

You can use the top scorers by season endpoint: get top scorers by season id.
https://soccer.sportmonks.com/api/v2.0/topscorers/season/18017?api_token={API_TOKEN}

Using the above request will give a basic API response with only ids.

We want the player and team names and not just their player id. We can do this for all three top scorers, which are:

  • Goalscorers → players who have scored a goal
  • Assistscorers → players who gave assists
  • Cardscorers → players who have received yellow or red cards

We then use the nested includes goalscorers.player and goalscorers.team to the request. This way we could request everything:
https://soccer.sportmonks.com/api/v2.0/topscorers/season/18017?api_token={API_TOKEN}&include=goalscorers.player,goalscorers.team,assistscorers.player,
assistscorers.team,cardscorers.player,cardscorers.team

It’s up to you how much data you want to receive. For our example, we are only interested in the goal-scoring top scorers. So we’ll use this URL:
https://soccer.sportmonks.com/api/v2.0/topscorers/season/18017?api_token={API_TOKEN}&include=goalscorers.player,goalscorers.team

The previous requests will give you all the top scorers of goals, cards and assist per stage. But what if you want the total amount of a season?

We have the aggregated top scorers endpoint for this. Please head over to our top scorers tutorial for more information.

You can also build a match and team page with the World Cup data Sportmonks provides. We cover detailed match, team, player and season statistics. Please visit our how-to build a match page with events and statistics for more info.

If you have any questions please contact our Sportmonks team via our contact page or send us an email at [email protected].