i am unable to connect data from website in power bi desktop

Ujwala Desai 40 Reputation points
2026-11-11T19:26:34.0666667+00:00

Details: "Web.Contents failed to get contents from 'https://www.investopedia.com/terms/d/data-analytics.asp' (402): Payment Required"

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

Answer accepted by question author

AI answer

2026-11-11T19:28:00.3666667+00:00

Use an official API, downloadable dataset, or a manually saved file instead of directly importing this Investopedia page, because Power BI is receiving HTTP 402 Payment Required from the website.

Web.Contents performs an HTTP request and surfaces the endpoint’s response; the error does not indicate that a Power BI or Microsoft subscription payment is required.^1^ It commonly means the target site is refusing that form of automated request.

  1. If you need underlying financial or analytics data:
    Obtain it from an API or downloadable CSV/Excel source whose terms permit automated retrieval. In Power BI Desktop, select Home → Get data, then choose Web, Text/CSV, or Excel workbook, as appropriate.
  2. If you only need the article content once:
    Save or export the permitted content to a local file, structure it in Excel or CSV, and import that file. This avoids depending on a protected webpage during every refresh.
  3. If Investopedia provides authorized API access:
    Use its documented API endpoint and authentication method rather than the article URL. Web.Contents supports query parameters, request headers, and API-key credentials.^1^

For example, the general Power Query pattern for an API key is:

let
    Source = Web.Contents(
        "https://api.example.com/data",
        [ApiKeyName = "api_key"]
    ),
    Result = Json.Document(Source)
in
    Result

Enter the key through the Web API credential dialog rather than placing the secret directly in the query.

Conditional test for browser-rendered HTML

If you have permission to retrieve the page and it works only after scripts run in a browser, test Power BI Desktop’s browser-based HTML connector:

  1. Select Home → Get data → Web.
  2. Enter the page URL and select OK.
  3. Use Anonymous authentication if the page is publicly accessible.
  4. Check whether Navigator displays usable tables.

Power BI Desktop uses Web.BrowserContents for browser-oriented HTML, while Web.Contents is intended primarily for content such as CSV, text, and JSON. Web.BrowserContents uses Microsoft Edge WebView2.^2^

This test will not overcome a site’s access restrictions. If it still returns 402, there is no Power BI setting that can authorize the request; contact the website owner for a supported endpoint or use another source. Changing credentials, clearing Power BI permissions, or using ManualStatusHandling might expose the response differently, but it does not turn a rejected response into accessible data.

Also note that websites requiring authentication might not work correctly with the standard Web connector.^3^


References

  1. Web.Contents - PowerQuery M | Microsoft Learn
  2. Troubleshooting the Web connector
  3. Tutorial: Import and analyze data from a webpage - Power BI
AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Oldest

Your answer

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