How Can I get app environment url (stag or test machine etc)

I want to learn my app current environment url to call related endpoint.
My app environment should be www.stag.x.com or www.jc-1234.com
I would like to learn this url.
Is there any appium method?