Sharepoint 2013 REST API not returning all items for a list

You can use RowLimit & RowsPerPage in rest call. Below is the example

$.ajax({
url: siteurl + "/_api/web/lists/getbytitle('NewList')/items",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
RowLimit : null, //Specify the row limit
RowsPerPage : null, //Specify no of rows in a page
success: function (data) {
     $('#oDataFilter').append("<table>");
     $.each(data.d.results, function(index, item){
         $('#oDataFilter').append("<tr><td class="+styleClass+">" + item.ID + "</td><td class="+styleClass+">"+ item.Title + "</td></tr>");
     });
     $('#oDataFilter').append("</table>");
},
error: function (error) {
    alert('Error getListItems :: '+JSON.stringify(error));
}

Adding to Christophe's answer I would say listing all (potentially 5000) items in a list and parsing them would result in performance issues.

If you query sharepoint to show all items in a particular list it would only print out the first 100. But the xml response also provides the url to query for the next 100 list items.

At the very end of the xml response you will see a tag like this

<link rel="next" href="https://xxxxx.sharepoint.com/_api/web/lists/GetByTitle('list')/items?%24skiptoken=Paged%3dTRUE%26p_ID%3d100" />

The url inside href="...."is what you'll need.

Querying the above would provide you with a list of the next 100 or less items. If there are still more items left this xml response would in turn provide an other <link rel="next"> tag and if not this tag won't exist.

Better to handle 5000 items in sets of 100 rather than them all together in my opinion.


The limitation is due to server side paging.

A workaround is to retrieve 100 items at a time, or override the limitation by entering a count of items:

https://$DOMAIN/$SITE/_api/web/Lists/getByTitle('$LIST')/Items?$top=1000

Note that there is also a threshold at 5000.