Sorry , octoprint request help

Hello , I have a raspberry octoprint connected to a printer.
Also I have a central server working and I can click on button and then I can see everything on raspberry’s however I just wanna know how I can access info from state of the printer, I would like to see an example on how to do this request on JavaScript.
Thanks for help !

I think you want the Octoprint API: http://docs.octoprint.org/en/master/api/

Well yeah I think so.
How do you perform a JavaScript request get to the API ?

Here's an example. I linked to the API, you'll need to learn Javascript on your own.