# REST API how to paginate through all contacts?

**URL:** <https://forum.mautic.org/t/rest-api-how-to-paginate-through-all-contacts/29005>\
**Category:** Development\
**Created:** [August 20, 2023, 7:52pm UTC](https://forum.mautic.org/t/rest-api-how-to-paginate-through-all-contacts/29005 "2023-08-20T19:52:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobkitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bobkitz/32/12780_2.png) [@bobkitz](https://forum.mautic.org/u/bobkitz)\
**Post date:** [August 20, 2023, 7:52pm UTC](https://forum.mautic.org/t/rest-api-how-to-paginate-through-all-contacts/29005/1 "2023-08-20T19:52:05Z")

</div>

**Your software**  
My Mautic version is: 4.4.9  
My PHP version is: 8.0.29  
My Database type and version is: 10.6.12-MariaDB-0ubuntu0.22.04.1

**Your problem**  
My problem is:

I am trying to use the /contacts endpoint to return tens and hundreds of thousands of contacts. Of course it returns a limited batch (default 30). I can’t practically increase that value to 100,000 of course, so I want to paginate through the results.

I was hoping to use the “start” parameter, however that does not seem to be a usable solution, since each time I call GET to /contacts I may get a different result - i.e. there is no context of the query saved.

Can anyone provide an example of how pagination through a list of contacts should work?

These errors are showing in the log: none

---

<div class="post-metadata">

**Author:** ![bobkitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bobkitz/32/12780_2.png) [@bobkitz](https://forum.mautic.org/u/bobkitz)\
**Post date:** [August 31, 2023, 11:38am UTC](https://forum.mautic.org/t/rest-api-how-to-paginate-through-all-contacts/29005/2 "2023-08-31T11:38:15Z")

</div>

Solved my own problem. I ended up ordering by ID, and incrementing the `start` parameter by the batch size with each call to the /contacts endpoint. I have Python code if anyone needs an example.
