# What is the best method to work with API extracted data?

**URL:** <https://community.dynatrace.com/t/what-is-the-best-method-to-work-with-api-extracted-data/33397>\
**Category:** Dynatrace API\
**Tags:** dynatrace-api\
**Created:** [November 28, 2021, 9:45am UTC](https://community.dynatrace.com/t/what-is-the-best-method-to-work-with-api-extracted-data/33397 "2021-11-28T09:45:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuvalKonstanti](https://avatars.discourse-cdn.com/v4/letter/y/5f9b8f/32.png) [@YuvalKonstanti](https://community.dynatrace.com/u/YuvalKonstanti)\
**Post date:** [November 28, 2021, 9:45am UTC](https://community.dynatrace.com/t/what-is-the-best-method-to-work-with-api-extracted-data/33397/1 "2021-11-28T09:45:03Z")

</div>

Hello all,

I hope I will make my question clear;

I want to extract data using Dynatrace API, to look for hosts that are listed as “Monitoring Candidate” and so on…

I find it hard to work with the extracted data from the API, for example, if I’m extracting the list of hosts, I see many parameters I don’t need. I want for example to filter only the “Monitoring Candidates” but I don’t know how.

You guys have any tips? a software I can use to work with?

Thank you.

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [November 28, 2021, 10:29am UTC](https://community.dynatrace.com/t/what-is-the-best-method-to-work-with-api-extracted-data/33397/2 "2021-11-28T10:29:01Z")

</div>

Hi&nbsp;[@YuvalKonstanti](https://community.dynatrace.com/user/41788)

In order to make the output more useful you can:

1. Convert the json to csv with some online converters and work on the CSV.
2. Use [Host Report (by Erik Landsness)](https://docs.google.com/spreadsheets/d/1ggWi_LtZPXjLLzOs_UoiHry8Jn4C2F8Qzc9DgrDJAZc/edit#gid=1453612701)&nbsp;just save it to your google drive, add your tenant id and token in config tab and run it from the dynatrace menu entry.
3. Connect your rest API with your company BI tools and play with data as you like.

HTH

Yos

---

<div class="post-metadata">

**Author:** ![adam\_gardner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/adam_gardner/32/20087_2.png) [@adam\_gardner](https://community.dynatrace.com/u/adam_gardner)\
**Post date:** [November 29, 2021, 2:01am UTC](https://community.dynatrace.com/t/what-is-the-best-method-to-work-with-api-extracted-data/33397/3 "2021-11-29T02:01:36Z")

</div>

The new /api/v2 “monitored entities” set of endpoints make this easier.

First, have a look at the possible properties for a particular entity (eg. HOST)

```auto
GET https://abc12345.live.dynatrace.com/api/v2/entityTypes/ENTITY-TYPE<br>eg.<br>GET https://abc12345.live.dynatrace.com/api/v2/entityTypes/HOST

```

Gives:

```auto
{
  "type": "HOST",
  "displayName": "Host",
  "dimensionKey": "dt.entity.host",
  "entityLimitExceeded": false,
  "properties": [<br> ...

```

```auto
{
      "id": "isMonitoringCandidate",
      "type": "Boolean",
      "displayName": "isMonitoringCandidate"
    }<br> ...<br> ]

```

Now get the hosts and ask for that additional property:

```auto
GET https://abc12345.live.dynatrace.com/api/v2/entities?entitySelector=type(HOST)&fields=properties.isMonitoringCandidate

```

Gives

```auto
<span>{</span>
  <span>"totalCount"</span><span>:</span> <span>1</span><span>,</span>
  <span>"pageSize"</span><span>:</span> <span>50</span><span>,</span>
  <span>"entities"</span><span>:</span> <span>[</span><span>{</span>
      <span>"entityId"</span><span>:</span> <span>"HOST-1234706CD0451ABC"</span><span>,</span>
      <span>"displayName"</span><span>:</span> <span>"myHostname"</span><span>,</span>
      <span>"properties"</span><span>:</span> <span>{</span>
        <span>"isMonitoringCandidate"</span><span>:</span> <span>false</span>
      <span>}</span>
    <span>}</span><span>]</span>
<span>}</span>

```

---

<div class="post-metadata">

**Author:** ![adam\_gardner](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/adam_gardner/32/20087_2.png) [@adam\_gardner](https://community.dynatrace.com/u/adam_gardner)\
**Post date:** [November 29, 2021, 2:04am UTC](https://community.dynatrace.com/t/what-is-the-best-method-to-work-with-api-extracted-data/33397/4 "2021-11-29T02:04:19Z")

</div>

```markup
GET https://abc12345.live.dynatrace.com/api/v2/entities?entitySelector=type(HOST)&fields=properties.isMonitoringCandidate

```

To see all valid properties for an entity:

```markup
https://abc12345.live.dynatrace.com/api/v2/entityTypes/HOST

```
