# Pagination using Python

**URL:** <https://forum.asana.com/t/pagination-using-python/38930>\
**Category:** API & Developers\
**Created:** [9 January 2019 13:36 UTC](https://forum.asana.com/t/pagination-using-python/38930 "2019-01-09T13:36:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Hutchings](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/daniel_hutchings/32/27193_2.png) [@Daniel\_Hutchings](https://forum.asana.com/u/Daniel_Hutchings)\
**Post date:** [9 January 2019 13:36 UTC](https://forum.asana.com/t/pagination-using-python/38930/1 "2019-01-09T13:36:10Z")

</div>

Hi, I’m working on exporting all Asana tasks to a csv file, which currently works well:

> <https://github.com/hutchida/Asana2CSV/blob/master/asana2csv.py>

However, to future proof it I believe I need to implement some form of pagination. I’ve read the documentation on pagination but it leaves you without an example of how to implement this.

Something to do with the below line of code, but then what? Is that enough? Surely not…  
client.options[‘page\_size’] = 10

Can anyone point me in the right direction on how to paginate and loop through using Python? Many thanks,

Dan

---

<div class="post-metadata">

**Author:** ![Bastien\_Siebman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/bastien_siebman/32/172354_2.png) [@Bastien\_Siebman](https://forum.asana.com/u/Bastien_Siebman)\
**Post date:** [9 January 2019 15:42 UTC](https://forum.asana.com/t/pagination-using-python/38930/2 "2019-01-09T15:42:44Z")

</div>

In the Node library the pagination was kinda built in, did you browse the Python library looking for the word “pagination”? cc @Diakoptis @Phil_Seeman who are the best with the API 🙂

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [9 January 2019 15:58 UTC](https://forum.asana.com/t/pagination-using-python/38930/3 "2019-01-09T15:58:31Z")

</div>

All of the Asana client libraries have paging built into them; you don’t need to do anything about it. The library handles the paging and returns to you all of the items you’ve asked for in your request.

The default page size is 50 items; you can set a smaller or larger value, up to a max of 100, but odds are you probably don’t need to vary from the default size. The page size is just an internal “number of items per request”; the only impact a specific number will have is in how many API calls are needed to get all of the data.

See here for a bit more on the topic:

> [@Automatic page iteration - Node client](https://forum.asana.com/t/automatic-page-iteration-node-client/29230/2):
>
> Most of what you gathered is true - that is, you will be handed 1500 tasks in the callback function. However, It will count as one API request and will not be limited in any way is not true; rather, the Node client library is paginating over the data client side by making multiple requests and appending them to the list, and then it hands them on to your callback function after all pages are fetched. The [default page size](https://github.com/Asana/node-asana/blob/8a99170f142127e7ddc2bd9ed1bb98f4a823b27c/lib/resources/resource.js#L20) that’s configured for our client library is 50 items (this is configur…

---

<div class="post-metadata">

**Author:** ![Daniel\_Hutchings](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/daniel_hutchings/32/27193_2.png) [@Daniel\_Hutchings](https://forum.asana.com/u/Daniel_Hutchings)\
**Post date:** [9 January 2019 16:05 UTC](https://forum.asana.com/t/pagination-using-python/38930/4 "2019-01-09T16:05:53Z")

</div>

Great, so it’s all automatic, I don’t have to do anything with an offset token or **next\_page** , nothing…fantastic. The pagination page implied otherwise, is it out of date or is it just me misinterpreting it? [Build an app with Asana](https://asana.com/developers/documentation/getting-started/pagination)

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [9 January 2019 16:07 UTC](https://forum.asana.com/t/pagination-using-python/38930/5 "2019-01-09T16:07:38Z")

</div>

Well, from that page, there is this:

> Note that all of Asana’s official [client libraries](https://asana.com/developers/documentation/getting-started/client-libraries) support pagination by default.

🙂

---

<div class="post-metadata">

**Author:** ![Daniel\_Hutchings](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/daniel_hutchings/32/27193_2.png) [@Daniel\_Hutchings](https://forum.asana.com/u/Daniel_Hutchings)\
**Post date:** [9 January 2019 16:09 UTC](https://forum.asana.com/t/pagination-using-python/38930/6 "2019-01-09T16:09:28Z")

</div>

Haha, yes I did notice that, but then it went on to describe more in detail, leaving me wondering why we need to do anything if it’s already built in.

---

<div class="post-metadata">

**Author:** ![Bastien\_Siebman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/bastien_siebman/32/172354_2.png) [@Bastien\_Siebman](https://forum.asana.com/u/Bastien_Siebman)\
**Post date:** [9 January 2019 16:45 UTC](https://forum.asana.com/t/pagination-using-python/38930/7 "2019-01-09T16:45:34Z")

</div>

@Daniel_Hutchings I did the same the first time 🙂

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/system/32/276370_2.png) [@system](https://forum.asana.com/u/system)\
**Post date:** [30 May 2025 19:05 UTC](https://forum.asana.com/t/pagination-using-python/38930/8 "2025-05-30T19:05:14Z")

</div>

Closed on 30 May 2025 19:05 UTC


