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

Become a Certified Power BI Data Analyst! Prepare for Exam PL-300 with expert-led live sessions. Get registered!

Reply
rmcgrath
Advocate II
Advocate II

API query

Hello...I am currently connecting to an API and trying to pull in data from 2015 to present (576,000 data points).  The API has a limit of 5,000 data points.  I would have to do 115+ queries to pull in the data.  Here is the method I am using so far (I hid some of the names with *s):

Is there a more efficient/easier way to do this?

4 REPLIES 4
rmcgrath
Advocate II
Advocate II

I am connecting to an API that has 576000 data points and a limit of 5000.  Is there a more efficient way to grab the data than what I am currently doing? I will need to do 115+ queries!😯

 

Hi @rmcgrath,

Thank you  for reaching out to the Microsoft fabric community forum.

I would also take a moment to thank @Deku , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

When working with REST APIs, data is often returned in pages when the dataset is too large to send all at once. Power Query can handle various pagination methods, but since each API handles paging differently, you'll usually need to adjust the sample logic to fit your specific case.

A reliable approach is to create a function that fetches one page of data, then recursively loops through the remaining pages until no more records are returned. This is especially useful when APIs enforce limitslike a 5,000-record page limit. By calling this function inside another query that combines all results, you automate the process and enable seamless refreshes in Power BI or Microsoft Fabric. Just be sure to adapt the API URL and JSON parsing to match your API’s structure.


Gothrough with below document which may help you to resolve the Issue
Helper functions for M extensions for Power Query connectors - Power Query | Microsoft Learn

If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it

Best Regards,
Harshitha.
Community Support Team



Deku
Community Champion
Community Champion

Please see this related post

 

https://community.fabric.microsoft.com/t5/Desktop/Pagination-of-a-REST-API-in-Power-Query-using-M/m-...


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Akash_Varuna
Community Champion
Community Champion

Hi @rmcgrath Automate pagination using a script to iterate through pages or split queries by date ranges (e.g., year-by-year). Parallelize requests using libraries like concurrent.futures to speed up the process, ensuring compliance with API rate limits. Check if the API offers bulk export or aggregation options to reduce query load

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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