using web API from Heapster in kubernetes
Question has been answered in the above comment section.
In order to access the Node as well as Pod Metrics, It's better to use Metrics_server which is the successor of heapster.
The metrics server collects CPU and memory usage for nodes and pods by pooling data from Kubelet.
View nodes and pods metrics:
kubectl get --raw "/apis/metrics.k8s.io/v1beta1/nodes"
kubectl get --raw "/apis/metrics.k8s.io/v1beta1/pods"