Get domain statistics API

Applies to:

Want to experience Microsoft Defender for Endpoint? Sign up for a free trial.


If you are a US Government customer, please use the URIs listed in Microsoft Defender for Endpoint for US Government customers.


For better performance, you can use server closer to your geo location:


API description

Retrieves the statistics on the given domain.


  1. Rate limitations for this API are 100 calls per minute and 1500 calls per hour.
  2. The maximum value for lookbackhours is 720 hours (30 days).


One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Use Microsoft Defender for Endpoint APIs

Permission type Permission Permission display name
Application URL.Read.All 'Read URLs'
Delegated (work or school account) URL.Read.All 'Read URLs'


When obtaining a token using user credentials:

  • The user needs to have at least the following role permission: 'View Data' (For more information, see Create and manage roles)

HTTP request

GET /api/domains/{domain}/stats

Request headers

Header Value
Authorization Bearer {token}. Required.

Request URI parameters

Name Type Description
lookBackHours Int32 Defines the hours we search back to get the statistics. Defaults to 30 days. Optional.

Request body



If successful and domain exists - 200 OK, with statistics object in the response body. If domain doesn't exist - 200 OK with a prevalence set to 0.


Request example

Here's an example of the request.


Response example

Here's an example of the response.

    "@odata.context": "$metadata#microsoft.windowsDefenderATP.api.InOrgDomainStats",
    "host": "",
    "organizationPrevalence": 4070,
    "orgFirstSeen": "2017-07-30T13:23:48Z",
    "orgLastSeen": "2017-08-29T13:09:05Z"


Do you want to learn more? Engage with the Microsoft Security community in our Tech Community: Microsoft Defender for Endpoint Tech Community.