Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cccarv82
Frequent Visitor

API search results with random next page

Hi all,
I'm trying to import data from an API where I have a limitation of 25 results per page for the search and when I have a result with more than 25 results I have a column with the "next page" string to do the search.
 
My question is... How can I automate this process? I mean... if I have 100 pages of results, how can I get all the results pages into one table using this random address?
 
PS.: The random part is the string after "&next=". Each page returns a different string.
 
Example: 

/api/v3/search/stories?query=created%3A2021-12-01..*+is%3Astory&page_size=25&next=225357e4865eac91a3eb3008dd60c124885304a1~49

 
In the above example I need to perform another search using the base URL plus this string to get the next page and so on...
1 REPLY 1
lbendlin
Super User
Super User

Read about API pagination. My recommended approach is to use List.Generate to harvest all URLs and then combine their contents in one step.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.