Sure, it's possible to query the site for App info -- the SDK has lots of details on this: https://learn.microsoft.com/en-us/mem/configmgr/develop/.
However, the problem will be credentials as there is no user context during the task sequence to be able to do this so you'd have to prompt for the credentials of user that has the necessary permissions.
There are two things that I can think of to address your challenge:
- Use a separate configuration file that is stored somewhere centrally (not your DPs and not in your package) that your script accesses to get the info. That way, when you update the configuration file, nothing needs to be updated in the script or on the DPs. The config file would be super small (I can't image more than 10 or 20 KB) and so would not cause any real issues.
- Use a web service to query the site for the info you need and call the web service from your script. The web service would be configured with the necessary permissions. This is technically a security hole though so you'd have to control and monitor the service and the account tightly.