How to find out URL/domain

I have written a small authorization module for owncloud/nextcloud. To add some features I am looking for some variable where the actual URL or domain is stored which I can access from an app like user_external. Any hints?