For web applications you can often reverse engineer the internal / non-documented APIs using the development tools of your browser or network traffic analysis such as Wireshark. As a last resort for software without APIs you can always use robotics tools and automatically use the GUI as a user would do. You could for example check out the Selenium framework for Java.
Are there already studies on the long-term effect on people’s weight? I lost (and gained) weight quite often in my life and I would say without changing habits and the structure of your life, it’s impossible to achieve a permanent effect.
If weight loss is iduced with medication only, I would expect the effect to stop as soon as you stop taking the substance.
Or is such a prescription typically coupled with sport programs and health counseling?