Spark really does not disclose this information, it is hidden in the Wizard and transmitted to the WebUI.
However, you can use a little hack, WebUI supports JSON by adding / json / to the page.
So, going to http://<master-host>:<master-port>/json/ will only return the information you are looking for:
{ url: "spark://<host>:<port>", workers: [ ], cores: 0, coresused: 0, memory: 0, memoryused: 0, activeapps: [ ], completedapps: [ ], activedrivers: [ ], status: "ALIVE" }
source share