APIs & Integrations

Wes4
Participant

Getting All Data by Date

So this relates to almost all of the endpoints where you can get any type of analytical data. We are trying to chart data for our clients by date. Based on the endpoints I see, it looks like we have two options:

  1. Use the endpoints that return lifetime data (e.g., GET /companies/v2/companies/paged)
  2. Use the endpoints that return recently created/updated data (e.g., GET /companies/v2/companies/recent/modified)

The problems with the first option is that in order to ensure we have all the data for specific day, we would need to query literally all of it, as it seems like there is no guaranteed order of the results.

The problem with the second option is that they only return data for the last 30 days or up to 10k records. So again, aside from the fact that we can only get 30 days worth of data, this would not guarantee that we get all the data for those 30 days if they have over 10k records.

The first option would be much better for us so we could get data from any time range they wanted to see, but this would require potentially many calls to HubSpot, which is not ideal for HubSpot or for us. Is there any way around this that I'm missing? Or could you potentially include a way to order the results from the lifetime endpoints?

0 Upvotes
1 Reply 1
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Getting All Data by Date

Hi @Wes_Thompson,

There isn't any other workaround if you need ordered data beyond 30 days / 10k records. You'd need to query the 'Get all companies' endpoint to pull all records and sort them by create date on your end. There isn't a sorted endpoint for any object type that goes beyond 30 days / 10k records. I can understand your use case, though; if you have the inclination, I would encourage you to check out the Ideas Forum on the HubSpot Community. There, you can create a post including your use case that product and other customers can see.

0 Upvotes