Skip to main content
Solved

Can Amplitude Rest API query past 365 days?

  • May 17, 2022
  • 1 reply
  • 618 views

Forum|alt.badge.img
  • Conversationalist
  • 6 replies

I’m using the Amplitude REST API and it seems like it only lets us query up to 365 days in the past. However, I would like to give “Lifetime” metrics for my customers and some of them are older than a year.

https://developers.amplitude.com/docs/dashboard-rest-api#event-segmentation

 

Is there a way to query longer in the past and if not is that a plan in the dev cycle?

Best answer by Saish Redkar

Hey @gsw1 

As far as the chart limits go in an event seg chart, the furthest date you can go till depends on the aggregation granularity. e.g Daily will allow maximum range of 365 days and Monthly allows a maximum range of 36 months. You can read more on the date range query limits here.

So more of less these date range limits apply to the event seg chart endpoint in the Dashboard Rest API as well. You can go past the 1 year range, but by using the monthly aggregation i.e. i = 30 in the API parameter and querying a max 36 month timeline in a single call. Going past the 365 day limit using i=7 won’t be possible for this endpoint. This is applicable if you are looking for uniques/totals by daily/weekly/monthly as a series of datapoints.

If you are just looking at the total unique users over a certain time interval ( the bar chart view ) , then the seriesCollapsed attribute returned as part of the api response will give this value.

Another way would be to segregate your API calls as per the time period and then stitch the timeline, if you want to stick to a daily aggregation and still get more than 1 year worth of data

e.g. start=20210101&end=20211231&i=7 in API call #1

start=20220101&end=20220430&i=7 in API call # 2

 

Hope this helps.

 

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

1 reply

Saish Redkar
Expert
Forum|alt.badge.img+10
  • Expert
  • 1382 replies
  • Answer
  • May 17, 2022

Hey @gsw1 

As far as the chart limits go in an event seg chart, the furthest date you can go till depends on the aggregation granularity. e.g Daily will allow maximum range of 365 days and Monthly allows a maximum range of 36 months. You can read more on the date range query limits here.

So more of less these date range limits apply to the event seg chart endpoint in the Dashboard Rest API as well. You can go past the 1 year range, but by using the monthly aggregation i.e. i = 30 in the API parameter and querying a max 36 month timeline in a single call. Going past the 365 day limit using i=7 won’t be possible for this endpoint. This is applicable if you are looking for uniques/totals by daily/weekly/monthly as a series of datapoints.

If you are just looking at the total unique users over a certain time interval ( the bar chart view ) , then the seriesCollapsed attribute returned as part of the api response will give this value.

Another way would be to segregate your API calls as per the time period and then stitch the timeline, if you want to stick to a daily aggregation and still get more than 1 year worth of data

e.g. start=20210101&end=20211231&i=7 in API call #1

start=20220101&end=20220430&i=7 in API call # 2

 

Hope this helps.

 


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