Hi @Stefank ,
Hope you are doing well.
Please refer below Microsoft article for filtering Sharepoint site.
site-list (APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported.)
Only the following query options are currently supported:
GET /sites?$filter=siteCollection/root ne null
GET https://graph.microsoft.com/v1.0/sites?$select=siteCollection,webUrl&$filter=siteCollection/root ne null
Response :
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites(siteCollection,webUrl)",
"value": [
{
"webUrl": "https://raiinfy.sharepoint.com/",
"siteCollection": {
"hostname": "raiinfy.sharepoint.com",
"root": {}
}
}
]
}
We can also used Search API to search any sharepoint site using below graph API endpoint.
GET https://graph.microsoft.com/v1.0/sites?search=displayName
GET https://graph.microsoft.com/v1.0/sites?search=Communication site
Response :
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"value": [
{
"createdDateTime": "2020-12-15T07:34:59Z",
"id": "raiinfy.sharepoint.com,e3a2252f-d91d-4c03-a670-682e77bbe8ba,2eb77667-cf78-4295-8130-333b77d4807a",
"lastModifiedDateTime": "2020-12-05T20:24:21Z",
"name": "raiinfy.sharepoint.com",
"webUrl": "https://raiinfy.sharepoint.com",
"displayName": "Communication site",
"root": {},
"siteCollection": {
"hostname": "raiinfy.sharepoint.com"
}
}
]
}
POST https://graph.microsoft.com/v1.0/search/query
Body
{
"requests": [
{
"entityTypes": [
"site"
],
"query": {
"queryString": "Communication site"
}
}
]
}
Response :
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.searchResponse)",
"value": [
{
"searchTerms": [
"communication",
"site"
],
"hitsContainers": [
{
"total": 2,
"moreResultsAvailable": false,
"hits": [
{
"hitId": "raiinfy.sharepoint.com,e3a2252f-d91d-4c03-a670-682e77bbe8ba,2eb77667-cf78-4295-8130-333b77d4807a",
"rank": 1,
"summary": "<c0>Site</c0> Home 1 153 {7CC3543F<ddd/>",
"resource": {
"@odata.type": "#microsoft.graph.site",
"displayName": "Communication site",
"id": "raiinfy.sharepoint.com,e3a2252f-d91d-4c03-a670-682e77bbe8ba,2eb77667-cf78-4295-8130-333b77d4807a",
"createdDateTime": "2020-12-15T07:34:59Z",
"lastModifiedDateTime": "2020-12-05T20:24:21Z",
"name": "raiinfy.sharepoint.com",
"webUrl": "https://raiinfy.sharepoint.com"
}
}
]
}
]
}
]
}
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".