Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
How can I retrieve data from a REST API which requires key headers that depends on an initial query to first get the parameters.
e.g. my first query gets a list of building IDs, I then need to loop through each building to retrieve the data about them with a URL like: https://api.buildings.com/api/occupancy?buildingID=1
I can add the secret key into the first query, but I don't know how to tell it to loop through the queries and second level queries and include headers, and I can't find any tutorials or information on how to do it.
Solved! Go to Solution.
answered my own question, for anyone else struggling, edit the query and add the headers in, you can view the way to do this by clicking on advanced editor on a query that has the key in, it will look like this:
Source = Json.Document(Web.Contents("https://api.buildings.co.uk/api/homes", [Headers=[key="9fw8hdfdhs9fhsd8fhusdh"]]))
answered my own question, for anyone else struggling, edit the query and add the headers in, you can view the way to do this by clicking on advanced editor on a query that has the key in, it will look like this:
Source = Json.Document(Web.Contents("https://api.buildings.co.uk/api/homes", [Headers=[key="9fw8hdfdhs9fhsd8fhusdh"]]))
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 12 | |
| 11 | |
| 7 | |
| 7 | |
| 6 |