Answers.Body: <p>You need to use <code>options.limit</code> to make this work.</p>
  
  <blockquote>
    <p>options.limit : The maximum number of records to return. You can make this unlimited by setting the value to 0.</p>
  </blockquote>
  
  <p><strong>Usage</strong></p>
  
  <pre><code>$result = civicrm_api3('Membership', 'get', array(
    'membership_type_id' =&gt; "$level",
    'options' =&gt; array('limit' =&gt; 1000),
  ));
  </code></pre>
  
  <p>Get more details on the <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API#UsingtheAPI-Options" rel="nofollow noreferrer">different parameters you can use under <code>options</code></a>.</p>
  
  <p>Also check : <a href="https://civicrm.stackexchange.com/questions/2932/how-do-i-get-more-than-25-records-from-the-api/4339#4339">How do I get more than 25 records from the API?</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-14T15:11:40.007Z
Answers.Text: Thank you.  For some dim reason I thought what I was passing was the options array...  Much obliged.
Answers.UserDisplayName: jerrygarciuh
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-14T09:07:55.953Z
Answers.LastActivityDate: 2015-12-14T12:40:13.197Z
Answers.LastEditDate: 2017-04-13T12:53:13.167Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>Can anyone explain why limit here has no effect?  Still get 25 results every time.  Also tried <code>'api.Contact.get' =&gt; array(array('limit' =&gt; 1000))</code></p>
  
  <p>Using offset to recurse through the set works but is a nuisance.</p>
  
  <pre><code> require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm.settings.php';
   require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php';
   $config = CRM_Core_Config::singleton( );
   require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm/api/api.php';
   $result = civicrm_api3('Membership', 'get', array(
      'membership_type_id' =&gt; "$level",
      'limit' =&gt; 1000,
      'api.Contact.get' =&gt; array(),
   ));
  </code></pre>
  
Tags: <civimember><api>
Title: Limit is ignored in civicrm_api3('Membership', 'get')
ThreadText: # Limit is ignored in civicrm_api3('Membership', 'get')
  
  (Asked by: username_0 on 2015-12-13)
  
  Can anyone explain why limit here has no effect? Still get 25 results every time. Also tried `'api.Contact.get' => array(array('limit' => 1000))`
  
  Using offset to recurse through the set works but is a nuisance.
  
  ```
   require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm.settings.php';
   require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm/CRM/Core/Config.php';
   $config = CRM_Core_Config::singleton( );
   require_once $_SERVER['DOCUMENT_ROOT'] . '/wp-content/plugins/civicrm/civicrm/api/api.php';
   $result = civicrm_api3('Membership', 'get', array(
      'membership_type_id' => "$level",
      'limit' => 1000,
      'api.Contact.get' => array(),
   ));
  
  ```
  
  **Tags:** civimember, api
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-12-14. Score: 6 | Accepted answer
  
  You need to use `options.limit` to make this work.
  
  > options.limit : The maximum number of records to return. You can make this unlimited by setting the value to 0.
  
  **Usage**
  
  ```
  $result = civicrm_api3('Membership', 'get', array(
    'membership_type_id' => "$level",
    'options' => array('limit' => 1000),
  ));
  
  ```
  
  Get more details on the [different parameters you can use under `options`](http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API#UsingtheAPI-Options).
  
  Also check : [How do I get more than 25 records from the API?](https://civicrm.stackexchange.com/questions/2932/how-do-i-get-more-than-25-records-from-the-api/4339#4339)
  
  > **Comments:**
  > **username_0**: Thank you.  For some dim reason I thought what I was passing was the options array...  Much obliged.  
  
  ---
  
  