Filter Commits by message and branch at once

I want to filter commits by commit message for specific branch.
But git lab API support two resource via commits and search api.

Ex :
Commits API
Here we can filter by branch, but not by message.

Search API
this we cant filter by branch.

Is there any way filter commits for specific branch ?
Or is there any way to compare commits of two branches and get diff ?