Jump to content
  • 0

API Pagination




So i've got an API call working (table\records), but i'm wondering from the results, how do you know how many pages I need to loop through to get all the results from a table?  currenlty i've got 950 rows so this could change to over 1000 quickly, just wanted to know how best to handle it.  

Any suggestions? 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I just double checked https://acctid.caspio.com/rest/swagger#/Tables and total records returned in not included in API responses.

Try running loops until a response with no results is returned.

For example if you have 950 records...


may return

  "Result": [
      "PK_ID": 1
    * 949 more results



would return

  "Result": []


So when Result.length < 1, you've reached the end.

I hope this helps

Edited by LWSChad
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...