API Call to Make’s Datastore with a default limit of records
I am trying to make an API request using the HTTP module to get all the records from a data store I have in my account. The problem is that, even though the datastore has 19+ records, and the call actually recognizes that indeed we have 19+records, it only show 10 records.
I have tried using the url without a limit parameter and with a limit parameter of 1,000 and I still get just 10 rows on the request.
Anybody have any idea how to not have that limit?
Hi @fergotz,
The total count of your request is 19. The limit per page returned is 10 results. (so not a limit in total).
There are two things you can do; you can ask for the next page, that contains the next 10 results (which in this case would only return 9) and get all 19 results with two API calls. Or you can use the pg[]
path parameters to increase the limit per page.
The URL then looks like:
https://www.us1.make.com/api/v2/data-stores/42373/data?pg[100]
The maximum amount of results per page is 100, so adding a limit of 1000 won’t work. See: https://www.make.com/en/api-documentation/data-stores-dataStoreId-data-get
Cheers,
Henk
2 Likes
Also, is there a reason you do not use the default Data Store app?
1 Like
Thankyou! The actual use case for this API Call is by calling it on PowerBi. I just shared it on Make for easier understanding and it was part of my testing.
So for each page I should make the call. Is thats correct? But how would I specify to retrieve the next page of the data store? Is it a different datastoreID?
Alright, that makes perfect sense!
Excuse me, I made a mistake in the URL I gave you. It should be formatted as such:
https://www.us1.make.com/api/v2/data-stores/42373/data?pg[limit]=100
The query to the endpoint accepts a pg[offset]
parameter too. The index starts at 0, so if you request ?pg[offset]=0
, you will get the first page.
You can use this parameter to retrieve following pages by increasing the pg[offset]
parameter. With a calculation based on the count
key that is returned in each response. By dividing the count by the page limit you’ve set, you’ll know how many pages there are.
Hope this helps!
Cheers,
Henk
1 Like
So it would look like this btw:
https://www.us1.make.com/api/v2/data-stores/42373/data?pg[limit]=100&pg[offset]=0
1 Like