Error when accessing data from Web via APIs

Aashima 0 Reputation points
2025-01-28T09:44:17.9533333+00:00

How do I fix the error that I am getting when trying to get data from web. The username and password is correct and I am using API key but I am getting this error in the preview window “We were unable to retrieve the contents of the web page”

Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
5,673 questions
Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,142 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiajing Hua-MFST 14,420 Reputation points Microsoft Vendor
    2025-01-29T02:26:46.9533333+00:00

    Hi @Aashima

    I suggest you try accessing the URL in your browser to make sure that it is publicly accessible and the API endpoint is working as expected.

    Make sure you're choosing the correct authentication method. For an API key, you typically need to use Web API authentication.

    If the API you're calling requires the API key in the request header, in Power Query Editor, select Home > Advanced Editor.

    Modify the M code to include the API key in the headers. The reference: Data from web - DataSource.Error - unable to retrieve contents of page

    If you have more issues on M code, it's recommended to post a new thread in power Query forum: https://community.fabric.microsoft.com/t5/Power-Query/bd-p/power-bi-services

    There are experts there who can give more comprehensive advice. Thanks for your understandings.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.