Magento-2 we would like to filter the products from REST API

I have filtered product by price in the frontend please check the result in the below screenshot

(24-MB02 price and special price we set at admin end)


enter image description here

But API Level:-

the same product 24-MB02 is missing

Api Url:- /rest/V1/products/[filterGroups][0][filters][0][field]=category_id&searchCriteria[filterGroups][0][filters][0][value]=4&searchCriteriafilterGroups[filters][0][field]=price&searchCriteriafilterGroups[filters][0][value]=40&searchCriteriafilterGroups[filters][0][condition_type]=gteq&searchCriteriafilterGroups[filters][0][field]=price&searchCriteriafilterGroups[filters][0][value]=50&searchCriteriafilterGroups[filters][0][condition_type]=lteq

But result we are getting 4 products

enter image description here


enter image description here

Please help on this. Thanks. How to achieve this?


public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria)
        /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */
        $collection = $this->collectionFactory->create();

        $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
        $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');

        $this->collectionProcessor->process($searchCriteria, $collection);


        $searchResult = $this->searchResultsFactory->create();

        foreach ($collection->getItems() as $product) {
                        $product->hasData(\Magento\Catalog\Model\Product::STORE_ID) ? $product->getStoreId() : null

        return $searchResult;
  • Any updates on this. – Pushpendra Singh Jan 8 '18 at 11:25
  • @PushpendraSingh i didn't get any fix, still my issue exist, may i know whether u have any idea ? – Nagaraju K Jan 9 '18 at 11:03
  • I am facing same issue, unfortunately currently I have no Idea. – Pushpendra Singh Jan 9 '18 at 13:06
  • Hi @PushpendraSingh i am also trying same from my end, if u found any solution or fix please share me thanks – Nagaraju K Jan 9 '18 at 14:28
  • Any updates on this – shivashankar m Jan 18 '18 at 6:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.