Live now!

Progress of current post

How to build a livescore website with Sportmonks’ Football API

Welcome to our comprehensive guide on how-to build a livescore website with Sportmonks’ Football API. This comprehensive guide provides everything you need about livescore websites, why they’re valuable, and how to build one quickly using our Football API.

So, let’s jump right in and get started!

Time to read 11 min
Published 13 February 2024
Last updated 9 March 2025
Wesley Van Rooij
How to build a livescore website with Sportmonks’ Football API
Contents

What is a livescore website?

A football livescore website is a dynamic platform providing real-time updates on football matches worldwide. It offers users instant access to livescores, match statistics, team lineups, betting opportunities and other essential information related to live matches.

These websites typically cover a wide range of football leagues, catering to the diverse interests of football fans globally. Whether it’s the English Premier League, La Liga, Serie A, or international tournaments like the FIFA World Cup, a livescore website ensures that fans stay updated on the latest developments in their favourite matches.

So why should you build a livescore website with Sportmonks’ Football API

Why build a livescore website with Sportmonks’ Football API?

When considering building a livescore website, leveraging the Sportmonks Football API offers numerous advantages and opportunities that set it apart from competitors. Here’s why building your livescore application with the Sportmonks Football API is a smart choice:

  • Engaged users: You will have access to various football data, including livescores & events, match statistics, player information, and more. With reliable and up-to-date data at your fingertips, you can ensure that your livescore website delivers accurate and comprehensive information to your users.
  • Easy integration and implementation: Sportmonks’ Football API is designed for developers by developers. It’s user-friendly and easy to integrate into your website or application. With detailed documentation and fast support, you can quickly implement the API into your project, saving time and effort during development.
  • Customisation: Choose which data and features are available on your livescore website to meet your audience’s needs and preferences. Whether you want to focus on specific leagues, teams, or match events, the API can be configured to suit your requirements.
  • Scalability and performance: Interested in all the leagues available or just the popular football leagues? Not a problem at all. Choose the leagues you’re interested in and expand your offering once ready. Next to that, you won’t have to worry about downtime. The Sportmonks’ infrastructure is designed to handle significant traffic and data requests, ensuring your livescore website remains fast, responsive, and reliable even during peak usage.

How-to build a livescore website with Sportmonks’ Football API via these steps: 

Step 1: Gather the tools

Let’s begin by ensuring you have the necessary tools to build your website. Here’s what you’ll need:

  • API Token: Before developing, you must obtain a Sportmonks API token. If you haven’t already, you can create one by visiting MySportmonks.
  • Code Editor: We recommend using a reliable code editor to write and edit your website’s code. One of our developers uses Visual Studio Code, but feel free to use any code editor you prefer.
  • Postman (Optional): While not essential, installing Postman can be incredibly helpful for testing and debugging API requests. If you’re interested in learning how to use the Sportmonks Football API with Postman, read our How-to use Sportmonks Football API with Postman guide.

Having these tools ready will set you up for success as you build your livescore website with Sportmonks’ Football API.

Step 2: Decide which leagues you want to display

Now that we have all our tools, we can plan what we want to show our audience.

Firstly, consider which football leagues capture your interest. Are you aiming to cover a wide range of leagues or focus solely on specific ones, such as the Bundesliga, La Liga or English Premier League?

While making these decisions, ensuring that the leagues you choose align with your subscription plan is crucial. You can refer to our coverage page to determine which leagues your current plan includes. Additionally, you can utilise our “All Leagues” endpoint to retrieve a comprehensive list of leagues available within your subscription.

A vital point to note: if your plan covers no ongoing matches within the leagues, the livescore API will not return any data.

Step 3: Selecting the data to show

Now that you’ve outlined the leagues you wish to feature, the next step is determining the data you want to present to your target audience.

Typically, livescore websites display essential information such as:

  • Date and time of the match
  • League name, stage and round 
  • Home and away teams
  • Match status (e.g., first half, half-time, full-time etc.)
  • The score
  • Events like goals, cards, and other match events
  • Logos of teams, leagues, and country flags

