How-to keep your database in sync

This is the last and one of the most vital how-to guides. We’re going to discuss how you can keep your database in sync with ours.

Let’s imagine, you want to know all the fixtures of one specific day. You want to show these matches to your application users and send updates to them. You can use our fixtures by date endpoint to accomplish this.

For example the fixtures of 2020-08-02:

https://soccer.sportmonks.com/api/v2.0/fixtures/date/2020-08-02?api_token={API_TOKEN}

In the meta description, you can see that the response gives you a total number of 562 results.

The total number of results depends on the plan you're subscribed to.

Now, sometimes fixtures are deleted due to technical reasons. These fixtures will be removed from the API response.

If you only use the previous request and a fixture is removed, then it won't be in your response. This results in your database not being in sync with ours. Luckily, we have a solution for this.

If you add &deleted=1 to your request, you will get all the fixtures that were in the original response. Including the deleted fixtures. In the meta description, you can see that the response gives you a total of 697 results.

https://soccer.sportmonks.com/api/v2.0/fixtures/date/2020-08-02?api_token={API_TOKEN}&deleted=1

Adding &deleted=1 allows you to keep your database in sync with ours.

You can see that a fixture is deleted in thestatus field of the fixtures.

Last updated