# V2 or V1 API Call to show platform

**URL:** <https://community.dynatrace.com/t/v2-or-v1-api-call-to-show-platform/33929>\
**Category:** Dynatrace API\
**Tags:** dynatrace-api\
**Created:** [January 30, 2022, 3:35pm UTC](https://community.dynatrace.com/t/v2-or-v1-api-call-to-show-platform/33929 "2022-01-30T15:35:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![louis\_gallo](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@louis\_gallo](https://community.dynatrace.com/u/louis_gallo)\
**Post date:** [January 30, 2022, 3:35pm UTC](https://community.dynatrace.com/t/v2-or-v1-api-call-to-show-platform/33929/1 "2022-01-30T15:35:46Z")

</div>

I can pull metrics quite nicely now for hosts, process group instances, and custom devices.

My question is if there is an API call that can show the platform for an entity - i.e. Windows, Linux, OpenShift, other?

Any help is appreciated.

Thanks,

Lou

---

<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:** [January 30, 2022, 9:28pm UTC](https://community.dynatrace.com/t/v2-or-v1-api-call-to-show-platform/33929/2 "2022-01-30T21:28:26Z")

</div>

Sure there is. You need to call the [Monitored Entities v2](https://www.dynatrace.com/support/help/dynatrace-api/environment-api/entity-v2) API to fetch information about any entities.&nbsp; For example to query OS Type for a host you need to specify +properties.osType in the fields query parameter.  
Be sure to use API client for the API such as [dt](https://github.com/dynatrace-oss/api-client-python) if it fits your scenario..  
If you want to to query OS type of a process group, you can query it using relationships. For example to query HOST running a PROCESS\_GROUP\_INSTANCE:

```markup
type(HOST),toRelationships.isProcessOf(entityId(PROCESS_GROUP_INSTANCE-0945C0E96C7D297A))

```

---

<div class="post-metadata">

**Author:** ![louis\_gallo](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@louis\_gallo](https://community.dynatrace.com/u/louis_gallo)\
**Post date:** [February 3, 2022, 10:28pm UTC](https://community.dynatrace.com/t/v2-or-v1-api-call-to-show-platform/33929/3 "2022-02-03T22:28:49Z")

</div>

Thank you for the reply.

If I can only have a dt.host.name, I assume that I have to convert that to an entityId first right? How can I do that. Most of my data coming back as dt.host.name.

Hopefully that makes sense.

---

<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:** [February 5, 2022, 6:54pm UTC](https://community.dynatrace.com/t/v2-or-v1-api-call-to-show-platform/33929/4 "2022-02-05T18:54:37Z")

</div>

It depends. You can also query host by host names and fetch the host properties. You can query the host by the entitySelector:

```markup
type(HOST),entityName(....)

```
