How can I get the task types in the process with api

I would like to filter activities of user task /service task (include excuted and not excuted) in the process instance, is there any API to invoke?

Sorry, your question is not that clear. Can you elaborate?