# Get all companies - odd offset behaviour

**URL:** <https://community.hubspot.com/t/get-all-companies-odd-offset-behaviour/16618>\
**Category:** APIs & Integrations\
**Tags:** companies\
**Created:** [October 8, 2019, 12:58pm UTC](https://community.hubspot.com/t/get-all-companies-odd-offset-behaviour/16618 "2019-10-08T12:58:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![devmosaic](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/devmosaic/32/75439_2.png) [@devmosaic](https://community.hubspot.com/u/devmosaic)\
**Post date:** [October 8, 2019, 12:58pm UTC](https://community.hubspot.com/t/get-all-companies-odd-offset-behaviour/16618/1 "2019-10-08T12:58:37Z")

</div>

I’m getting all my companies using API, but I’m testing how pagination works so I limited my results to 4 and I have 6 companies in total.

so I do a GET **/companies/v2/companies?limit=4**

and then I receive 4 companies with the root info { “has-more”: true, “offset”: 2403636826 … }

Given that I need to create a new request to get the rest of the companies:

**/companies/v2/companies?limit=4&offset=2403636826**

But **I get the error** : _Unable to parse value for query parameter: offset_

I think the problem is under the offset type. In order to test I requested with offset=2147483647 (which is the maximum integer32 number) I get results correctly.

But when I request with a integer64 (offset=2147483648 for example) I get the same error of _unable to parse offset_.

How can I make it work?

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [October 8, 2019, 8:51pm UTC](https://community.hubspot.com/t/get-all-companies-odd-offset-behaviour/16618/2 "2019-10-08T20:51:47Z")

</div>

Hey @devmosaic ,

If you’re using the `offset` parameter that’s documented in [this](https://developers.hubspot.com/docs/methods/companies/get-all-companies) documentation, the number should be working. Can you give me your Hub ID so that I can dig into this? If it’s an issue with the endpoint, I’ll want to get this in front of the team asap.

---

<div class="post-metadata">

**Author:** ![devmosaic](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/devmosaic/32/75439_2.png) [@devmosaic](https://community.hubspot.com/u/devmosaic)\
**Post date:** [October 8, 2019, 9:04pm UTC](https://community.hubspot.com/t/get-all-companies-odd-offset-behaviour/16618/3 "2019-10-08T21:04:10Z")

</div>

Hey [@Derek\_Gervais](https://community.hubspot.com/t5/user/viewprofilepage/user-id/142)

I did use the documentation you mentioned. I strongly think the problem might be in Hubspot API’s backend.

My is HID **6403674**

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [October 10, 2019, 9:08pm UTC](https://community.hubspot.com/t/get-all-companies-odd-offset-behaviour/16618/4 "2019-10-10T21:08:15Z")

</div>

Hey @devmosaic ,

Thanks for the info, that was helpful in identifying the issue. I was able to reproduce the issue you’re seeing, but there’s a catch: The public “Get all companies” endpoint is `companies/v2/companies/paged`, not `companies/v2/companies`. The `companies/v2/companies` endpoint appears to be an old legacy endpoint that’s still live, though undocumented. This issue appears limited only to this legacy `companies/v2/companies` endpoint, not the currently supported `companies/v2/companies/paged` endpoint.

I’ll be sure to bring this to my team in order to get to the bottom of this issue, but regardless I’d recommend using the publicly documented endpoint (i.e. `companies/v2/companies/paged`) as described in the following developer documentation: [Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/methods/companies/get-all-companies)

---

<div class="post-metadata">

**Author:** ![devmosaic](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/devmosaic/32/75439_2.png) [@devmosaic](https://community.hubspot.com/u/devmosaic)\
**Post date:** [October 10, 2019, 10:22pm UTC](https://community.hubspot.com/t/get-all-companies-odd-offset-behaviour/16618/5 "2019-10-10T22:22:35Z")

</div>

I’m not sure where I pulled from the legacy URL (without paged/ at the end)

But thanks for helping me,  
Have a great one.

---

<div class="post-metadata">

**Author:** ![Kishore](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kishore/32/53612_2.png) [@Kishore](https://community.hubspot.com/u/Kishore)\
**Post date:** [October 3, 2020, 8:17pm UTC](https://community.hubspot.com/t/get-all-companies-odd-offset-behaviour/16618/6 "2020-10-03T20:17:31Z")

</div>

[Accounts Dashboard | HubSpot](https://legacydocs.hubspot.com/docs/methods/companies/get-all-companies) there is max limit only 250, in my companies table i have 3357 records so how to send all these companies records into External application. how to adjust end point please help me
