2

How do I search for Team Sites and Communication Sites using SharePoint Search REST API?

2

You need to use the below endpoint:

/_api/search/query?querytext='contentclass:sts_site webtemplate=SITEPAGEPUBLISHING 
webtemplate=GROUP'&rowlimit=500

The base template value of Communication site is SITEPAGEPUBLISHING and that of modern team site backed by O365 group is GROUP.

Reference - List all communication sites in SPO

Get list of all O365 group sites

Note - at the moment, private groups are not visible via search even if you are a member of the group.

  • Nice. You were faster ;) – Marko Tica Jan 22 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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