So you used an existing binary that hits the special kernel API to query the batteries. If you want to do it yourself (ex. to make your own graphical widget or something) then you have to hit that API yourself. And yes, sysfs is sort of an API too, but it's a simple, uniform API that in many cases can just be used via read() instead of needing to figure out some specialized interface.