# Retrieving Apdex score for specific app or entity

**URL:** <https://community.dynatrace.com/t/retrieving-apdex-score-for-specific-app-or-entity/35115>\
**Category:** Dynatrace API\
**Tags:** apdex, dynatrace-api\
**Created:** [May 11, 2022, 12:42pm UTC](https://community.dynatrace.com/t/retrieving-apdex-score-for-specific-app-or-entity/35115 "2022-05-11T12:42:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![CPC](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@CPC](https://community.dynatrace.com/u/CPC)\
**Post date:** [May 11, 2022, 12:42pm UTC](https://community.dynatrace.com/t/retrieving-apdex-score-for-specific-app-or-entity/35115/1 "2022-05-11T12:42:39Z")

</div>

I need to be able to GET the apdex score of a specific application/entity, but can’t figure out how to do it via api.&nbsp; In Postman I’m using the following, which I found online:

https://[HOST]/e/[ID]/api/v1/timeseries?relativeTime=hour&aggregationType=count&timeseriesId=com.dynatrace.builtin:app.apdex&queryMode=total

and it’s returning a lot (everything?) including what I believe is the apdex score I’m looking for (please correct me if I’m wrong?).

Ex (0.57 and 0.95​😞

{&nbsp;&nbsp;&nbsp;&nbsp;“result”:&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“dataPoints”:&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“APPLICATION-70271671F7DA1232”:&nbsp;[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1652268060000,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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bsp;&nbsp;“APPLICATION-70271671F7DA1232”:&nbsp;“[app1].[domain].com”&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; “APPLICATION-2104433A851141A1”:&nbsp;“[app2].[domain].com”,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[clipped]and much much more.Is there a way to request just the apdex score for a single application - i.e. the 0.57 from&nbsp;APPLICATION-70271671F7DA1232?&nbsp; What about the entity name along with that specific 0.57 value?An additional ask would be how to retrieve them all, but in a format similar to:[entity]&nbsp; [apdex score][app1].[domain].com&nbsp; 0.57[app2].[domain].com 0.95The goal is to simply “dashboard” the value(s) in an external application.I’m new to APIs and Dynatrace, so if you can please explain it like I’m 5?Thank you

---

<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:** [May 11, 2022, 1:48pm UTC](https://community.dynatrace.com/t/retrieving-apdex-score-for-specific-app-or-entity/35115/2 "2022-05-11T13:48:20Z")

</div>

I recommend using the [Metrics v2](https://www.dynatrace.com/support/help/shortlink/api-metrics-v2-get-datapoints)&nbsp;API instead as it is much more powerful.

To retrieve Apdex all applications application you can query the metric:

```markup
builtin:apps.web.apdex.userType

```

For example - fetching it for last 1 week timeframe, including the entity names:

```markup
curl -X GET "<your_environment>/api/v2/metrics/query?metricSelector=builtin%3Aapps.web.apdex.userType%3AsplitBy%28%22dt.entity.application%22%29%3Anames%3Aavg%3Aauto&from=now-1w" -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token <your_api_token>"

```

The Metrics API uses metric selectors to describe the metric queries, in the example we used:

```markup
builtin:apps.web.apdex.userType:splitBy("dt.entity.application"):names:avg:auto

```

This will retrieve the metric, split it by the application (so you have numbers for each app) and it uses the :name transformation to add the entity (application) name in the result. The data points in a bucket are average.  
There are plenty of [metric selector transformations](https://www.dynatrace.com/support/help/shortlink/api-metrics-v2-selector) you can use.

To filter it for a specific entity, you can use the either the entitySelector query parameter for the API or the :filter parameter in the metric selector. For example the entitySelector in your case will be :

```markup
entityId("APPLICATION-2104433A851141A1")

```

---

<div class="post-metadata">

**Author:** ![CPC](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@CPC](https://community.dynatrace.com/u/CPC)\
**Post date:** [May 11, 2022, 2:35pm UTC](https://community.dynatrace.com/t/retrieving-apdex-score-for-specific-app-or-entity/35115/3 "2022-05-11T14:35:01Z")

</div>

Thank you for the reply.&nbsp; The curl statement returns much, but I’m not sure how I’d format the uri for use with Postman, and subsequently the api call in the external app’s interface.&nbsp; Can you please provide a full example?&nbsp; of both the curl and Postman GET including the entityId entitySelector you mention - I’ve tried using entityId before, but it always errors out, so where/how to use it isn’t clear to me.

Thank you.

---

<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:** [May 11, 2022, 7:12pm UTC](https://community.dynatrace.com/t/retrieving-apdex-score-for-specific-app-or-entity/35115/4 "2022-05-11T19:12:08Z")

</div>

The entitySelector is just another parameter for the API call. In the example above the cURL command will be changed to:

curl -X GET “\<your\_environment\>/api/v2/metrics/query?metricSelector=builtin%3Aapps.web.apdex.userType%3AsplitBy%28%22dt.entity.application%22%29%3Anames%3Aavg%3Aauto&from=now-1w\*\*&entityId%28%22APPLICATION-2104433A851141A1%22%29\*\*” -H “accept: application/json; charset=utf-8” -H “Authorization: Api-Token \<your\_api\_token\>”

I don’t use Postman at all, so I won’t navigate you how to do that in postman. Maybe will find the&nbsp;[preconfigured collections](https://github.com/pahofmann/dynatrace-postman-collections) by [@Patrick\_Hofman1](https://community.dynatrace.com/user/31920)&nbsp;useful.

---

<div class="post-metadata">

**Author:** ![CPC](https://avatars.discourse-cdn.com/v4/letter/c/58f4c7/32.png) [@CPC](https://community.dynatrace.com/u/CPC)\
**Post date:** [May 11, 2022, 8:41pm UTC](https://community.dynatrace.com/t/retrieving-apdex-score-for-specific-app-or-entity/35115/5 "2022-05-11T20:41:57Z")

</div>

Thanks, again.&nbsp; that latest curl statement still seems to be pulling everything, for every APPLICATION-\*.

I have been able to get a little closer using Postman using your suggestions, it’s still retrieving every APPLICATION, but the format’s a little easier to read, and the apdex I’m looking for appears to be the 1st value in a list of dozens/hundreds.&nbsp; Just need to pare that down a bit.  
The Patrick Hofman collections look promising, but there seems to be lorem ipsum throughout, and I don’t know what to replace with what.  
I’ll keep digging - thank you again for your help.

---

<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:** [May 12, 2022, 7:00am UTC](https://community.dynatrace.com/t/retrieving-apdex-score-for-specific-app-or-entity/35115/6 "2022-05-12T07:00:46Z")

</div>

No, it will definitely filter out only the application you need. But it will receive datapoints for the interval specified.

If you need a single value, then you need to apply the :fold(avg) transformation to the metric selector:

```markup
builtin:apps.web.apdex.userType:splitBy("dt.entity.application"):names:avg:auto:fold(avg)

```

Then you will see only a single value (appdex average for the interval).

---

<div class="post-metadata">

**Author:** ![MarwanC](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marwanc/32/34480_2.png) [@MarwanC](https://community.dynatrace.com/u/MarwanC)\
**Post date:** [December 17, 2025, 12:18pm UTC](https://community.dynatrace.com/t/retrieving-apdex-score-for-specific-app-or-entity/35115/7 "2025-12-17T12:18:01Z")

</div>

And in DQL how can we do this?

---

<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:** [December 17, 2025, 12:27pm UTC](https://community.dynatrace.com/t/retrieving-apdex-score-for-specific-app-or-entity/35115/8 "2025-12-17T12:27:01Z")

</div>

[@MarwanC](https://community.dynatrace.com/user/64346)&nbsp; RUM in Grail is not yet generally available and apdex is not (yet) a part of it anyway.

---

<div class="post-metadata">

**Author:** ![MarwanC](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marwanc/32/34480_2.png) [@MarwanC](https://community.dynatrace.com/u/MarwanC)\
**Post date:** [December 17, 2025, 12:35pm UTC](https://community.dynatrace.com/t/retrieving-apdex-score-for-specific-app-or-entity/35115/9 "2025-12-17T12:35:22Z")

</div>

Thanks. But may I am not up to date on this, can I use the API call in side my dashboard?

---

<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:** [December 17, 2025, 2:39pm UTC](https://community.dynatrace.com/t/retrieving-apdex-score-for-specific-app-or-entity/35115/10 "2025-12-17T14:39:05Z")

</div>

[@MarwanC](https://community.dynatrace.com/user/64346)&nbsp;Sure you can!  
You need to use the classic environment api and code tile. Quick and dirty code follows:

```javascript
import { metricsClient } from "@dynatrace-sdk/client-classic-environment-v2";

export default async function () {
  const data = await metricsClient.query({
    metricSelector: "builtin:apps.web.apdex.userType:splitBy(\"dt.entity.application\"):names:avg:auto:fold(avg)",
    acceptType: "application/json; charset=utf-8",
  });

 return data.result[0].data.map(result => (
   { "dt.entity.application": result.dimensionMap["dt.entity.application"], 
     "dt.entity.application.name": result.dimensionMap["dt.entity.application.name"],
     "apdex":result.values[0] 
   }) );
}

```

See it in action in [playground](https://wkf10640.apps.dynatrace.com/ui/intent/dynatrace.notebooks/view-code#%7B%22dt.code%22%3A%22import%20%7B%20metricsClient%20%7D%20from%20%5C%22%40dynatrace-sdk%2Fclient-classic-environment-v2%5C%22%3B%5Cn%5Cnexport%20default%20async%20function%20()%20%7B%5Cn%20%20const%20data%20%3D%20await%20metricsClient.query(%7B%5Cn%20%20%20%20metricSelector%3A%20%5C%22builtin%3Aapps.web.apdex.userType%3AsplitBy(%5C%5C%5C%22dt.entity.application%5C%5C%5C%22)%3Anames%3Aavg%3Aauto%3Afold(avg)%5C%22%2C%5Cn%20%20%20%20acceptType%3A%20%5C%22application%2Fjson%3B%20charset%3Dutf-8%5C%22%2C%5Cn%20%20%7D)%3B%5Cn%20%20%5Cn%5Cn%20return%20data.result%5B0%5D.data.map(result%20%3D%3E%20(%5Cn%20%20%20%7B%20%5C%22dt.entity.application%5C%22%3A%20result.dimensionMap%5B%5C%22dt.entity.application%5C%22%5D%2C%20%5Cn%20%20%20%20%20%5C%22dt.entity.application.name%5C%22%3A%20result.dimensionMap%5B%5C%22dt.entity.application.name%5C%22%5D%2C%5Cn%20%20%20%20%20%5C%22apdex%5C%22%3Aresult.values%5B0%5D%20%5Cn%20%20%20%7D)%20)%3B%5Cn%7D%22%2C%22visualization%22%3A%22table%22%2C%22visualizationSettings%22%3A%7B%22autoSelectVisualization%22%3Afalse%2C%22chartSettings%22%3A%7B%22gapPolicy%22%3A%22connect%22%7D%2C%22singleValue%22%3A%7B%22alignment%22%3A%22center%22%2C%22label%22%3A%22%22%2C%22autoscale%22%3Atrue%7D%2C%22table%22%3A%7B%22hiddenColumns%22%3A%5B%5D%2C%22lineWrapIds%22%3A%5B%5D%2C%22firstVisibleRowIndex%22%3A0%7D%7D%7D).
