Solved

What is the best way to query for Amplitude data?


Userlevel 1
Badge
  • Conversationalist
  • 6 replies

I’ve set up my Amplitude project and have successfully started tracking events. I see all the data being saved on the Amplitude dashboard of my project which is great. However, I want to be able to show this data to my customers as well.

 

What’s the best way currently to query for Amplitude data so that I can use it to show graphs on my website? Preferably the data should come in as a json that I can reformat.

icon

Best answer by Saish Redkar 2 May 2022, 01:22

View original

3 replies

Userlevel 7
Badge +10

Hey @gsw1 

If you want to show dashboards and charts to users who are not part of your org, then public links is the easiest approach. You can also embed your Amplitude charts as described here.

If you just want to query a chart’s raw data, then I would recommend using the https://developers.amplitude.com/docs/dashboard-rest-api endpoints to extract the data points you are interested in. There are quite a few endpoints in the Dashboard REST API which you can leverage to query existing saved charts or build event segmentation charts,etc on the fly programmatically.

Once you are able to do this, you can use the raw data points and visualize it on your website using some charting libraries or whatever fits your use case.

Dashboard REST API comes with some rate limits, which can cause potential scalability issues if your website has significant visitors.

You can read some responses here on a similar question.

Let me know if I have interpreted your use case correctly. Hope this helps.

Userlevel 1
Badge

Thanks! Sorry I should’ve been more clear but the second part of your answer is what I was looking for. Basically I would like to programmatically query raw data points given parameters such as timeframe, user id, metric type etc.

 

I’ll look into the Dashboard REST API since that seems like the answer but in case what I just said changes that answer please let me know!

 

EDIT: Also reading the other question you linked, it does seem like the REST API comes with scalability challenges. Can I ask if Amplitude is going to prioritize that issue anytime soon? It seems like the use case of using Amplitude as a medium for customer analytics is a big use case.

Userlevel 7
Badge +10

From what I understand, the primary way Amplitude wants you to surface insights is via sharing the charts and dashboards urls natively. The REST API just serves as a supplemental way of getting these data points programmatically. It might be worth a shot to try submitting a feature request here for increasing those rate limits.

Reply