0

On a SharePoint Modern site, at the bottom of each page there is a small footer that contains the Like button and number of views.

Where does this like count go though?

It is not stored in the classic LikesCount column as I expected and I cannot find any documentation on it anywhere.

Can this data even be retrieved by the REST API?

1
  • I have found that there is a hidden column called "_likeCount" that holds the value - however I cannot seem to access using the REST API still
    – Jason
    Oct 23, 2018 at 14:18

1 Answer 1

2

The likes count is stored in a separate data store.

You can access it via REST API.

To access the likes count of a modern page, you can use the below endpoint:

/_api/web/lists/GetByTitle('Site Pages')/GetItemById(<ID>)/
likedByInformation?$expand=likedby&$top=10

The result will give you likeCount as below. Please do its not quite well documented :

enter image description here

For comments information, you can refer to Vardhman Deshpande's excellent blog post

Documentation - Microsoft.SharePoint.Likes.likedByInformation

4
  • Is this possible to get the like count for list items or is the only way to do another call per item?
    – Jason
    Oct 23, 2018 at 15:08
  • if you want it for all pages, you can use it as /_api/web/lists/GetByTitle('Site Pages')/items?$expand=likedByInformation Oct 23, 2018 at 15:11
  • doing that only returns the number of likes from the rating column not the new modern count - which is where my problem is
    – Jason
    Oct 23, 2018 at 15:22
  • ohhh, in that case would suggest that you make a REST API call for each page list item as i mentioned in the answer. This is a bummer :( Oct 23, 2018 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.