Skip to main content

Smartvatten Data API: “Updated After” Feature

Using the query[updatedafter] Parameter to Sync Updated and Recalculated Data via Smartvatten API

V
Written by Ville Vainola
Updated over 3 weeks ago

The query[updatedafter] parameter in the Smartvatten Data API enables systems to retrieve all values that have been updated or recalculated since a specific timestamp—without needing to define a start or end date.

This feature ensures that any system integrating with Smartvatten stays fully synchronized with the most accurate and up-to-date data, including historical corrections.

Key Features

  • Returns all updated values since the specified timestamp, including recalculated historical data.

  • No need to define a time range—just use the query[updatedafter] parameter.

  • Supports rolling updates: Query the API periodically (e.g., daily) to fetch only the latest changes.

  • Covers up to 3 months of history: Any value updated within the last 3 months will be included.

  • Captures recalculated data: For example, if a value from two months ago was recalculated yesterday, it will be returned.

Parameter Details

  • Parameter: query[updatedafter]

  • Type: string

  • Format: YYYY-MM-DDTHH (e.g., 2025-07-25T01)

  • Function: Returns all data updated since the given timestamp.

  • Limit: Only updates from the last 3 months are returned.

How It Works

When you use query[updatedafter], the API returns:

  • All values that have been created, modified, or recalculated after the specified timestamp.

  • This includes historical values that were updated after the given time.

You do not need to specify start date or end date. The API automatically returns all relevant updates up to the latest available timestamp.

Usage Example

Let’s say you want to keep your system updated daily:

  1. Set query[updatedafter]=2025-07-21T00 (one week ago).

  2. Call the API once per day.

  3. The API returns:

    • All values updated or recalculated since July 21, 2025, 00:00.

    • Including any historical values that were modified during that period.

Best Practices

  • Use a rolling timestamp (e.g., the last successful sync time) for regular updates.

  • Store the timestamp of your last successful API call and use it as the next query[updatedafter] value.

  • Be aware that the API only returns updates from the last 3 months.

If you have any questions or need assistance integrating the query[updatedafter] feature into your system, please don’t hesitate to contact our integrations team at integrations@smartvatten.com.

Did this answer your question?