While this may seem like a substantial amount of data, our Football API is designed to retrieve and deliver this information efficiently, with speed and precision. Furthermore, the API offers excellent flexibility, only returning the specific data you request.

Suppose you need additional match data, such as lineups and match statistics. In that case, we have detailed resources on our “how-to build a match page” to guide you through accessing and incorporating this information into your livescore website.

Step 4: Choose the correct endpoint

When utilising our API for retrieving livescores, choosing the appropriate endpoint that aligns with your specific requirements is essential. Here’s a breakdown of the available endpoints:

  • GET All Inplay Livescores: returns all the inplay fixtures.
  • GET All Livescores: returns the fixtures 15 minutes before the game starts. It will also disappear 15 minutes after the game is finished.
  • GET Latest Updated Livescores: returns all livescores that have received updates within 10 seconds.

Interested in more information? Navigate to our documentation pages for more info.

We’ll focus on the GET All Inplay Livescores endpoint for this how-to guide. You can access it using the following URL:

https://api.sportmonks.com/v3/football/livescores/inplay?api_token=YOUR_TOKEN

Tip: Use Postman for quick access to our endpoints.

Step 5: Build your API request

With the base URL ready, it’s time to enhance the request with various includes based on your selections in Step 3. This allows for a more comprehensive and tailored response from the API.

For example, a common request may include participants, goals scored, substitutions, and yellow/red cards. For simplicity, these match events can be bundled into one include called “events,” as demonstrated below:

https://api.sportmonks.com/v3/football/livescores/inplay?api_token=YOUR_TOKEN&include=scores;events;participants;periods

This URL retrieves data on scores, events (including goals, substitutions, and cards), participants, and match periods.

For a complete list of possible includes available for livescores, you can refer to the Livescore page

Ultimately, as the developer of your livescore website, you can add any includes you desire. Whether you choose to include all available data or only specific subsets, the decision is yours to make based on the needs and preferences of your audience. Feel free to customise the request with as many or as few includes as you see fit.

