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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Connect to REST API (Python-MongoDB)

Upon clicking the "Get Data" option and then clicking "Web" in PowerBI, I typed in my own REST API's URL (http://127.0.0.1:5000/players/all). Once I press connect, the following can be seen:

Screenshot of imageScreenshot of image

 

Note that the data can be seen in the "Web View", but not in the "Table View". Since it can't be represented in the form of tables, it cannot be loaded into PowerBI. Is there any way where in the data from my REST API can be loaded into PowerBI?

NOTE: I tried linking my MongoDB backend to PowerBI and it worked successfully. However, the source of my data should be the API's URL rather than the backend itself.

Please help. Thanks.

1 ACCEPTED SOLUTION

Hi  @Anonymous ,

 

Import using Power BI Query Mode:  Select your DSN (after connecting using ODBC connector)and click Advanced Option to enter custom SQL Query to Import your REST API data. You can use ODBC DSN Data sources Preview tool to generate SQL Query. For example you can enter query like below. If you are not sure use Query builder (Found on Driver Preview Window)

SELECT * FROM $
WITH(src='https://my-api-url')

 

vkellymsft_0-1630654935782.png

For  details,pls check below reference:

https://zappysys.com/blog/howto-import-json-rest-api-power-bi/?gclid=EAIaIQobChMIzLjLqqTi8gIVAplmAh3vuQOUEAAYASAAEgI_8fD_BwE

 

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , Copy this JSON and check with the online JSON formatter. is the format correct ?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak , the format is correct, the online converter just beautfied it. 

 

Capture1.JPG

Even if this format were to be wrong, I won't be able to change it as the API is taking data directly from MongoDB (which stores data in .json format)

Is there any workaround for this problem? Is/are there any other way(s) to solve this?

Hi  @Anonymous ,

 

Import using Power BI Query Mode:  Select your DSN (after connecting using ODBC connector)and click Advanced Option to enter custom SQL Query to Import your REST API data. You can use ODBC DSN Data sources Preview tool to generate SQL Query. For example you can enter query like below. If you are not sure use Query builder (Found on Driver Preview Window)

SELECT * FROM $
WITH(src='https://my-api-url')

 

vkellymsft_0-1630654935782.png

For  details,pls check below reference:

https://zappysys.com/blog/howto-import-json-rest-api-power-bi/?gclid=EAIaIQobChMIzLjLqqTi8gIVAplmAh3vuQOUEAAYASAAEgI_8fD_BwE

 

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

Anonymous
Not applicable

Hi @v-kelly-msft. It worked. Thank you so much. 🙂

Hi  @Anonymous ,

 

Glad to help.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors