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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Sankzpower
Helper I
Helper I

Rest API - Retrieve data based on a group ID from a different URL

Hi guys

 

I am newbie here. Hope someone can shed some light.

I have got access to our online data storage platform via rest API for over 20000 records. We have got static API token for all below three URLs to retrieve data. I can confirm I can retrive data from all the below URLs.

 

1. URL - To retrieve the content, hierachy list of entire records identifiable by group ID

2. URL - To retrieve the further information such as data type, site type (can only retrive based on a id by id and does not list out all in one page. For example: If we would have to retrieve data for a certain site then you have to change the URL ending text to a specific ID that you are looking for. https://platform.xx.com/series/1ABDU,https://platform.xx.com/series/1DHFK,https://platform.xx.com/se...

3. URL - To retrieve the further information such as daily usage breakdown by ID. Similar to the example above in 2 - you would have to change the text of the URL to a specific one. 

 

Is there anyway, I can retrive the content (1st URL), date type, site type, daily usage breakdown (2nd and 3rd URL) 

 

Any help would be much appreciated.

Thanks

1 ACCEPTED SOLUTION

Thanks @ICIC 

I have found the below code working to retrive all page data without any issues. The API restricts to bring the data upto 100 rows per call. So, I had to use query to run however the condition goes on an infinite loop like you said where the query retrieves null data even there is no data found after reaching final page. Table.Remove Rows easier but the initial query is to bring in all the data until it reaches the end then table.remove rows kicks in to remove null. This process currently takes ages where I had to wait for longer to refresh. 

However, I have found that each API call retrieves two records as attached in the Json - Items and hasMore record fields. Fortunately, this hasMore contains True or False which determines whether there are more data on the next page. I am just trying different different queries to see how this can be adjusted for example : the loop will continue to run until it hits Hasmore = False field  then query should stop retrieving data as I think this probably the solution. Any of your help would be massive !!

 

 

View solution in original post

6 REPLIES 6
Icey
Community Support
Community Support

Hi @Sankzpower ,

Maybe this post could help you: 

REST api: requesting multiple resources in a single get [duplicate].

 

Best Regards,
Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @ICIC 

I have found the below code working to retrive all page data without any issues. The API restricts to bring the data upto 100 rows per call. So, I had to use query to run however the condition goes on an infinite loop like you said where the query retrieves null data even there is no data found after reaching final page. Table.Remove Rows easier but the initial query is to bring in all the data until it reaches the end then table.remove rows kicks in to remove null. This process currently takes ages where I had to wait for longer to refresh. 

However, I have found that each API call retrieves two records as attached in the Json - Items and hasMore record fields. Fortunately, this hasMore contains True or False which determines whether there are more data on the next page. I am just trying different different queries to see how this can be adjusted for example : the loop will continue to run until it hits Hasmore = False field  then query should stop retrieving data as I think this probably the solution. Any of your help would be massive !!

 

 

Hi @Sankzpower ,

Glad to hear that. Please accept your solution above so that people who may have the same question can get the solution directly.

 

Best Regards
Icey

Hi @Icey 

 

Thanksfor suggesting the solution. However, it did not work as the URL does not allow you to download by putting in comma as suggested. I have found a different solution which people can refer to.

 

Cheers

kentyler
Solution Sage
Solution Sage

Here is a short post about getting data from a REST api and turning it into a power bi datasource

https://community.powerbi.com/t5/Power-Query/Using-a-REST-API-as-a-data-source/td-p/50400





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Thanks Kentyler. I have been receiving data into power BI already. The issue is that I have been having challenges in retrieving data for all records at once unless if I change and type the URL for each group ID seperately. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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