> For the complete documentation index, see [llms.txt](https://docs.predicthq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.predicthq.com/integrations/integration-guides/keep-data-updated-via-api.md).

# Keep data updated via API

Event information changes frequently. For example, a date changes, an event gets canceled, or ranking is updated. It’s important to keep your data set up to date.

{% hint style="success" %}
We highly recommend using Snowflake or ADX to keep your local event store up to date. Managed delivery removes all the complexity of implementing a sync system against the API and results in far higher accuracy with fewer issues. Keeping up to date via the API is much more complicated than via Snowflake or ADX.
{% endhint %}

Events change constantly: dates move, events are canceled or postponed, Predicted Attendance values are revised, and records are merged as duplicates or removed as spam. A stale local store degrades everything built on it - models score against outdated signals, and grounded AI systems answer from events that no longer exist. Keeping your store in sync is what keeps those outputs true.

Our records have an `updated` field which indicates the date/time the record was last updated.

{% hint style="info" %}
For example an event for a conference that starts on 1 April 2026 may originally be created in our system on 1 Jan 2026. Then the event’s details don’t change until the 5 Feb 2026 when the event is canceled. The event’s state field then changes to `deleted` and the `deleted_reason` changes to `cancelled`. The event’s updated field would show `2026-02-05T05:00:00Z` (for the cancellation change made to the event on 5 Feb 2026).
{% endhint %}

## High-level guide to keeping data updated

The best way to update your data store is to search for records that have changed since you last synced:

1. To find records that have been updated since your last fetch, use the `updated.*` parameters.
2. Make sure you’re fetching both `active` and `deleted` events e.g. `state=active,deleted`
   1. For the Broadcasts API, use `record_status=active,duplicate,deleted`
3. Ensure you won’t miss changes if records are updated while you’re fetching with `sort=-updated`
4. Sync every 24 hours, or more frequently for unscheduled events if needed.

The following example request in Python fetches updated events:

```python
import requests

response = requests.get(
    url="https://api.predicthq.com/v1/events/",
    headers={
      "Authorization": "Bearer $API_TOKEN",
      "Accept": "application/json"
    },
    params={
        "updated.gte" : "2026-07-01",
        "updated.lte" : "2026-07-10",
        "state" : "active,deleted",
        "sort": "-updated",
        "limit": 500
    }
)

print(response.json())
```

{% hint style="success" %}
Note that you can use the [Features API](/api/features/get-features.md) to directly get daily-level aggregations of the data instead of downloading large volumes of event data and keeping it up to date. The Features API provides pre-built features that save you from writing a lot of code to aggregate data and create features on your side.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.predicthq.com/integrations/integration-guides/keep-data-updated-via-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
