<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: User Session\Action API Get User count for application in Real User Monitoring</title>
    <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/195608#M3903</link>
    <description>&lt;P&gt;Greetings Joshua,&lt;/P&gt;&lt;P&gt;I'm currently trying to get the same exact data as Robert, I was checking the Timeseries API but I couldn't understand how this can be possible using it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was also reading and find out that there's an "extrapolationLevel" field that according to the documentation, it means:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;SPAN&gt;The number is the denominator of a fraction and indicates the amount of actual data. The value&amp;nbsp;&lt;/SPAN&gt;1&lt;SPAN&gt;&amp;nbsp;means that the result contains only the actual data. The value&amp;nbsp;&lt;/SPAN&gt;4&lt;SPAN&gt;&amp;nbsp;means that result is calculated using 1/4 of the actual data.&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;How can I change this value in order to be set to 1 since I've tried passing it on the params request but it seems like it is not mutable.&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here's an example of my results:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Request:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import requests

headers = {
    'accept': 'application/json',
    'Authorization': 'Api-Token dt0c01.xxxxxx-xxxxxxx',
}

params = {
    'query': 'SELECT COUNT(DISTINCT ip) AS \'distinct_ip\' FROM usersession WHERE (userType=\'REAL_USER\' AND (useraction.application=\'sandals.com\' OR userevent.application=\'sandals.com\' OR usererror.application=\'sandals.com\')) LIMIT 1000',
    'startTimestamp': '3600000',
    'addDeepLinkFields': 'false',
    'explain': 'false',
}

response = requests.get('https://hudxxxxx.live.dynatrace.com/api/v1/userSessionQueryLanguage/table', params=params, headers=headers)

