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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
abartozzi
Frequent Visitor

Fetch data from a web source

hi PBI community, have to seek help for this one. 

 

So i need to set up a call to this api.

 

https://data.xotelo.com/api/rates?hotel_key=g297930-d305178&chk_in=2021-03-25&chk_out=2021-03-26

 

After changing with a function all relevant parts in order to obtain data what the api returns is something like this:

 

abartozzi_0-1614793122347.png

it should be a sort of JSON format response however the format seems not suitable to be fetched by power bi:

 

abartozzi_1-1614793226675.png

abartozzi_2-1614793247384.png

I also tried to use the "add table based on example" however it says that it canìt find any CSS selector for example values. 

Hence it's impossible to get any data out of this. 

 

Do you know any way I can work out a solution?

 

thank you

Alberto 

 

 

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @abartozzi 

 

Download example PBIX with the following code

 

The JSON returned from the API is valid.  To get it you can wrap the Web.Contents function in Json.Document like this

let
    Source = Json.Document(Web.Contents("https://data.xotelo.com/api/rates?hotel_key=g297930-d305178&chk_in=2021-03-25&chk_out=2021-03-26")),
    result = Source[result],
    #"Converted to Table" = Record.ToTable(result)
in
    #"Converted to Table"

jsondata.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Hello, I found a web page that contains some data that interests me but is visualized with power BI. How do I get that data and upload it to my power BI?

PhilipTreacy
Super User
Super User

Hi @abartozzi 

 

Download example PBIX with the following code

 

The JSON returned from the API is valid.  To get it you can wrap the Web.Contents function in Json.Document like this

let
    Source = Json.Document(Web.Contents("https://data.xotelo.com/api/rates?hotel_key=g297930-d305178&chk_in=2021-03-25&chk_out=2021-03-26")),
    result = Source[result],
    #"Converted to Table" = Record.ToTable(result)
in
    #"Converted to Table"

jsondata.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.