# Data API records Python

**URL:** <https://forum.bubble.io/t/data-api-records-python/189170>\
**Category:** APIs\
**Created:** [January 31, 2022, 7:03pm UTC](https://forum.bubble.io/t/data-api-records-python/189170 "2022-01-31T19:03:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![d.dominguezribeiro](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@d.dominguezribeiro](https://forum.bubble.io/u/d.dominguezribeiro)\
**Post date:** [January 31, 2022, 7:03pm UTC](https://forum.bubble.io/t/data-api-records-python/189170/1 "2022-01-31T19:03:20Z")

</div>

Hi!  
I am trying to use a get request to treat my data out of bubble, using python.  
The problem is it is always showing only 100 records, even if I set a higher limit.  
Does anyone know how to show all data?  
Thanks !!

---

<div class="post-metadata">

**Author:** ![aaronsheldon](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/aaronsheldon/32/115965_2.png) [@aaronsheldon](https://forum.bubble.io/u/aaronsheldon)\
**Post date:** [January 31, 2022, 7:40pm UTC](https://forum.bubble.io/t/data-api-records-python/189170/2 "2022-01-31T19:40:44Z")

</div>

It is a defacto best practice across the web to paginate the return of large datasets. As stated in the Bubble documentation [Workflow APIs](https://manual.bubble.io/core-resources/api/workflow-api#list-of-parameters) have a return limit. Likewise [Data APIs](https://manual.bubble.io/core-resources/api/data-api#pagination) are automatically paginated. Your choice is to either build a manual pagination Workflow API, or structure your database so that a Data API can return the paginated results.

---

<div class="post-metadata">

**Author:** ![Lemonflow](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/lemonflow/32/127889_2.png) [@Lemonflow](https://forum.bubble.io/u/Lemonflow)\
**Post date:** [January 31, 2022, 10:29pm UTC](https://forum.bubble.io/t/data-api-records-python/189170/3 "2022-01-31T22:29:32Z")

</div>

Hi,

This is the expected behavior 🙂  
The max value of limit is 100. So Bubble will never return more than 100 objects per API call.

To get all the objects using the Data API, you have to call it several times.

For example:

1. Call the data API with limit = 100

2. Get the number of remaining objects - response[“remaining”]

3. Compute the number of remaining pages

4. Loop to get all the objects

---

<div class="post-metadata">

**Author:** ![marcus3](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@marcus3](https://forum.bubble.io/u/marcus3)\
**Post date:** [June 14, 2022, 5:16pm UTC](https://forum.bubble.io/t/data-api-records-python/189170/4 "2022-06-14T17:16:31Z")

</div>

The above worked well for me, my final code looks like:

```
results = []

```

`url = "[Data API root URL]"`

```
myHeaders = {

    'Authorization':'Bearer [Your API Key]',

    'Content-type':'application/json'

}
response = requests.get(url, headers = myHeaders).json()

raw = response['response']['results']

left = response['response']['remaining']

pages = round(left/100) #should probably use ceil() here but didn't wanna import math

for i in raw:

  results.append(i)

cursor = 100*(i+1)

params={'count':100,

        'cursor':cursor}

response=requests.get(url, headers=myHeaders,params=params).json()

raw=response['response']['results']

for i in raw:

  results.append(i)

df = pd.DataFrame(results)
```
