cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Search API for Mobile App

Creating Search API for Mobile App

Hi Community

 

We all know that magento provides api to filter products. Now I wants to extract all filters like brands, sizes and other attributes from filtered results. For website, we know that we have layered navigation but how to implement it for mobile app.

 

Just I required to loop over all products and fetch attributes. Does it make sense when list of products is larger?

2 REPLIES

Re: Creating Search API for Mobile App

Hi @test _magento

 

okay i understand !! Well Magento 2 have searchCriteria filter  options for Rest API.

 

Using this SearchCriteria you can passed whatever filter you would like to give as conditions same way filters with filtergroups as well.

 

Here i am sharing devdocs link how you can use SearchCriteria with magento 2 rest api  - https://devdocs.magento.com/guides/v2.2/rest/performing-searches.html

 

Also you might have seen swagger for rest api , still for reference here is the link for the Magento 2 Rest api - https://devdocs.magento.com/swagger/

 

if issue solved,Click Kudos & Accept as Solution

Re: Creating Search API for Mobile App

Sorry! If am not clear in my question. 

 

For example, if I search products by particular category e.g. fashion. Now I want all sub-categories (e.g. men and women) and all brands from my search results and possible colors from my search results which I used when I further refine my search results.

 

This I want to achieve for mobile apps.