Contact API Limitations

lexhuang
Member

Hi,

 

I am writing a python script where I need to extract contact information from hubspot and then load into database.

 

While usinf endpoitns,

querystring = {"limit":"100","archived":"false","hapikey":"############"} it says a the limitatios of records are 100 but we as an orgnzatin have 1000+ records.

 

Please let me know the method by which I can extract all records not only 100.

 

Thanks in advance!

0 Upvotes
1 Reply 1
soul_in_code
Participant

I think you can use the after query parameter to get next 100 result using the pagination method through the API. 

You can get the after value from the pagination object from the response of the first 100 contacts.

It will look something like this

 

{
  "results": [
    .....
    .....
    .....
    .....
  ],
  "paging": {
    "next": {
      "link": "?after=NTI1Cg%3D%3D",
      "after": "NTI1Cg%3D%3D"
    }
  }
}

 

 

The API always return you the next after value which you can use it in the next call to get the next 100 contacts.

Then pass the after value in the next API call,

something like this.

 

{"limit":"100","after":"NTI1Cg%3D%3D","archived":"false","hapikey":"YOUR_HUBSPOT_API_KEY"}