Ha!
This post by @TrystanLea had the times in milliseconds - I’ve only just spotted it.
http://localhost/emoncms/feed/data.json?id=195&start=1609598790000&end=1609598791000&interval=1
AND THEN…
/feed/data.json?id=1&start=1635083272000&end=1635083332000&interval=10 gives me data
[[1635083272000,150],[1635083282000,149],[1635083292000,149],[1635083302000,148],[1635083312000,149],[1635083322000,148],[1635083332000,148],[1635083342000,148]]
My hunch was right, the code has been changed, but not the documentation; or vice versa.
@TrystanLea: the Feed API Help needs updating.
The cause of the error message is in the function get_data(…) in PHPFina.php:
It’s assumed that the incoming data is in milliseconds, and it’s converted to seconds, but if it’s already seconds and the difference is small, the subsequent check for end > start fails because the two are equal (the difference was in the 3 least significant digits). And when the difference became enough, it returned an empty array because there’s no data in January, 1970 - which is when start=1635083
$start = intval($start/1000);
$end = intval($end/1000);
$interval= (int) $interval;
// Minimum interval
if ($interval<1) $interval = 1;
// End must be larger than start
if ($end<=$start) return array('success'=>false, 'message'=>"request end time before start time");
But the underlying problem is quite simply, the documentation is inaccurate:
All the references I’ve seen to the Unix Timestamp specify it as a count of seconds, not milliseconds.