Api help

you can't unless for some reason the browser/snap decides it wants to send its battery data with the request (which it has no reason to and therefore does not)

You can build an HTML/JS page, with Node, that tells the browser to get the battery info and send it to your backend. But nothing to do with :snap:
I'm afraid you are asking the helper question instead of your real problem or making some false assumption.

i did but how do i run the html page

You should load the URL of your server "by hand.". Or convince another app to show your page. It's called XSS and is a form of security breach. I'm quite sure it's not your intention but it becomes tiring to guess what are you trying to achieve.

yeah what im hearing is that since the battery code can only be run client side its impossible to make an api for it

https://xyproblem.info/

Last desperate attempt :frowning: get battery info with node.js · GitHub

FYI I did this a few years ago using python (with flask IIRC ) but found that the response times for making a request and getting a result returned were too long fro practical use

ill do my best

Glitch runs on a containerized environment, which doesn't allow executing system commands like upower, pmset, or WMIC. These commands are meant to retrieve battery information from the underlying operating system, but Glitch doesn't have direct access to the OS in the same way a local machine would.

if you were running that on the server, it would attempt to get the server's battery anyway, not the client's battery.