Livescores

In this part we’ll explain what livescores are, how people use them and most importantly, how you can work with them.

What are livescores?

As its name suggests, livescores is the act of displaying real-time sports data to its audience. For example, many livescore websites allow you to see the match’s minute, the people who scored a goal, received a card, etc.

Now, you might wonder how you can get this data yourself. Well, it’s actually quite easy. You can simply use one of our two endpoints!

We have two options:

The first request will give you all the fixtures of the current day. While the second one will provide you with all the fixtures that are currently in-play.

Therefore, the first one would be great if you want to show all the current day’s fixtures in your application. The second one is used for live fixtures.

In the livescores/now endpoint, the fixtures will be available 15 minutes before the match has started and 15 mins after it has ended.

The SportMonks’ livescore endpoints are also highly customizable. Have a look at our API reference guide for all the possible options.

Fixtures of the current day

Now that you know what livescores are let’s put your knowledge to the test.

Let’s look at an example of a possible livescores output. The structure of the API response will be identical to our fixtures endpoint. It’s a basic response, mostly consisting of various ids.

At the section called time, you can see that the fixture will be played today and that it hasn’t started yet, due to the status NS (Not Started).

https://soccer.sportmonks.com/api/v2.0/livescores?api_token={API_TOKEN}

You can easily enrich this response with the data you want by using includes. Next, we’re going to include extra information about the local and visitor teams:

https://soccer.sportmonks.com/api/v2.0/livescores?api_token={API_TOKEN}&include=localTeam,visitorTeam

And just like that, we've requested all the fixtures of the day, as well as additional team information.

If this the first time you’ve heard about includes, you might want to check out our includes tutorial.

Visit our statuses and definitions page for information about the fields in the response.

Live fixtures

The only difference between the livescores/now and previous livescores endpoint is that this one will give you all the currently in-play matches. That makes this the go-to endpoint if you want to build a livescore application.

In the example below at the times section again, you can see that the fixture has the “LIVE” status and is currently in the 94th minute.

https://soccer.sportmonks.com/api/v2.0/livescores/now?api_token={API_TOKEN}

Naturally, this response can also be enriched with includes.

Filtering

Just like with our fixtures endpoint, the livescore endpoint has a lot of filter options. You can filter on the following fields:

  • Leagues: filter on league ids.

  • Bookmakers*: filter on bookmaker ids.

  • Markets*: filter on market ids.

  • Fixtures: filter on fixture ids.

You can only filter on the bookmakers & markets parameters when you've enriched your response with the odds include.

These filter options allow you to request only the data for certain leagues or fixtures. Filters are beneficial if you want to highlight or exclude certain leagues or fixtures on your application.

For more information about filtering, you can refer to our filtering tutorial again.

Otherwise, if you want to see how livescores can be implemented, please check our how-to build a livescore portal guide.

In our next tutorial, we’re going to discuss the statistics and line-up of a fixture.

Last updated