# How can I fetch average response time of a specific URI?

**URL:** <https://community.dynatrace.com/t/how-can-i-fetch-average-response-time-of-a-specific-uri/19014>\
**Category:** Dynatrace API\
**Tags:** dynatrace-api\
**Created:** [January 8, 2019, 7:43am UTC](https://community.dynatrace.com/t/how-can-i-fetch-average-response-time-of-a-specific-uri/19014 "2019-01-08T07:43:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kohei-saito](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/kohei-saito/32/24190_2.png) [@kohei-saito](https://community.dynatrace.com/u/kohei-saito)\
**Post date:** [January 8, 2019, 7:43am UTC](https://community.dynatrace.com/t/how-can-i-fetch-average-response-time-of-a-specific-uri/19014/1 "2019-01-08T07:43:40Z")

</div>

Hi,

now I understand that we can fetch the average response time of services, for example, via the following TimeseriesAPI.

```auto
https://{your-environment-id}.live.dynatrace.com/api/v1/timeseries/com.dynatrace.builtin:service.responsetime?api-token=XXXXXXXXX&includeData=true&relativeTime=hour&aggregationType=avg&entity=SERVICE-XXXXXXXXX

```

This returns the average of response time of a specific _Service_ named as “_SERVICE-XXXXXXXXX_”.

In the same way as this, is it possible to fetch the average response time of a specific URI?

If possible, which API should I use?

For now, I suppose that I can do this if I set target URLs as “Key requests” and use APIs corresponding to this “Key requests”.

Is this assumption correct?

Regards,

Kohei

---

<div class="post-metadata">

**Author:** ![wolfgang\_beer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/wolfgang_beer/32/14717_2.png) [@wolfgang\_beer](https://community.dynatrace.com/u/wolfgang_beer)\
**Post date:** [January 8, 2019, 7:56am UTC](https://community.dynatrace.com/t/how-can-i-fetch-average-response-time-of-a-specific-uri/19014/2 "2019-01-08T07:56:00Z")

</div>

Hi. For a service you can also fetch the percentiles, etc. but to your question for a specific URL or also called ‘key request’ in Dynatrace you have to first ‘subscribe’ that specific endpoint within your UI service screen. Then you can fetch its metrics through providing a specific metric identifier which are:

 ![19353-sm.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/c/9cc3f3295008d84b9f117d1fc3a8662687a59b8a.png)

 ![19354-kr.png](https://global.discourse-cdn.com/dynatrace/original/2X/f/ff610b9aa34cfe6f71bdecdef381a43fbac79f6d.png)

---

<div class="post-metadata">

**Author:** ![kohei-saito](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/kohei-saito/32/24190_2.png) [@kohei-saito](https://community.dynatrace.com/u/kohei-saito)\
**Post date:** [January 10, 2019, 4:34am UTC](https://community.dynatrace.com/t/how-can-i-fetch-average-response-time-of-a-specific-uri/19014/3 "2019-01-10T04:34:09Z")

</div>

Hi [@Wolfgang B.](https://answers.dynatrace.com/users/12838/view.html).

thanks for your prompt response!

After subscription of specific endpoint URIs at my Dynatrace tenant, I checked if I can retrieve response time of them or not, using such as the following API.

```auto
https://[your-environment-id].live.dynatrace.com/api/v1/timeseries/com.dynatrace.builtin:servicemethod.responsetime?api-token=xxxxxxxxx&includeData=true&relativeTime=hour&aggregationType=avg&entity=SERVICE_METHOD-XXXXXXXX

```

Using this API, I could finally do what I wanted to do.

Thank you very much!

_ **Appendix:** _

In addition to the above, I made some investigations as follows.

I’m glad if they are helpful for you!

**Case1: Without ‘entity’ of GET parameters**

_example API_

```auto
https://[your-environment-id].live.dynatrace.com/api/v1/timeseries/com.dynatrace.builtin:servicemethod.responsetime?api-token=xxxxxxxxx&includeData=true&relativeTime=hour&aggregationType=avg

```

_overview_

This returns response time of **all URIs** subscribed as ‘Key request’ on the tenant.

This enables us to fetch all response time of ‘Key request’ at one time API call and it means that this can keep us from over-consuming API requests limit.

**Case2: With entityID which is not subscribed as ‘Key request’ for ‘entity’**

_example API_

Here, let ‘_SERVICE\_METHOD-YYYYYYYYYY_’ be not subscribed as ‘Key request’

```auto
https://[your-environment-id].live.dynatrace.com/api/v1/timeseries/com.dynatrace.builtin:servicemethod.responsetime?api-token=xxxxxxxxx&includeData=true&relativeTime=hour&aggregationType=avg&entity=SERVICE_METHOD-YYYYYYYYYY

```

_overview_

This returns metric definitions of this _timeseriesIdentifier_ included in this api path\*.\*

_note)_ Here ‘_com.dynatrace.builtin:servicemethod.responsetime_’ is indicated as _timeseriesIdentifier_.

---

<div class="post-metadata">

**Author:** ![wolfgang\_beer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/wolfgang_beer/32/14717_2.png) [@wolfgang\_beer](https://community.dynatrace.com/u/wolfgang_beer)\
**Post date:** [January 10, 2019, 9:14am UTC](https://community.dynatrace.com/t/how-can-i-fetch-average-response-time-of-a-specific-uri/19014/4 "2019-01-10T09:14:13Z")

</div>

Hi,

Yes that behaviour is by design. What you can also do is to use the service ID within the entity filter which will report all subscribed service requests for that selected parent service.

---

<div class="post-metadata">

**Author:** ![kohei-saito](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/kohei-saito/32/24190_2.png) [@kohei-saito](https://community.dynatrace.com/u/kohei-saito)\
**Post date:** [January 11, 2019, 2:14am UTC](https://community.dynatrace.com/t/how-can-i-fetch-average-response-time-of-a-specific-uri/19014/5 "2019-01-11T02:14:19Z")

</div>

Great!

Certainly, with _com.dynatrace.builtin:servicemethod.responsetime,_ when I assign a specific service ID for entity filter\*,\* I can get response time of all of ‘Key request’ associated with service within that entity filter.

Thanks for details!
