Sylius API: How to implement "Find products by attribute value"

Hi Sylius people!

I would like to get products by attribute values via the API. The current Sylius APIv2 ( supports only the retrieval of products by name or taxons. What would be the recommended approach to implement this?

I see currently 2 possible solution proposals:

  • Writing a custom endpoint and querying the database and output some json
  • Extend the API-Platform Product resource and adding some attribute filter

What would be your approach?

I have used now the first approach by extending the API using a custom API filter, check details here: (also make sure using the correct API Platform doc version).

You need to copy the whole API resource config and add your custom API filter to the list of filters. Check also the Sylius docs here: