# Calculating availability with Maintenance Windows in API

**URL:** <https://community.dynatrace.com/t/calculating-availability-with-maintenance-windows-in-api/39218>\
**Category:** Dynatrace API\
**Tags:** dynatrace-managed, data-explorer, dynatrace-api\
**Created:** [April 10, 2023, 2:42pm UTC](https://community.dynatrace.com/t/calculating-availability-with-maintenance-windows-in-api/39218 "2023-04-10T14:42:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vusal\_Ismayilov](https://avatars.discourse-cdn.com/v4/letter/v/9e8a1a/32.png) [@Vusal\_Ismayilov](https://community.dynatrace.com/u/Vusal_Ismayilov)\
**Post date:** [April 10, 2023, 2:42pm UTC](https://community.dynatrace.com/t/calculating-availability-with-maintenance-windows-in-api/39218/1 "2023-04-10T14:42:17Z")

</div>

Hi everyone,

I use metrics API V2 to see availability for a host, but it gives me a different result than the host detail page. Those are the screen shots of the same host.

 ![Screenshot 2023-04-10 at 16.36.25.png](https://global.discourse-cdn.com/dynatrace/original/3X/0/6/06e0aa094beded448ae49fe588d13bf0a4b96257.png)

 ![Screenshot 2023-04-10 at 16.38.18.png](https://global.discourse-cdn.com/dynatrace/original/2X/0/0d97d26de2c7f76a353751a8d24d006745cf6a3b.png)

as you can see there is 0.02% difference. I use host availability % aka&nbsp;builtin:host.availability metric for the data explorer. As I understand, it is because of the maintenance mode which is not calculated with these metrics.

Do you know any other way to get availability on which maintenance mode will be included or is there any way for that in the API?

Happy Easter 🙂

---

<div class="post-metadata">

**Author:** ![ChadTurner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/chadturner/32/161_2.png) [@ChadTurner](https://community.dynatrace.com/u/ChadTurner)\
**Post date:** [May 25, 2023, 7:38pm UTC](https://community.dynatrace.com/t/calculating-availability-with-maintenance-windows-in-api/39218/2 "2023-05-25T19:38:41Z")

</div>

I would check your time frames and host entity to ensure that you are looking at the same apples to apples. Maintenance windows are designed to preserve availability metrics and therefor you should have the same values from the host page to the data explorer page.
