How to get SharePoint list item counts using REST API?

Hello SharePointers

Below is REST API code to get the sharepoint list item counts using REST API.

var ListUrl = _spPageContextInfo.webServerRelativeUrl + “/_api/web/lists/getbytitle(‘yourlistname’)/items”;
var itemsCount = data.d.results.length; 


function getJsonFormat(ListUrl)
return $.ajax({
url: ListUrl,
type: “GET”,
contentType: “application/json;odata=verbose”,
headers: {
“Accept”: “application/json;odata=verbose”

Happy SharePointing Folks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *