# Problem duration from API

**URL:** <https://community.dynatrace.com/t/problem-duration-from-api/39379>\
**Category:** Alerting\
**Tags:** problem-detection, dynatrace-api\
**Created:** [April 19, 2023, 10:05pm UTC](https://community.dynatrace.com/t/problem-duration-from-api/39379 "2023-04-19T22:05:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shakib](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@shakib](https://community.dynatrace.com/u/shakib)\
**Post date:** [April 19, 2023, 10:05pm UTC](https://community.dynatrace.com/t/problem-duration-from-api/39379/1 "2023-04-19T22:05:16Z")

</div>

So I need to see how long over the past 90 days problems were remaining open before they got resolved.  
I looked at the problem API and ran a quick request, but the problem duration is not the data that gets returned (which makes no sense at all, I mean I can see that as a field and it’s being calculated by Dynatrace, so why not allow me to use it in the API?).

I was wondering if anyone else has encountered this problem or if anyone has any suggestions for how to tackle this?

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [April 20, 2023, 6:59am UTC](https://community.dynatrace.com/t/problem-duration-from-api/39379/2 "2023-04-20T06:59:57Z")

</div>

Hi,

This is not showed directly but you have this information in the JSON answer:

- “startTime”:&nbsp;1681969860000,
- “endTime”:&nbsp;1681972740000

Then, something as this “endTime - startTime / 1000 / 60” will return problem duration in minutes. Just an example.Best regards
