title: How to retrieve all media entries in Kaltura, beyond the 10k mark?
body: <p>I am using the php5.3 SDK: <a href="https://github.com/kaltura/KalturaGeneratedAPIClientsPHP53" rel="nofollow noreferrer">https://github.com/kaltura/KalturaGeneratedAPIClientsPHP53</a>
  We have 90k media entries, but I can only got 20k entries. The following code is straight forward. Could anyone help me out?</p>
  
  <pre><code>// Main entry point
  public function mywrite(Route $route, Console $console)
  {
  // Max records is 500, the range cannot be too big.
  $range = 3600 * 24;
  $this-&gt;__mywrite($route, $console, $range);
  }
  
  // Count how many objects we can get
  // $veryStartDate == 1446173087, sep 2015
  // $maxDate == 1526469375, may 2018
  public function __mywrite($route, $console, $range) {
  $configObj = $this-&gt;readMyWriteHistoryConfigFile();
  $lastProcessObj = $this-&gt;readMyWriteLastProcessFile();
  
  // 
  $veryStartDate = $configObj-&gt;veryStartDate;
  $maxDate = $configObj-&gt;maxDate;
  
  // Set start Date
  $startDate = $veryStartDate;
  $endDate = $startDate + $range;
  
  //
  $totalCount = 0;
  while($startDate &lt;= $maxDate) {
      $objs = $this-&gt;listMediaByLastPlay($startDate, $endDate);
  
      $totalCount += count($objs);
  
      echo "\n$startDate - $endDate:\n";
      echo "\n". count($objs). "\n";
  
      $startDate = $endDate + 1;
      $endDate = $endDate + $range;
  } // end while loop
  
  // we get like 25k records, but we have 90k records....
  echo "\ncount: $totalCount\n";
  }
  
  
   // we call the client and get records by start last play date and end last play date
   public  function listMediaByLastPlay($startDate, $endDate) {
      // Page size
      $pageSize = 1000;
      // Client with admin
      $client = $this-&gt;getClient(\KalturaSessionType::ADMIN);
      // media
      $mediaObj = $client-&gt;media;
  
      // Set a range to pull, order by last played at
      $filter = new \KalturaMediaEntryFilter();
      $filter-&gt;lastPlayedAtGreaterThanOrEqual = $startDate;
      $filter-&gt;lastPlayedAtLessThanOrEqual = $endDate;
      $filter-&gt;orderBy = '+lastPlayedAt';
  
      // We still want more records
      $pager = new \KalturaFilterPager();
      $pager-&gt;pageSize = $pageSize;
  
      // now list.....
      $arr = $mediaObj-&gt;listAction($filter, $pager)-&gt;objects;
      $buf = array();
  
      foreach($arr as $k =&gt; $v) {
        $t = array();
  
        $t['dataUrl'] = $v-&gt;dataUrl;
        $t['flavorParamsIds'] = $v-&gt;flavorParamsIds;
  
        $t['plays'] = $v-&gt;plays;
        $t['views'] = $v-&gt;views;
        $t['lastPlayedAt'] = $v-&gt;lastPlayedAt;
  
        $buf[] = $t;
      }
  
      return $buf;
  
  }
  </code></pre>