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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
Rosenmeyer
Frequent Visitor

Python Script to fetch data from a REST API

We have an application that just made REST API available. 

 

We want to extract data from here and make nice dashboards in PowerBI. So the final goal for this is to be realtime. 

Now the token for the REST API expires every 2 minutes. So we made a python script that fetches the token. Then fetches the data afterwards, using the REST API token that expires every 2 minutes. The final output is a json file. 

 

I'm currently getting this error when trying to run my Python Script to fetch the data:

 

Details: "ADO.NET: Python script error.
<pi>urllib3.exceptions.SSLError: Can't connect to HTTPS URL because the SSL module is not available.

During handling of the above exception, another exception occurred:

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='forsi.dk', port=443): Max retries exceeded with url: /eap/external-rest-api/v2/authentication (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))

During handling of the above exception, another exception occurred:

requests.exceptions.SSLError: HTTPSConnectionPool(host='forsi.dk', port=443): Max retries exceeded with url: /eap/external-rest-api/v2/authentication (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
</pi>"

1 ACCEPTED SOLUTION

Hi Kelly

 

I managed to fix it by reinstalling anaconda3 entirely and Power BI entirely, thanks for your reply though!

 

Best regards,

Rasmus

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi  @Rosenmeyer ,

 

It‘s an error from Python side.

Try to take below steps to solve it:

1. In the virtual environment:
pip install pyOpenSSL
2. Add environment variables
F:\Anaconda\envs\open3d\Library\bin
3. Restart pycharm

 

Or check below thread to see whether it helps:

https://stackoverflow.com/questions/54135206/requests-caused-by-sslerrorcant-connect-to-https-url-be...

 

Best Regards,
Kelly

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

 

Hi Kelly

 

I managed to fix it by reinstalling anaconda3 entirely and Power BI entirely, thanks for your reply though!

 

Best regards,

Rasmus

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.