# Reading DEM Consumption with API

**URL:** <https://community.dynatrace.com/t/reading-dem-consumption-with-api/19886>\
**Category:** Dynatrace API\
**Tags:** dynatrace-managed, dynatrace-api, licensing\
**Created:** [July 23, 2020, 2:05pm UTC](https://community.dynatrace.com/t/reading-dem-consumption-with-api/19886 "2020-07-23T14:05:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![urs\_fischer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/urs_fischer/32/7896_2.png) [@urs\_fischer](https://community.dynatrace.com/u/urs_fischer)\
**Post date:** [July 23, 2020, 2:05pm UTC](https://community.dynatrace.com/t/reading-dem-consumption-with-api/19886/1 "2020-07-23T14:05:52Z")

</div>

Hello, is there a possible way to read the monthly DEM Consumption on Applications. For Host Units there is a possible way with “consumedHostUnits” from “/entity/infrastructure/hosts”, but what is with the DEM? I search something like “consumedDEMUnits” 🙂

Since we have to charge the DEM consumption per application per month internally, this would be very helpful.

---

<div class="post-metadata">

**Author:** ![JamesKitson](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jameskitson/32/22460_2.png) [@JamesKitson](https://community.dynatrace.com/u/JamesKitson)\
**Post date:** [July 23, 2020, 2:34pm UTC](https://community.dynatrace.com/t/reading-dem-consumption-with-api/19886/2 "2020-07-23T14:34:03Z")

</div>

Have you looked at if any of the metrics under the ‘Billing’ category will help? You should be able to calculate DEM consumption based off of these:

 ![25845-1595514836296.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/b/3bec1b82a02265a28f30e7d6025afef33e96a232.png)

---

<div class="post-metadata">

**Author:** ![urs\_fischer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/urs_fischer/32/7896_2.png) [@urs\_fischer](https://community.dynatrace.com/u/urs_fischer)\
**Post date:** [July 23, 2020, 2:57pm UTC](https://community.dynatrace.com/t/reading-dem-consumption-with-api/19886/3 "2020-07-23T14:57:44Z")

</div>

Thanks, well i need the DEM Consumption from API because i have to give this Numbers forward to another system (i already use python for that).

---

<div class="post-metadata">

**Author:** ![JamesKitson](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jameskitson/32/22460_2.png) [@JamesKitson](https://community.dynatrace.com/u/JamesKitson)\
**Post date:** [July 23, 2020, 3:08pm UTC](https://community.dynatrace.com/t/reading-dem-consumption-with-api/19886/4 "2020-07-23T15:08:25Z")

</div>

I used the custom chart just to show what metrics are available, but all of these that are available there are also available through the v2 metrics API:

 ![25846-1595516894914.png](https://global.discourse-cdn.com/dynatrace/original/2X/e/edca282fb8cebed008d0969d8e972b8ec195cfea.png)

---

<div class="post-metadata">

**Author:** ![larry\_roberts](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/larry_roberts/32/7131_2.png) [@larry\_roberts](https://community.dynatrace.com/u/larry_roberts)\
**Post date:** [July 23, 2020, 5:34pm UTC](https://community.dynatrace.com/t/reading-dem-consumption-with-api/19886/5 "2020-07-23T17:34:25Z")

</div>

We currently use these as well. It will be even better once custom metrics are added as well.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [July 24, 2020, 7:16am UTC](https://community.dynatrace.com/t/reading-dem-consumption-with-api/19886/6 "2020-07-24T07:16:14Z")

</div>

I do believe calculation of spent DEMs based on these values is just an approximation of the real DEMs spent. A user session might be split into several ones (sessions with more than 200 actions). I think each of such session will be counted here, but just a first one will be billed. You can see that when opening a session:

![25856-1595574968155.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/8/8830059e13eead3d4ad50f8163f97725c9652d63.png)
