APIs & Integrations

D_Sheerin
Member

Find all offsets for deals API

SOLVE

I've been using the hubspot deals api to construct a data set. currently i've been making multiple separate queries and merging the end results but i realize this approach isnt at all future proof. From the hubspot resource i have a total of 924 separate deals and while i've been able to call subsequent queries using the "offset" value given initial with each request this approach is difficult to automate. I considered calling for each deals using a api url with a incrementally increasing "offset" portion but there doesnt seem to be a logical order to how the offset increases. despite being limited to 250 deals the offset value seems to vary greatly. Is there anyway i can specifically call for the offset values at a 250 increment without just making deal requests?

0 Upvotes
1 Accepted solution
cbarley
Solution
HubSpot Alumni
HubSpot Alumni

Find all offsets for deals API

SOLVE

Hi @D_Sheerin , the way the offset works is that it returns the last deal ID that was given back. This acts as a pointer to when you're querying the records, and doesn't give you really any relational information (how far away from the first or last record you are). You'll need to pull all deals and query from there each time when your data set changes (i.e. deals are deleted or added).

View solution in original post

1 Reply 1
cbarley
Solution
HubSpot Alumni
HubSpot Alumni

Find all offsets for deals API

SOLVE

Hi @D_Sheerin , the way the offset works is that it returns the last deal ID that was given back. This acts as a pointer to when you're querying the records, and doesn't give you really any relational information (how far away from the first or last record you are). You'll need to pull all deals and query from there each time when your data set changes (i.e. deals are deleted or added).