I am trying to page through the entire list of companies in my portal so that I can allow users to search for companies (since Hubspot doesn’t expose the API endpoint that they use in the sales portal to do so). Unfortunately, I can’t get the
offset parameter to work.
I originally was setting the
offset myself. In my first loop my
offset was 0, then, if the results matched my
limit (250, the Hubspot set maximum page size), I would increment my
offset by the
limit and request again. When I perform a request to
/companies/v2/companies/paged with an
offset of 0 and with an offset of 250, I get the same results!
I then noticed that in the documentation it says “If there are more records in your portal than the limit= parameter, you will need to use the offset returned in the first request to get the next set of results.”
I then, in my loop, set the
offset equal to the
offset that was returned to me, and this still did not work! Plus, the
offset that is returned to me from the request always remains the same.
I’m guessing there is something that I am doing terribly wrong.
Here is an example of my request url"