Hi,
1.
You could access the instance guid via PageInfo object. From the PageInfo you can get the template information (PageTemplateInfo), now you are able to access the requested zone and get the list of available webpars. And, finally, from this list you could access guid information about appropriate webpart.
Here is a code example:
PageInfo pi = PageInfoProvider.GetPageInfo(...);
PageTemplateInfo pt = pi.PageTemplateInfo;
WebPartZoneInstance wpzi = pt.GetZone("zoneID");
ArrayList al = wpzi.WebParts;
2. Using CMS.Controls.CMSControlsHelper.GetFilter / SetFilter methods.
Best regards,
Ivana Tomanickova