how to remove duplicate in view search API?
Depending on your setup there are different reasons why you can get duplicates. A common reason is, that you're using related entities (nodes, taxonomies). Let's say you got a content type car with a taxonomy term that shows the car's color. If you create a relationship between car and color in your view, you can see duplicates if a car has multiple colors.

There are three different options that allow you to reduce duplicates.

In the view's ADVANCED tab you can find USE AGGREGATION and QUERY SETTINGS. Try out which of them works for your use case. 



Inside QUERY SETTINGS you can find the DISTINCT option.



If you enable USE AGGREGATION your fields and filters will receive a new option AGGREGATION SETTINGS where you can define the type of aggregation (ie. Group results, Minimum, Maximum, etc.)



When you add fields to your FILTER CRITERIA there is another setting to prevent duplicate entries when a filter is applies.



But beware, complex views tend to get slow when aggregation is enabled.