Skip to main content
Solved

Return average session length by user through the API?

  • March 23, 2022
  • 1 reply
  • 340 views

Hey, I am trying to find the average session length by user. I know this is possible on a chart but using the endpoint: 

GET https://amplitude.com/api/3/chart/CHART_ID_HERE/query

Only returns 1000 user ids. Another way would be to use the user activity endpoint but this would be a long process. 

I essentially want the following endpoint:

GET https://amplitude.com/api/2/sessions/peruser

But with the ability to group by cohort, property or those who have performed a particular event.

Best answer by MikkoKarvonen

Are you looking for this data for each individual users or the average for a group of users?

If latter, you can achieve this by building and saving the chart in the Amplitude web UI and then using the first API you listed.

If you are looking for individual users, you’ll probably run into the limitations. But you could get around them by building your chart to only include max 1000 users.

View original
Did this topic help you find an answer to your question?

MikkoKarvonen
Peer Moderator
Forum|alt.badge.img+3

Are you looking for this data for each individual users or the average for a group of users?

If latter, you can achieve this by building and saving the chart in the Amplitude web UI and then using the first API you listed.

If you are looking for individual users, you’ll probably run into the limitations. But you could get around them by building your chart to only include max 1000 users.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings