# Retrieve data by monitor name?

**URL:** <https://community.dynatrace.com/t/retrieve-data-by-monitor-name/20262>\
**Category:** Dynatrace API\
**Tags:** python, dynatrace-api\
**Created:** [September 11, 2020, 8:00am UTC](https://community.dynatrace.com/t/retrieve-data-by-monitor-name/20262 "2020-09-11T08:00:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lisa\_Singh01](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/lisa_singh01/32/38981_2.png) [@Lisa\_Singh01](https://community.dynatrace.com/u/Lisa_Singh01)\
**Post date:** [September 11, 2020, 8:00am UTC](https://community.dynatrace.com/t/retrieve-data-by-monitor-name/20262/1 "2020-09-11T08:00:05Z")

</div>

Is there a way download data from the API that shows the monitor display name rather than the unique ID (SYNTHETIC\_TEST-0000000000014ADD style ID)?

I’m using python requests:

```auto
import requests
import pandas as pd
import io

URL = "https://ABCDE.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin%3Asynthetic.browser.totalDuration&from=now-2d&to=now-1d"
headers = {"Authorization": "Api-Token " + "3qub092adsfaf3", "accept": "application/json"}
urlData = requests.get(URL, headers=headers).content
rawData = pd.read_json(io.StringIO(urlData.decode('utf-8')))

```

---

<div class="post-metadata">

**Author:** ![rene\_forstner](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@rene\_forstner](https://community.dynatrace.com/u/rene_forstner)\
**Post date:** [September 11, 2020, 8:37am UTC](https://community.dynatrace.com/t/retrieve-data-by-monitor-name/20262/2 "2020-09-11T08:37:35Z")

</div>

You could use the names transformator:

```auto
api/v2/metrics/query?metricSelector=builtin%3Asynthetic.browser.totalDuration:<strong>names</strong>&from=now-2d&to=now-1d

```

Will return:

“result”: [{“metricId”: “builtin:synthetic.browser.totalDuration:names”,“data”: [{“dimensions”: [“ **yourname** ”,“SYNTHETIC\_TEST-57FE2AA4BBAF72E3”],“timestamps”: [1599640800000,1599641400000,1599642000000,

---

<div class="post-metadata">

**Author:** ![Lisa\_Singh01](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/lisa_singh01/32/38981_2.png) [@Lisa\_Singh01](https://community.dynatrace.com/u/Lisa_Singh01)\
**Post date:** [September 11, 2020, 9:11am UTC](https://community.dynatrace.com/t/retrieve-data-by-monitor-name/20262/3 "2020-09-11T09:11:51Z")

</div>

Oh you just made my day. Thank you so much for such a quick answer!

I’d read the help page on selector transformations, but the one thing it didn’t mention was how to embed them into a URL (I suppose I should/could have worked that out but I’m new to this API stuff).
