I’ve been using Home assistant for like 6 years and have never had a need to query the API.
If you are not a strong coder, why are you doing this?
Certainly there is a better to do whatever it is.
To actually help you it would be good to know what you are trying to accomplish.
How to help us help you - or How to ask a good question.