I have found API calls for product listing like




by default its 10 products and after passing limit its giving specific records, but can we get all the products without using limit and page params?

3 Answers 3


It is not safe to remove limit completely, because your process will get out of memory and fail to return any products on real Magento store one day (when catalog grows to some extent). This is acceptable thing to do only during development for testing purposes.

Instead, pagination mechanisms provided by Magento (page and limit params) should be used to retrieve full catalog by chunks. Every chunk should ideally be processed by the client before requesting the next one to avoid memory issues on the client side. This is the only reliable approach.


While it is not wise to do, yes, you can get all of the products in the system in one call. All you have to do is send the query parameter searchCriteria=0 but, you will need to be Admin Authenticated though.

You do it like this:

curl -X GET http://YOURMAGENTOURL/rest/V1/products?searchCriteria=0 -H 'Content-type: application/json' -H "Authorization: Bearer YOURAPIKEY"

Please modify some code in file : Mage_Catalog_Model_Api2_Product_Rest

Go to this class and find the function _retrieveCollection() and update code as per below.

Updated code:

protected function _retrieveCollection()
    /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */
    $collection = Mage::getResourceModel('catalog/product_collection');
    $store = $this->_getStore();
    $entityOnlyAttributes = $this->getEntityOnlyAttributes($this->getUserType(),
    $availableAttributes = array_keys($this->getAvailableAttributes($this->getUserType(),
    // available attributes not contain image attribute, but it needed for get image_url
    $availableAttributes[] = 'image';
        ->addPriceData($this->_getCustomerGroupId(), $store->getWebsiteId())
        ->addAttributeToSelect(array_diff($availableAttributes, $entityOnlyAttributes))
        ->addAttributeToFilter('visibility', array(
            'neq' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE))
        ->addAttributeToFilter('status', array('eq' => Mage_Catalog_Model_Product_Status::STATUS_ENABLED));
    $dftAll = $collection->getSize();
    $pageSize = $this->getRequest()->getPageSize();
    if (null == $pageSize) {
    $products = $collection->load();

    /** @var Mage_Catalog_Model_Product $product */
    foreach ($products as $product) {
    return $products->toArray();
  • i am getting 404 error, how can i solve the issue, abc.com/api/rest/products?limit=2
    – Gem
    Oct 26, 2018 at 9:25
  • Have you given permission admin side under the REST Roles for the gust user?
    – Abdul
    Oct 26, 2018 at 11:35
  • yes i did that.
    – Gem
    Oct 26, 2018 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.