print(response.json())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Response:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
  "extrapolationLevel": 4,
  "columnNames": [
    "distinct_ip"
  ],
  "values": [
    [
      1489990
    ]
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;According to my Session Query results, the "values" should be around 500-600ish&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
    <pubDate>Fri, 30 Sep 2022 15:51:12 GMT</pubDate>
    <dc:creator>Montalvo</dc:creator>
    <dc:date>2022-09-30T15:51:12Z</dc:date>
    <item>
      <title>User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117711#M1716</link>
      <description>&lt;P&gt;I am trying to use the API to get real user counts per application.  I have tried the following but it isn't matching what the console is showing.  Can someone shed some light on this?  It seems I am getting a fraction of the userids and some of the ones that are anon it is returning those as 'null'&lt;/P&gt;&lt;P&gt;select usersession.userid FROM usersession where usersession.userType = 'REAL_USER' AND useraction.application = 'My Awesome Application' GROUP BY  usersession.userid&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 May 2019 16:20:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117711#M1716</guid>
      <dc:creator>robert_auten</dc:creator>
      <dc:date>2019-05-01T16:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117712#M1717</link>
      <description>&lt;P&gt;It looks like the API is capping at 50 rows.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 May 2019 16:36:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117712#M1717</guid>
      <dc:creator>robert_auten</dc:creator>
      <dc:date>2019-05-01T16:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117713#M1718</link>
      <description>&lt;P&gt;Yep I found where you can set this: The framework always applies an upper limit to prevent system overload. If &lt;CODE&gt;LIMIT&lt;/CODE&gt; is not used, 50 results are returned by default.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 May 2019 18:59:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117713#M1718</guid>
      <dc:creator>robert_auten</dc:creator>
      <dc:date>2019-05-01T18:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117714#M1719</link>
      <description>&lt;P&gt;I believe from my testing the maximum rows that can be returned is 5000. So, adding a "LIMIT 5000" to the end of the USQL request would be required..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jul 2025 18:59:03 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117714#M1719</guid>
      <dc:creator>joshua_dtrace</dc:creator>
      <dc:date>2025-07-05T18:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117715#M1720</link>
      <description>&lt;P&gt;Yes I was able to get it to return the data although if I tell it to give me the count of userids in the query, the number doesn't match the user count from the User session console.  I am thinking I don't have a filter or it is ignoring the timeframe filter because each time I run the query the number changes.  &lt;/P&gt;&lt;P&gt;Query I am trying:&lt;/P&gt;&lt;P&gt;startTimestamp=1556733966561&amp;amp;endTimestamp=1556737361768&amp;amp;query=select count(userid) FROM usersession where usersession.userType = 'REAL_USER' AND useraction.application = 'My Awesome App' LIMIT 5000&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 May 2019 19:38:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117715#M1720</guid>
      <dc:creator>robert_auten</dc:creator>
      <dc:date>2019-05-01T19:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117716#M1721</link>
      <description>&lt;P&gt;Hey Robert!&lt;/P&gt;&lt;P&gt;The USQL and User Sessions API only work for completed/finished sessions, whereas the in-UI User Sessions page will also show "Live"/in-progress sessions.&lt;/P&gt;&lt;P&gt;If your timestamp is recent enough, this could be the reason why you are seeing differences.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2025 17:36:09 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117716#M1721</guid>
      <dc:creator>joshua_dtrace</dc:creator>
      <dc:date>2025-07-14T17:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117717#M1722</link>
      <description>&lt;P&gt;Yes, I set the startime to be 0 so that it will give me the last 2 hours and I changed the UI to show me the last 2 hours? I am trying to get the unique users that have access my website in the last hour.  The same data that shows up when I click on the User Sessions in the UI.  You are saying though that the API will only give me the completed correct? I am just trying to get a count of how many users have been to my website in the last 2 hours.  So this would be the count of users that have completed sessions and current live users.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 May 2019 20:04:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117717#M1722</guid>
      <dc:creator>robert_auten</dc:creator>
      <dc:date>2019-05-01T20:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117718#M1723</link>
      <description>&lt;P&gt;Live sessions are most commonly seen during the last 2 hours, so that is correct that the USQL results will be different by only having the completed sessions displayed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2025 17:36:32 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117718#M1723</guid>
      <dc:creator>joshua_dtrace</dc:creator>
      <dc:date>2025-07-14T17:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117719#M1724</link>
      <description>&lt;P&gt;Is there any way in the API to get live session data?  If I am only counting completed sessions, I am not really getting the true count of users that have been or are still on the website in the last 2 hours.  The UI gives me this information.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 May 2019 20:43:24 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117719#M1724</guid>
      <dc:creator>robert_auten</dc:creator>
      <dc:date>2019-05-01T20:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117720#M1725</link>
      <description>&lt;P&gt;Not using the USQL API, no. There is an upcoming improvement in the next quarter or so to include a "user count" for Web Applications via the Timeseries API. This might help with your use-case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2025 17:36:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117720#M1725</guid>
      <dc:creator>joshua_dtrace</dc:creator>
      <dc:date>2025-07-14T17:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117721#M1726</link>
      <description>&lt;P&gt;Thank you for that information!  What I probably will end up doing is just checking the numbers once a day at a time when there shouldn't be much traffic on the website.  That at least will give me a good ball park of users that used the system during the day.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 May 2019 21:20:11 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117721#M1726</guid>
      <dc:creator>robert_auten</dc:creator>
      <dc:date>2019-05-01T21:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117722#M1727</link>
      <description>&lt;P&gt;You're very welcome, Robert!&lt;BR /&gt;And sounds good!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jul 2025 17:37:02 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/117722#M1727</guid>
      <dc:creator>joshua_dtrace</dc:creator>
      <dc:date>2025-07-14T17:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: User Session\Action API Get User count for application</title>
      <link>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/195608#M3903</link>
      <description>&lt;P&gt;Greetings Joshua,&lt;/P&gt;&lt;P&gt;I'm currently trying to get the same exact data as Robert, I was checking the Timeseries API but I couldn't understand how this can be possible using it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was also reading and find out that there's an "extrapolationLevel" field that according to the documentation, it means:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;SPAN&gt;The number is the denominator of a fraction and indicates the amount of actual data. The value&amp;nbsp;&lt;/SPAN&gt;1&lt;SPAN&gt;&amp;nbsp;means that the result contains only the actual data. The value&amp;nbsp;&lt;/SPAN&gt;4&lt;SPAN&gt;&amp;nbsp;means that result is calculated using 1/4 of the actual data.&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;How can I change this value in order to be set to 1 since I've tried passing it on the params request but it seems like it is not mutable.&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here's an example of my results:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Request:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import requests

headers = {
    'accept': 'application/json',
    'Authorization': 'Api-Token dt0c01.xxxxxx-xxxxxxx',
}

params = {
    'query': 'SELECT COUNT(DISTINCT ip) AS \'distinct_ip\' FROM usersession WHERE (userType=\'REAL_USER\' AND (useraction.application=\'sandals.com\' OR userevent.application=\'sandals.com\' OR usererror.application=\'sandals.com\')) LIMIT 1000',
    'startTimestamp': '3600000',
    'addDeepLinkFields': 'false',
    'explain': 'false',
}

response = requests.get('https://hudxxxxx.live.dynatrace.com/api/v1/userSessionQueryLanguage/table', params=params, headers=headers)

print(response.json())&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Response:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;{
  "extrapolationLevel": 4,
  "columnNames": [
    "distinct_ip"
  ],
  "values": [
    [
      1489990
    ]
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;According to my Session Query results, the "values" should be around 500-600ish&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help me!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 15:51:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Real-User-Monitoring/User-Session-Action-API-Get-User-count-for-application/m-p/195608#M3903</guid>
      <dc:creator>Montalvo</dc:creator>
      <dc:date>2022-09-30T15:51:12Z</dc:date>
    </item>
  </channel>
</rss>

