# How to get memory metrics of all host in the account

**URL:** <https://community.dynatrace.com/t/how-to-get-memory-metrics-of-all-host-in-the-account/38631>\
**Category:** Open Q&A\
**Tags:** dynatrace-managed\
**Created:** [February 28, 2023, 3:08pm UTC](https://community.dynatrace.com/t/how-to-get-memory-metrics-of-all-host-in-the-account/38631 "2023-02-28T15:08:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kethind](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@kethind](https://community.dynatrace.com/u/kethind)\
**Post date:** [February 28, 2023, 3:08pm UTC](https://community.dynatrace.com/t/how-to-get-memory-metrics-of-all-host-in-the-account/38631/1 "2023-02-28T15:08:49Z")

</div>

Hi ,

How can I export memory metrics of all the hosts in the account.

I tried using using Data explorer, metrics API but it will allow only top 100 entries.

---

<div class="post-metadata">

**Author:** ![agravier](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/agravier/32/29303_2.png) [@agravier](https://community.dynatrace.com/u/agravier)\
**Post date:** [February 28, 2023, 5:39pm UTC](https://community.dynatrace.com/t/how-to-get-memory-metrics-of-all-host-in-the-account/38631/2 "2023-02-28T17:39:35Z")

</div>

Hello [@kethind](https://community.dynatrace.com/user/57759) ,

I recommand checking the Dynatrace api client Python :

> **[GitHub - dynatrace-oss/api-client-python: Dynatrace API Python client](https://github.com/dynatrace-oss/api-client-python)**
>
> Dynatrace API Python client

With the example below :

```auto
# Get all hosts and some properties
for entity in dt.entities.list('type("HOST")', fields="properties.memoryTotal,properties.monitoringMode"):
    print(entity.entity_id, entity.display_name, entity.properties)

```

Regards Aurélien

---

<div class="post-metadata">

**Author:** ![sharjeelb](https://avatars.discourse-cdn.com/v4/letter/s/e480ec/32.png) [@sharjeelb](https://community.dynatrace.com/u/sharjeelb)\
**Post date:** [February 28, 2023, 7:39pm UTC](https://community.dynatrace.com/t/how-to-get-memory-metrics-of-all-host-in-the-account/38631/3 "2023-02-28T19:39:34Z")

</div>

You can use below api to get this memory information,

https://{environmentid}.live.dynatrace.com/api/v2/entities?entitySelector=type(“HOST”)&entitySelector=type(“HOST\_GROUP”)&fields=properties.detectedName,properties.memoryTotal,properties.isMonitoringCandidate,tags,managementZones&pageSize=1000&Api-Token={Your api access token with appropriate permission}
