Research url path variable vs query parameter

Found the answer in https://medium.com/@fullsour/when-should-you-use-path-variable-and-query-parameter-a346790e8a6d

"If you want to identify a resource, you should use Path Variable. But if you want to sort or filter items, then you should use query parameter."