@ekevu123 don't see why not. Running selfhosted custom apps is part of Cloudron. We run many custom apps which expose an API (but mostly nodejs).
https://ipv4.api.cloudron.io/api/v1/helper/public_ip and https://ipv6.api.cloudron.io/api/v1/helper/public_ip 🙂 for example gives your public IP.