Working with the SharePoint REST API is now the norm. It makes it easier for us to work with SharePoint sites and lists/libraries. One of the drawback of the SharePoint API is the size  of the payload that is returned. Not the actual data size, but the amount of meta data that accompanies it.

SharePoint online and SharePoint 2016 now supports JSON Light. JSON Light is an open standard that allows developers to provide in the header of the request how much metadata is returned. You can check out the spec from  Microsoft OData JSON spec document

The usual way to call the SharePoint REST API was to include in the header request: accept: application/json; odata=verbose. The good news is that, this header is now optional, and more OData options have been added.

Now you can significantly reduce the payload of your calls using one of these other options.

Option 1: verbose

accept: application/json; odata=verbose

The example data returned is 46,647 bytes

Option 2: minimalmetadata

accept: application/json; odata=minimalmetadata

The example data returned is 11,173 bytes

JSON results with pagination

Option 3: nometadata

accept: application/json; odata=nometadata

The nometadata option reduces the size of the payload significantly, and for many scenarios this is all that you need when working with list items. The example data returned is 6,832 bytes

JSON results with pagination

Option 4: Don’t provide it

accept: application/json

It is no longer necessary to  provide the OData property in the request header, unless you would like to specify one of the values above. This defaults to minimalmetadata option.