I would like to either get a list of all active users IDs, event IDs, or session IDs with a time filter of say a few hours, via the API. Is it possible to do so?
Hey Wei Jie ,
Most of the endpoints listed in the Dashboard REST API documentation will give you aggregated numbers of active user counts, event counts and some session metrics depending on how you format the API calls using your date filter and other parameters. Afaik, there isn’t an endpoint which can directly give you list of all active users IDs, event IDs, or session IDs.
However. you can get a list of user ids for a datapoint in an event seg chart by downloading the users via Microscope or by downloading your cohort using the Behavioral Cohorts API.
The only other way of getting ALL those IDs in one go would be the Export API, where every event record will have the user id, event id and session id. The lowest granular time range for this is 24 hours .i.e. a day’s worth of event data.
Let me know if I have interpreted your question correctly. Hope this helps!
Hi Saish Redkar ,
Just to clarify, I would either need user or event or sessions, I would not need all of them at once, though that would be preferred.
Thank you for the suggestion on the Microscope feature in the event seg chart. Is there a way I can download the users via code?
As for Cohorts or the Export API, unfortunately the granularity of 1 day is too high and I would prefer it to be a few hours.
Thank you
Wei Jie
Hi Wei Jie,
If you are looking to export data for only a specific few hourly data points, then the method that Saish has recommended would be the best solution - you should use the Microscope to extract the data via CSV export.
The alternative is that you can set up a chart and use the Dashboard REST API by following the instructions here: https://developers.amplitude.com/docs/dashboard-rest-api#event-segmentation
Let me know if you have any questions!
Hi serene.gan ,
If I’m not wrong, the Dashboard REST API for event segmentation only returns summary metrics like counts, but I would need to return the user IDs. Would that be possible with a formula?
A hacky way would be creating a cohort via Microscope for an event seg chart on realtime/hourly granularity and then getting that cohort via the Behavioral Cohort API , if at all you need to do it programmatically. But this would be a static cohort in most of the cases.
I don’t think there is any other way of getting user ids without going over a 1 day granularity.
Apologies - I was under the impression that you could insert a group-by and it would break down the IDs for you. If you are on our paid plans, another way you could explore this would be to set up a cohort and then extract it programmatically via our Behavioral Cohorts API
Would it be possible for you to share a little more about your use case and why you are looking to extract the user IDs on an hourly basis? What I might be able to do for you here is to share this feedback with my Product team as a feature request on your behalf!
Best,
Serene
How do I transfer data from one amplitude account to another? It seems all the community chats about this have completely broken links. Easy to export, no way to import, very frustrating. :(
When using @amplitude/plugin-web-vitals-browser with Create React App v4 (react-scripts@4.0.3), the build fails with: ./node_modules/@amplitude/plugin-web-vitals-browser/node_modules/web-vitals/dist/web-vitals.js<br /><br />SyntaxError:…
Hello, I'm using SpringBoot and Kotlin to integrate with the Amplitude Export API. The official Amplitude documentation (https://amplitude.com/docs/apis/analytics/export) states that "data is available to export at a minimum within 2 hours of when the servers received it." However, there's no clear information about the…
Hello, Is there a way to make a query like: “Give me all the users that have the user property X equal to 10”, by using just any of the APIs, without making a cohort first through the Amplitude’s UI? Thank you!
Hi, I’m trying to create a chart in Amplitude using the Page Viewed: Cart event, measured as Uniques, over the past 7 days. However, I keep getting this error on the graph: "An error occurred while loading your data. (400 status code)" Other events seem to load fine, so it looks specific to this event or configuration. Has…