SharePoint REST API to retrieve more than 5000 items.

If you have ever worked on SharePoint REST API, you may have notice that by default it returns only 100 records.

The OData provider for the SharePoint REST API is configured to limit the number of items in a response to 100. It protects against developers accidentally making a request that returns large result sets.

Use “$top” to retrieve more than 100 items but up to 5000 only:

Below is the example on how to use $top :

.webAbsoluteUrl + "/_api/web/lists/getbytitle('myList')/items?$top=1000


Note: 

  • $top — It is used to control the page size. We can use $top to get more than 100 items but there is also limitation that you cannot get more than 5000 items using $top.

But what if I want to retrieve more than 5000 items ?

Continue reading