This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hello Experts,
Could anyone please guide me on how to pull the data from the Rest API.
I have a list of APIs, which will connect through a login token(bearer token) and I want to pull the data to Power BI Desktop to build
Thanks
Santhosh
Solved! Go to Solution.
@sthatoju
You can connect using Power Query, the genral format will be:
let
BearerToken = "YOUR_BEARER_TOKEN",
ApiUrl = "https://api.example.com/data",
Source = Web.Contents(ApiUrl,
[
Headers = [Authorization = "Bearer " & BearerToken]
]
),
JsonResponse = Json.Document(Source)
in
JsonResponse
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi @sthatoju , hello Fowmy, thank you for your prompt reply!
I agree with Fowmy, and as a supplement,let's see how we can leverage the API in Power Query via web.contents:
Web.Contents is a powerful function in Power Query that enables you to retrieve web content directly, without the need for a browser.
This function is especially beneficial for accessing APIs that return data in formats such as JSON or CSV.
By utilizing the Authorization header along with your bearer token, you can securely access protected resources, ensuring that your data retrieval is both efficient and secure.
I hope the following article is helpful:
Web.Contents and APIs in Power BI
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @sthatoju , hello Fowmy, thank you for your prompt reply!
I agree with Fowmy, and as a supplement,let's see how we can leverage the API in Power Query via web.contents:
Web.Contents is a powerful function in Power Query that enables you to retrieve web content directly, without the need for a browser.
This function is especially beneficial for accessing APIs that return data in formats such as JSON or CSV.
By utilizing the Authorization header along with your bearer token, you can securely access protected resources, ensuring that your data retrieval is both efficient and secure.
I hope the following article is helpful:
Web.Contents and APIs in Power BI
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@sthatoju
You can connect using Power Query, the genral format will be:
let
BearerToken = "YOUR_BEARER_TOKEN",
ApiUrl = "https://api.example.com/data",
Source = Web.Contents(ApiUrl,
[
Headers = [Authorization = "Bearer " & BearerToken]
]
),
JsonResponse = Json.Document(Source)
in
JsonResponse
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thanks @Fowmy for your reply.
I will try it out. However, could you please confirm me that, this power query setup will work for the endusers(consumers), who will run the report.
I want to build a report and deliver to the end users.
Thanks
Santhosh
@sthatoju
It should as you use a token to authenticate
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 33 | |
| 31 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 55 | |
| 31 | |
| 24 | |
| 23 |