Skip to main content
Solved

Chart ID for Dashboard API into python notebook?


Forum|alt.badge.img

I am looking to grab data from a chart into a Python Notebook

 

I have followed the instructions here: https://www.docs.developers.amplitude.com/analytics/apis/dashboard-rest-api/#get-results-from-an-existing-chart

import requests

url = "https://amplitude.com/api/3/chart/:chart_id/query"

payload={}
auth=requests.auth.HTTPBasicAuth('api-key', 'secret-key')

response = requests.request("GET", url, auth=auth, data=payload)

print(response.text)

However, I keep getting URL not found.

I have the api-key and secret-key.

 

I believe the line of code where there is the issue is the second line.

The URL where chart resides is :

https://app.amplitude.com/analytics/[CompanyName]/chart/at54vy8p

Could someone help me with what should this line of code be:

url = "https://amplitude.com/api/3/chart/:chart_id/query"

I have tried following options without success:

url = "https://amplitude.com/api/3/chart/:at54vy8p/query" 
url = "https://amplitude.com/api/3/chart/at54vy8p/query" 
url = "https://amplitude.com/analytics/[Company Name]/api/3/chart/:at54vy8p/query" 
url = "https://amplitude.com/analytics/[Company Name]/api/3/chart/at54vy8p/query" 

Any help is much appreciated.

Best answer by Saish Redkar

Hi @srahman 

You can omit the company name from your chart url while querying.

So use url = "https://amplitude.com/api/3/chart/at54vy8p/query" 

Hope this helps.
 

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

2 replies

Saish Redkar
Expert
Forum|alt.badge.img+10
  • Expert
  • 1380 replies
  • Answer
  • January 31, 2024

Hi @srahman 

You can omit the company name from your chart url while querying.

So use url = "https://amplitude.com/api/3/chart/at54vy8p/query" 

Hope this helps.
 


Forum|alt.badge.img
  • Author
  • Novice
  • 3 replies
  • January 31, 2024

Thank you so much!


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