Forum Discussion

wcameron14's avatar
wcameron14
Frequent Visitor
5 years ago
Solved

Passing a parameter to an API for retrieving paginated data

I am working with our marketing tools API so I can pull marketing data into a Power BI report. The API data is paginated and limited at 20 by default. I want to pass a parameter (limit = 100) but I'v...
  • lbendlin's avatar
    5 years ago

    Do the first call with ?limit=100 , then query the Meta/Total value and calculate how many more calls you need to make to hit the total. Power Query allows you to create lists, and to add columns to these. with the contents of the API call returns.

     

    - make first call with ?limit=100

    - let's say the call returned with Meta/Total=760

    - create a list with a value from 100 to 700 in steps of 100

    - make subsequent calls with ?limit=100&offset=[list value]

    - combine all results as needed.