Is it possible to download datapoints since specified time for a single goal through the API?

I can download all datapoints for a goal, or datapoints dince some time for all goals. But what about marrying these two options?

1 Like

Yes, indirectly, but it’s a hack because the datapoints endpoint doesn’t appear to support either diff_since or datapoints_count.

Workaround is to fetch the goal object with the datapoint constraints, and then return the datapoints instead of the goal…

Here, have some perl from my

# bizarre implementation because datapoints.json doesn't respect diff_since
sub beemfetchsince {
  my ( $u, $g, $t ) = @_;

  my $ua = LWP::UserAgent->new;
  my $uri = $beembase .

  my $resp = $ua->get($uri);
  beemerr('GET', $uri, {}, $resp);
  my $results = decode_json($resp->content);

  return $results->{datapoints};
1 Like

Thanks, it worked! See