# How can we get metrics related to a particular application using an API?

**URL:** <https://community.dynatrace.com/t/how-can-we-get-metrics-related-to-a-particular-application-using-an-api/19856>\
**Category:** Dynatrace API\
**Tags:** profiling-and-optimization, dynatrace-api\
**Created:** [July 21, 2020, 8:04am UTC](https://community.dynatrace.com/t/how-can-we-get-metrics-related-to-a-particular-application-using-an-api/19856 "2020-07-21T08:04:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![r786khanna](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@r786khanna](https://community.dynatrace.com/u/r786khanna)\
**Post date:** [July 21, 2020, 8:04am UTC](https://community.dynatrace.com/t/how-can-we-get-metrics-related-to-a-particular-application-using-an-api/19856/1 "2020-07-21T08:04:28Z")

</div>

Hi

Is there any API with which I can fetch all the metrics like CPU, Memory etc. for a particular application or any service which is being monitored by dynatrace ?

---

<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 21, 2020, 1:14pm UTC](https://community.dynatrace.com/t/how-can-we-get-metrics-related-to-a-particular-application-using-an-api/19856/2 "2020-07-21T13:14:05Z")

</div>

Yes, anything that you can include in a custom chart can be polled through the metrics API:

> **[Metrics API v2](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/metric-v2)**
>
> Retrieve metric information via Metrics v2 API.

---

<div class="post-metadata">

**Author:** ![r786khanna](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@r786khanna](https://community.dynatrace.com/u/r786khanna)\
**Post date:** [July 22, 2020, 12:30pm UTC](https://community.dynatrace.com/t/how-can-we-get-metrics-related-to-a-particular-application-using-an-api/19856/3 "2020-07-22T12:30:18Z")

</div>

Thanks for your quick response

But i need some more info on this  
Suppose i created a custom chart and pinned that to dashboard  
now can you please suggest me how to fetch the data from that chart using API

how can i create a metrics API for that chart?

---

<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 22, 2020, 3:55pm UTC](https://community.dynatrace.com/t/how-can-we-get-metrics-related-to-a-particular-application-using-an-api/19856/4 "2020-07-22T15:55:15Z")

</div>

You don’t pull data from charts, using the API you are accessing the same underlying datastore that the custom charts themselves use.

---

<div class="post-metadata">

**Author:** ![r786khanna](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@r786khanna](https://community.dynatrace.com/u/r786khanna)\
**Post date:** [July 22, 2020, 4:20pm UTC](https://community.dynatrace.com/t/how-can-we-get-metrics-related-to-a-particular-application-using-an-api/19856/5 "2020-07-22T16:20:10Z")

</div>

Okay

Can you please guide me from where i can create the APIs which can fetch the data from datastore (datastore used by custom chart).

---

<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 22, 2020, 6:16pm UTC](https://community.dynatrace.com/t/how-can-we-get-metrics-related-to-a-particular-application-using-an-api/19856/6 "2020-07-22T18:16:44Z")

</div>

The API I linked initially is the ‘interface’ that you interact with to pull that data out of Dynatrace.

> **[Metrics API v2](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/metric-v2)**
>
> Retrieve metric information via Metrics v2 API.

You create an API token (in the settings \> integration \> Dynatrace API) and then you use that token to query the API which is described in the link above. All you would need to get started is described in the main page for the API (e.g. authentication) and it described how to try things out using the API explorer.

> **[Dynatrace API](https://docs.dynatrace.com/docs/dynatrace-api)**
>
> Find out what you need to use the Dynatrace API.

---

<div class="post-metadata">

**Author:** ![r786khanna](https://avatars.discourse-cdn.com/v4/letter/r/3da27b/32.png) [@r786khanna](https://community.dynatrace.com/u/r786khanna)\
**Post date:** [July 23, 2020, 4:24am UTC](https://community.dynatrace.com/t/how-can-we-get-metrics-related-to-a-particular-application-using-an-api/19856/7 "2020-07-23T04:24:24Z")

</div>

Thanks for guiding, James.
