This post by @TrystanLea had the times in milliseconds - I’ve only just spotted it.
/feed/data.json?id=1&start=1635083272000&end=1635083332000&interval=10 gives me data
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 = 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.