How to access externally via Python

Hello, I have set up a test system on a RaspberryPi and taught some ZigBee components. I would now like to control these or other actuators and read sensors from the outside with a Python script, i.e. use the Home Assistant only as a gateway. Is that possible? Is there any API or HTTP access available?

Yes, see the External API part of the developer docs