Skip to main content
Question

Number of datapoints between 2 timestamp without aggregation

  • June 15, 2026
  • 2 replies
  • 30 views

RAMBOURG Pierre
Seasoned ⭐️⭐️

Hi experts,

 

In order to decide whether to use an aggregation strategy (or no aggregation at all), I need to know the number of data points between two timestamps without aggregation (server-side calculation).

 

I’m looking for this code of call :

client.time_series.data.count(external_id=<str>, start=<int | datetime>, end=<int | datetime>) -> int

I'm trying to avoid having to perform a granularity calculation

 

Thanks !

Regards,

Pierre

2 replies

Everton Colling
Expert ⭐️⭐️⭐️⭐️
Forum|alt.badge.img
  • Expert ⭐️⭐️⭐️⭐️
  • June 17, 2026

Hi ​@RAMBOURG Pierre!

Today we dont have a dedicated count() method that returns a single value without specifying granularity, but there are ways to compute it client side. Before recommending anything, could you help me understand:

  • What are you ultimately trying to do with the count? For example, are you deciding between plotting raw vs. aggregated data, sizing a request, or something else?
  • Do you need it to be exact, or would an approximation be enough to make the decision?

The reason I am askins is because fetching a count aggregate costs basically the same as fetching count plus the other aggregates, so if the goal is choosing an aggregation strategy, a "count first, then fetch" flow is often slower than just eagerly fetching what you need in parallel and discarding the rest.


RAMBOURG Pierre
Seasoned ⭐️⭐️
  • Author
  • Seasoned ⭐️⭐️
  • June 22, 2026

Hi ​@Everton Colling.

Thank you for your reply. Our challenge is to choose the best visualisation depending on the number of data points.

If a threshold is exceeded within a given time interval, then we perform an aggregation (min/max or average – we’re not sure yet).

The range of density in the time series is vast; some may have data points every second, whilst others may have just a few points per day.

 

The strategy that seems to be emerging, therefore, would be to determine the number of data points within the desired time interval in order to decide whether to apply aggregation, as it does not seem possible to have raw data alongside aggregated data. In my view, it is pointless to fetch thousands of data points only to change strategy partway through, isn’t it?