title: Google drive api upload User rate limit exceeded
body: <p>I'm using <code>PHP SDK</code> to copy files to <strong>Google Drive</strong>, my account can use unlimited storage</p>
  
  <p>After 300-500 files uploaded, User rate limit exceeded show up and i can't upload until next day</p>
  
  <pre><code>{
    "code": 403,
    "message": "User rate limit exceeded."
  }
  
  function copydrive($driveid,$folder,$newname){
      $fileMetadata = new Google_Service_Drive_DriveFile(array(
          'name' =&gt; $newname,
          'parents' =&gt; array($folder)
      ));
      $result = $GLOBALS['service']-&gt;files-&gt;copy($driveid, $fileMetadata);
      return $result-&gt;id;
  }
  $newid = copydrive($episode['drive'],$folderid,$filename);
  if($newid!=''){
      $qrun2=$conn-&gt;prepare("update episode set mydrive='".$newid."' where id=".$episode['id']);
      $qrun2-&gt;execute();
      echo "&lt;script language='javascript'&gt;";
      echo 'setTimeout(function(){window.location.reload(1);}, 2000);';
      echo "&lt;/script&gt;";
  }
  </code></pre>
  
  <p><strong>Update</strong> using batching request still getting error</p>
  
  <pre><code>$qrun=$conn-&gt;prepare("SELECT * FROM episode WHERE drive!='' and mydrive is null limit 50");
  $qrun-&gt;execute();
  $episode=$qrun-&gt;fetchAll();
  $batch = $service-&gt;createBatch();
  $num=0;
  foreach($episode as $item){
      $fileMetadata = new Google_Service_Drive_DriveFile(array(
          'parents' =&gt; array('parent folder id')
      ));
      $result = $GLOBALS['service']-&gt;files-&gt;copy($item['drive'], $fileMetadata);
      $batch-&gt;add($result,'copy-'.$num);
      $num++;
  }
  $results = $batch-&gt;execute();
  $total_rs = count($results);
  for($x=0;$x&lt;$total_rs;$x++){
      $qrun2=$conn-&gt;prepare("update episode set mydrive='".$results['response-copy-'.$x]-&gt;id."' where id=".$episode[$x]['id']);
      $qrun2-&gt;execute();
  }
  </code></pre>
  
  <p>In API dashboard the request in 1 hour is 344</p>
  
  <p><a href="https://i.stack.imgur.com/Ska2N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ska2N.png" alt="enter image description here"></a></p>