# How-to keep your database in SYNC

This is one of the most vital how-to guides. We’ll 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 [GET Fixtures by Date](/v3/endpoints-and-entities/endpoints/fixtures/get-fixtures-by-date.md) endpoint to accomplish this.

\
In this example, we’ll take the date of 2022-09-03.

{% tabs %}
{% tab title="Request" %}
{% code overflow="wrap" %}

```javascript
https://api.sportmonks.com/v3/football/fixtures/date/2022-09-03?api_token=YOUR_TOKEN
```

{% endcode %}
{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": [
    {
      "id": 18528309,
      "sport_id": 1,
      "league_id": 743,
      "season_id": 19684,
      "stage_id": 77457688,
      "group_id": null,
      "aggregate_id": null,
      "round_id": 273906,
      "state_id": 5,
      "venue_id": 2315,
      "name": "Necaxa vs León",
      "starting_at": "2022-09-03 00:00:00",
      "result_info": "León won after full-time.",
      "leg": "1/1",
      "details": null,
      "length": 90,
      "placeholder": false,
      "last_processed_at": "2023-03-02 17:48:14",
      "has_odds": true,
      "starting_at_timestamp": 1662163200
    },
    {
      "id": 18573151,
      "sport_id": 1,
      "league_id": 2034,
      "season_id": 19430,
      "stage_id": 77456822,
      "group_id": null,
      "aggregate_id": null,
      "round_id": 278917,
      "state_id": 5,
      "venue_id": null,
      "name": "Mario Mendez vs Panamá Oeste",
      "starting_at": "2022-09-03 00:00:00",
      "result_info": "Game ended in draw.",
      "leg": "1/1",
      "details": null,
      "length": 90,
      "placeholder": false,
      "last_processed_at": "2023-02-06 16:01:12",
      "has_odds": true,
      "starting_at_timestamp": 1662163200
    },
    //And more
```

{% endtab %}
{% endtabs %}

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

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.&#x20;

\
Luckily, we have a solution for this. If you add `&filters=deleted` to your request, you will get all the fixtures that are deleted from that specific date.&#x20;

{% tabs %}
{% tab title="Request" %}
{% code overflow="wrap" %}

```javascript
https://api.sportmonks.com/v3/football/fixtures/date/2022-09-03?api_token=YOUR_TOKEN&filters=deleted&include=state
```

{% endcode %}
{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": [
    {
      "id": 18454901,
      "sport_id": 1,
      "league_id": 764,
      "season_id": 19267,
      "stage_id": 77456294,
      "group_id": null,
      "aggregate_id": null,
      "round_id": 265310,
      "state_id": 20,
      "venue_id": null,
      "name": "UTC Cajamarca vs Alianza Atlético",
      "home_score": null,
      "away_score": null,
      "starting_at": "2022-09-03 22:00:00",
      "result_info": null,
      "leg": "1/1",
      "details": null,
      "length": 90,
      "placeholder": false,
      "last_processed_at": null,
      "starting_at_timestamp": 1662242400,
      "state": {
        "id": 20,
        "state": "DELETED",
        "name": "Deleted",
        "short_name": "DEL",
        "developer_name": "DELETED",
        "is_live": false,
        "is_pending": false,
        "is_period_end": false,
        "is_final_state": false,
        "is_cancelled": false,
        "is_final_standing_state": false,
        "is_completed": false,
        "type_id": null,
        "is_deleted": true,
        "is_notstarted": false,
        "sections_active": false
      }
    },
    {
      "id": 18454902,
      "sport_id": 1,
      "league_id": 764,
      "season_id": 19267,
      "stage_id": 77456294,
      "group_id": null,
      "aggregate_id": null,
      "round_id": 265310,
      "state_id": 20,
      "venue_id": null,
      "name": "Deportivo Municipal vs Real Garcilaso",
      "home_score": null,
      "away_score": null,
      "starting_at": "2022-09-03 22:00:00",
      "result_info": null,
      "leg": "1/1",
      "details": null,
      "length": 90,
      "placeholder": false,
      "last_processed_at": null,
      "starting_at_timestamp": 1662242400,
      "state": {
        "id": 20,
        "state": "DELETED",
        "name": "Deleted",
        "short_name": "DEL",
        "developer_name": "DELETED",
        "is_live": false,
        "is_pending": false,
        "is_period_end": false,
        "is_final_state": false,
        "is_cancelled": false,
        "is_final_standing_state": false,
        "is_completed": false,
        "type_id": null,
        "is_deleted": true,
        "is_notstarted": false,
        "sections_active": false
      }
    },
  // And More  
```

{% endtab %}
{% endtabs %}

\
Adding `&filters=deleted` allows you to keep your database in sync with ours.

{% hint style="info" %}
We've included the state to have a textual representation of the fixtures' state.
{% endhint %}

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sportmonks.com/v3/tutorials-and-guides/guides/how-to-keep-your-database-in-sync.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
