Get all sites API not returning number of items specified with $top parameter

Saiyam 2 Reputation points
2025-01-31T12:48:43.4866667+00:00

Hi

I am trying to fetch all non-personal sites for an organization using the getAllSites Graph API, but I am not receiving the number of items specified in the top parameter, even though more items are available via nextLink.

How can I retrieve a specific number of sites with a filter?

URL : GET https://graph.microsoft.com/v1.0/sites/getAllSites?$top=3&$select=name, ispersonalSite&$filter=ispersonalSite eq false

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites(name,isPersonalSite)",
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/sites/getAllSites?$top=3&$select=name%2c+ispersonalSite&$filter=ispersonalSite+eq+false&$skiptoken=UGFnZWQ9VFJVRSZwX1RpbWVEZWxldGVkPSZwX0lEPTQ2Mzc3",
    "value": [
        {
            "name": "A149",
            "isPersonalSite": false
        },
        {
            "name": "A146",
            "isPersonalSite": false
        }
    ]
}
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,919 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.