As far as I know, there is only CSOM API AppCatalog class provides querying capabilities for discovering installed Apps, in particular AppCatalog.GetAppInstances method retrieves the installed app instances. In server side object model, there is no such function to fetch apps in app catalog. You can refer to the following document
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.