Which API should I call to get data of memory utilization, cpu utilization ?

Which API should I call to get data of memory utilization, cpu utilization ?

Hello,

Can you guide me to get data of memory utilization, CPU utilization chart by calling which API? I have attached an image of the charts.

Which API should I call to get data of memory utilization, CPU utilization mentioned above?