In Magento2 API, how would I filter by multiple categories?


When the category ids are 105,106,107 I am getting results, but if the category ids are 107,106,105 I am getting empty items.

How can I search for different categories in Magento2 API?

2 Answers 2


For multiple values need to use in please refer below devdocs 

**Note**: In your search criteria it ill take first category id only.
  • If it takes only first category then it will be a problem. If first category not having any products then we will get the empty results . same happening in my case as well. Any solution for this?
    – Dinesh
    Commented Feb 25, 2019 at 8:55
  • If you use eq it will happen like that yous should use in while you are using multiple categories Commented Feb 25, 2019 at 12:34

Example with Guzzle:

        $response = $this->client->get('/rest/V1/products', [
        'search_criteria' => [
            'current_page' => $currentPage,
            'page_size' => $pageSize,
            'filter_groups' => [
                    'filters' => [
                            'field' => 'category_id',
                            'value' => '23356,23355',
                            'condition_type' => 'in'

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.