{
  "data": {
    "id": 18842518,
    "sport_id": 1,
    "league_id": 8,
    "season_id": 21646,
    "stage_id": 77464011,
    "group_id": null,
    "aggregate_id": null,
    "round_id": 307165,
    "state_id": 5,
    "venue_id": 214,
    "name": "West Ham United vs Arsenal",
    "starting_at": "2024-02-11 14:00:00",
    "result_info": "Arsenal won after full-time.",
    "leg": "1/1",
    "details": null,
    "length": 90,
    "placeholder": false,
    "has_odds": true,
    "starting_at_timestamp": 1707660000,
    "scores": [
      {
        "id": 13883194,
        "fixture_id": 18842518,
        "type_id": 2,
        "participant_id": 19,
        "score": {
          "goals": 6,
          "participant": "away"
        },
        "description": "2ND_HALF"
      },
      {
        "id": 13883195,
        "fixture_id": 18842518,
        "type_id": 2,
        "participant_id": 1,
        "score": {
          "goals": 0,
          "participant": "home"
        },
        "description": "2ND_HALF"
      },
      {
        "id": 13882903,
        "fixture_id": 18842518,
        "type_id": 1525,
        "participant_id": 19,
        "score": {
          "goals": 6,
          "participant": "away"
        },
        "description": "CURRENT"
      },
      {
        "id": 13882899,
        "fixture_id": 18842518,
        "type_id": 1,
        "participant_id": 1,
        "score": {
          "goals": 0,
          "participant": "home"
        },
        "description": "1ST_HALF"
      },
      {
        "id": 13882898,
        "fixture_id": 18842518,
        "type_id": 1,
        "participant_id": 19,
        "score": {
          "goals": 4,
          "participant": "away"
        },
        "description": "1ST_HALF"
      },
      {
        "id": 13882901,
        "fixture_id": 18842518,
        "type_id": 1525,
        "participant_id": 1,
        "score": {
          "goals": 0,
          "participant": "home"
        },
        "description": "CURRENT"
      }
    ],
    "events": [
      {
        "id": 96110887,
        "fixture_id": 18842518,
        "period_id": 5224842,
        "participant_id": 19,
        "type_id": 14,
        "section": "event",
        "player_id": 16827155,
        "related_player_id": 26823,
        "player_name": "Bukayo Saka",
        "related_player_name": "Martin Ødegaard",
        "result": "0-5",
        "info": "Shot",
        "addition": "5th Goal",
        "minute": 63,
        "extra_minute": null,
        "injured": null,
        "on_bench": false,
        "coach_id": null,
        "sub_type_id": null
      },
      {
        "id": 96102326,
        "fixture_id": 18842518,
        "period_id": 5224732,
        "participant_id": 1,
        "type_id": 19,
        "section": "event",
        "player_id": 254052,
        "related_player_id": null,
        "player_name": "Edson Álvarez",
        "related_player_name": null,
        "result": null,
        "info": "Foul",
        "addition": null,
        "minute": 9,
        "extra_minute": null,
        "injured": null,
        "on_bench": false,
        "coach_id": null,
        "sub_type_id": 1496
      },
//and more

 

Step 6: Evaluating the Response

Once you’ve made the request and received a response from the API, it’s crucial to evaluate the data to ensure it meets your requirements and expectations. Let’s walk through an example to demonstrate this process:

For instance, let’s analyse a match (fixture ID: 18842518) in the 2023/2024 season of the English Premier League between West Ham United (team ID: 1) and Arsenal (team ID: 19). Below, you’ll find a request URL along with the response containing events for the specified match:

https://api.sportmonks.com/v3/football/livescores/inplay?api_token=YOUR_TOKEN&include=scores;events;participants;periods

In this request, we’ve included periods, scores, events and participants to gather comprehensive data on the match.

Alternatively, you can refer directly to the fixture by ID request to obtain the same output:

https://api.sportmonks.com/v3/football/fixtures/18842518?api_token=YOUR_TOKEN&include=scores;events;participants;periods

Within the response, the events section will display all goals, cards, and substitutions during the match. By carefully reviewing the response data, including events and other vital information, you can ensure that your livescore website provides accurate and timely updates to your audience, enhancing their overall experience.

Step 7: Filtering Requests

This step will explore advanced requests, explicitly focusing on filtering data to meet specific criteria. Let’s consider a scenario where you’re only interested in goals scored and cards on your livescore website.

We can implement a filter to exclude all other event data to ensure that our page only displays the goals and cards in the matches. 

To achieve this, we’ll apply a filter to our request by adding `&filters=eventTypes:14,19,20,21` to the URL. This filter instructs the API only to return the goals (type ID: 14), yellowcards (type ID: 19), redcards (type ID: 20), yellowredcards (type ID: 21) of the matches on your livescore website. 

Here’s an example of how to incorporate the filter into your request:

https://api.sportmonks.com/v3/football/livescores/inplay?api_token=YOUR_TOKEN&include=events.type&filters=eventTypes:14,19,20,21

By utilising filtering capabilities, we can tailor the data retrieved from the API to match the specific needs and preferences of our livescore website. For further details on filtering techniques, refer to our dedicated filter tutorial for additional guidance.

Build a livescore website with Sportmonks’ Football API

Congratulations on completing our comprehensive how-to guide on building your livescore website with Sportmonks’ Football API. Throughout this journey, we’ve covered essential aspects of livescore websites, from their significance to practical steps for implementation using our API.

As you embark on your journey to build your livescore website, remember that the Sportmonks team is here to support you every step. Whether you’re a seasoned developer or just getting started, our comprehensive documentation, responsive support, and reliable API infrastructure are here to empower you to create a top-notch livescore experience for your audience.

So, what are you waiting for? Start building your livescore website today with Sportmonks’ Football API!

Activate your free trial

FAQ

What is a livescore website?
A livescore website provides real-time updates on football matches, including scores, match statistics, team lineups, and other essential information.
Why use Sportmonks Football API for a livescore website?
  • Engaged Users: Provides accurate and comprehensive football data.
  • Easy Integration: User-friendly with detailed documentation.
  • Customization: Tailor data and features to your audience.
  • Scalability: Handles significant traffic and data requests efficiently.
Reach out to out support team if you need any help
How do I build and filter API requests?
Use the base URL and include necessary data points like scores, events, and participants. Apply filters to refine the data to match specific criteria. Here’s an example of how to incorporate the filter into your request: https://api.sportmonks.com/v3/football/livescores/inplay?api_token=YOUR_TOKEN&include=events&filters=eventTypes:14,19,20,21 By utilising filtering capabilities, we can tailor the data retrieved from the API to match the specific needs and preferences of our livescore website. For further details on filtering techniques, refer to our dedicated filter tutorial for additional guidance.
What data should I show on my livescore website?
Common data includes match date and time, league details, teams, scores, and match events like goals and cards. But it's totally up to your projects requirement.
How can I handle high traffic on my livescore website?
Ensure you have a robust hosting solution, use caching mechanisms, and optimize API requests to manage and sustain high traffic efficiently.
Can I customise the data retrieved from Sportmonks Football API?
Yes, you can customise the data retrieved from the Football API to suit your specific requirements. The API allows you to filter data based on various parameters, such as date, team, player, league, and more. Additionally, you can specify which fields you want to include or exclude in the API responses to minimize bandwidth usage and optimize performance. Check our documentation for more information.
What is an API-token?
Sportmonks makes use of API-tokens for authorization of our API. You are required to add the parameter 'api_token' to your API requests. The parameter's value is the actual token you received when you created it in My Sportmonks. Without this key, you cannot use our APIs.
How can I create an API-token?
Once you’ve created your account, you can create your API token via the settings page on My Sportmonks. For security reasons, the API token will only be shown to you once when you create it. Please make sure to write down your API token somewhere safe.
How does the API work?
We have built a well-structured, flexible, and fast JSON API. Our API makes it easy to customize your JSON responses. Our API's flexibility demonstrates itself by allowing its users to build their own responses in the form of adding include parameters to their requests. This means you can request the data you need and leave out the data you don't need. Filtering and Sorting is another widely used and loved characteristic of our API. It means you can request the data the way you want it to, by adding the proper filtering and sorting commands. Please check our documentation pages for more information.
Is there a limit to the number of API requests I can make?
We offers different subscription plans with varying levels of access and usage limits. While the Free plan has certain restrictions on the number of API requests allowed per day, higher-tier plans offer increased usage (3,000 API calls per entity per hour) allowances and additional features. If you require more API requests than your current plan allows, you can consider upgrading to a higher-tier plan or contacting support for customised solutions tailored to your needs.
What happens if I hit the rate limit?
Once you’ve hit the rate limit, you will receive a 429 response. The rate limit kicks in after the first request has been made. The rate limit will be set to 0 when an hour has passed. For example: If you make the first of X requests at 18:18 UTC it will be reset at 19:18. Information about the current number of calls, as well as the reset time, can be found in the responses meta section.

Written by Wesley Van Rooij

Wesley van Rooij is a marketing and football expert with over 5 years of industry experience. His comprehensive knowledge of the Sportmonks Football API and a focused approach to APIs in the Sports Data industry allow him to offer insights and support to enthusiasts and businesses. His outstanding marketing and communication skills and technical writing expertise enable him to empathise with developers. He understands their needs and challenges to facilitate the development of cutting-edge football applications that stand out in the market.

We encourage you to explore our Postman collections for more robust API testing options. Check out our How-to guide on using the Sportmonks Football API with Sportmonks.

Sportmonks Football API with Postman