Get most viewed clips of the week


I want to get the most viewed clips of the week. So I tried it with the parameter started_at, but I get this result:

{"error":"Bad Request","status":400,"message":"parsing time \"2020-05-11T00:00:00 02:00\" as \"2006-01-02T15:04:05Z07:00\": cannot parse \"\" as \"Z07:00\""}

why? code is :

$date = date('c', strtotime('2020-05-11 00:00:00'));

$headers = [
	'Client-ID: '.$clientid,
	'Authorization: Bearer '.$access_token,
$handle = curl_init(''.$date);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($handle);

can someone help me?

Z means Zulu as in +/- Nothing


should be


So what to change ? If I output the $date I get it with T:


You need to url encode that, as a + is a space. so you have to URL encode the + to %2b

$handle = curl_init(''.$date);


$handle = curl_init(''.urlencode($date));


$date = date('Y-m-d\TH:i:sP', strtotime('2020-05-11 00:00:00'));

You need the RFC3339 format

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.