APIs & Integrations

felixenescu
Member

Prefered API solution to export all companies

SOLVE

For a client I need to export all the companies via the API. We tried to use V3 GET
/crm/v3/objects/companies but we keep getting inconsistent results. For example in one run we get 22907 pages in the next we got 22945 pages.

 

I noticed the corresponding V2 endpoint GET /companies/v2/companies/paged has in documentation explicit use case for exporting ALL companies.

 

To export ALL companies should we use V2 or V3 endpoint? Or they should work both? Any specific advice when exporting a quite large (millions) number of companies?

 

Or may be there is another API solution that I missed?

 

Thank you.

0 Upvotes
1 Accepted solution
Derek_Gervais
Solution
HubSpot Alumni
HubSpot Alumni

Prefered API solution to export all companies

SOLVE

Hey @felixenescu ,

 

Either the v3 or the v2 Companies API should work the same for exporting all company records via the API. I'm not entirely sure at a glance why you seemed to be getting inconsistent results, but depending on the page size & how active the portal is, it might be that the actual number of company records is changing. Things like merges, archivals, and creations (especially if the "Automatically create and associate company records" setting is on) can cause the total number of records to flucuate, especially in highly active portals.

 

Another thing to consider: When exporting large numbers of records from HubSpot, it's sometimes a better idea to use the in-app export functionality. Depending on what format the data needs to be in and how frequently the export needs to happen, it can be a significantly less resource intensive way to pull the relevant data. You can find more info on this process here.

View solution in original post

0 Upvotes
1 Reply 1
Derek_Gervais
Solution
HubSpot Alumni
HubSpot Alumni

Prefered API solution to export all companies

SOLVE

Hey @felixenescu ,

 

Either the v3 or the v2 Companies API should work the same for exporting all company records via the API. I'm not entirely sure at a glance why you seemed to be getting inconsistent results, but depending on the page size & how active the portal is, it might be that the actual number of company records is changing. Things like merges, archivals, and creations (especially if the "Automatically create and associate company records" setting is on) can cause the total number of records to flucuate, especially in highly active portals.

 

Another thing to consider: When exporting large numbers of records from HubSpot, it's sometimes a better idea to use the in-app export functionality. Depending on what format the data needs to be in and how frequently the export needs to happen, it can be a significantly less resource intensive way to pull the relevant data. You can find more info on this process here.

0 Upvotes