Just check whether the below query helps for Alternate parts.
QueryResult qr = wt.part.WTPartHelper.service.getAlternatesWTPartMasters(WTPartMaster);
Similarly you can use below API for Substitute Parts. The below API will give u Usage Link from which you can get the WTPartMaster.
getSubstitutesWTPartMasters(WTPartUsageLink usageLink)
HTH
Regards,
Ratnadeep