# Get Publish-to-Web & Org. share links from Power BI API with Python

> I explain how to call the Power BI APIs from Python with a Service Principal to get all the publish-to-web and cross-org share links in your tenant, which pose a big governance risk.

- URL: https://data-goblins.com/get-publish-to-web-power-bi-python
- Author: Kurt Buhler
- Published: 2022-05-08
- Topic: Admin and governance

# USE PYTHON TO GET DATA FROM POWER BI APIs

*…such as the **publish-to-web links** created in your organization*

---

## IN THIS ARTICLE

- **Get Publish-to-Web share links** from Power BI Admin API using Python
- **Get links shared to the entire organization** (i.e. for Reports, Dashboards)

<figure class="dg-figure"><img src="https://images.data-goblins.blog/2025/12/publish-to-web-python-output.png" alt=" Example result dataframe for publish-to-web reports obtained with Power BI APIs "><figcaption>Example result dataframe for publish-to-web reports obtained with Power BI APIs</figcaption></figure>

---

## HOW TO SET IT UP?

I wrote a post about setting up a Service Principal, permissions & settings to get you started, as well as explaining the Authentication. You can [**find that post, here**.](https://data-goblins.com/power-bi-api-python)

---

---

---

*Code is provided as-is with no guarantees or warranties of any kind. Something I did quickly in spare time.*

---
