To configure a Power Query to use the Web v2 connector, choose Get Data > From Web in Excel or Power BI instead of the generic Web option, confirm the connection uses the Web.Contents function in the Advanced Editor, and avoid hand-writing Web.Page calls. The Web v2 connector wraps the same M formula engine, so the choice mainly changes the dialog, the preview, and the default authentication flow rather than the underlying request. Configure it once and the query inherits the connector for every refresh.
The trap most guides skip: Microsoft's documentation states that Web.Page and Web.BrowserContents are not supported in dataflows, and Web.BrowserContents cannot be scheduled for refresh in Power BI Desktop's legacy Web connector. That single restriction decides whether your configured query survives publishing. The steps below assume you need a refreshable query, not a one-off preview.
What the Web V2 Connector Actually Is Inside Power Query
The Web v2 connector isn't a separate engine you install; it's the modern Get Data experience that generates M code for Web.Contents. When you open Get Data > From Web in a current Excel or Power BI Desktop build, the navigator dialog previews tables and lets you pick one, and the resulting query starts with Source = Web.Contents("https://…") rather than a legacy Web.Page call. Both calls live in the same M language, and Web.Contents remains the documented function for HTTP requests in Power Query.
Version matters here. Microsoft's connector reference classifies the Web connector by function, and Web.BrowserContents carries an explicit warning about refresh scheduling in Power BI Desktop. If your build predates the modern From Web dialog, you may only see the older Web.Page entry point in the navigator. Check the Advanced Editor before you assume you're on v2: a Web.Page(Web.Contents(...)) pattern is legacy, and a plain Web.Contents(...) chain with a Content or Binary.Buffer step is the v2 shape.
The connector also governs authentication. Current builds express credentials through a Web.Contents options record with ApiKeyName or through the Power Query credential dialog for anonymous, basic, Windows, organizational, and OAuth flows. That record is where v2 configuration actually lives, which is why the steps below focus on the formula bar as much as on the dialog.
One consequence is worth internalizing: because v2 is Web.Contents, every knob that applies to Web.Contents — query parameters, relative paths, manual headers, timeouts, and manual credential handling — applies to your "v2" query. The connector name describes the dialog; the function name describes the control surface.
How Web v2 Differs From the Legacy Web and Web.Page Options
The differences are functional, not cosmetic, and they show up after you publish, schedule, or parameterize the query. Microsoft's Power Query documentation on handling errors describes adding a manual status check with Web.Contents to catch HTTP codes before the query fails silently; the legacy Web.Page path gives you less of a hook to do that. Selecting a table in the v2 navigator also produces a stable Item reference into the response, which survives a URL parameter change better than a hand-sliced HTML table.
| Dimension | Web v2 (Web.Contents) | Legacy Web (Web.Page) | Generic Web option |
|---|---|---|---|
| M function generated | Web.Contents | Web.Page | Web.Contents with minimal options |
| Supported in dataflows | Yes | No, per Microsoft's function reference | Yes |
| Refresh scheduling in Desktop | Yes with manual credential handling | Limited; Web.BrowserContents explicitly excluded | Yes |
| Preview in navigator | Table/HTML preview | HTML document view | Raw content list |
| Manual HTTP status handling | Yes, via options record | Indirect | Yes |
| API key naming | ApiKeyName option | Not exposed | ApiKeyName option |
Read the table as a refresh test, not a feature score. If a query must run inside a dataflow, the legacy Web.Page row disqualifies it outright regardless of how neatly the preview renders. The credit question also belongs here: Microsoft's documentation notes that requests from connectors like Web.Contents that return data inside the response body are treated differently from connectors that return a reference or link to external data, which affects credit estimation in Dataflows and Fabric. Confirm the current behavior on the maker's documentation before budgeting refresh capacity.
Verdict rule: pick v2 when the query refreshes, ships to a dataflow, or needs an API key; keep legacy only when you're reverse-engineering a single static HTML page and never schedule it. Anything you hand-build with Web.Page inside a scheduled pipeline is a future outage.
Step 1: Start From Get Data > From Web, Not the Generic Web Entry
Numbered steps, in the order that avoids rework.
1: Open the workbook or semantic model, select Data, then Get Data, then From Web. In Power BI Desktop the same path sits on the Home ribbon. 2: In the URL field, paste the full endpoint including any query string. If the URL requires an API key, do not put the key in the URL — the credential dialog is where it belongs. 3: Choose the HTTP method in the advanced options: GET by default, POST only when the endpoint demands a body. Microsoft's Web.Contents reference lists the available options record fields, including IsRetry, ManualStatusHandling, and ApiKeyName. 4: Let authentication default to Anonymous for public endpoints; select the scheme the endpoint advertises for protected ones. 5: In the navigator, select the specific table rather than the top-level document. The dialog then writes a Web.Contents step plus a navigation step for you. 6: Click Transform Data, open the Advanced Editor, and confirm the first steps read Web.Contents and not Web.Page. If you see Web.Page, you took the legacy route and should restart.
Failure handling: a 401 error after step 4 usually means the endpoint expects a key in a header, not in the query string. Move the key into the Headers record and set ApiKeyName only when the service documents that pattern. A 403 after publishing usually means the refresh credentials differ from desktop credentials; re-enter them in the dataset settings, not in the workbook.
Step 2: Edit the M Source Step for Relative Paths and Query Options
The v2 dialog writes an absolute URL, and absolute URLs break the moment an environment changes from staging to production. The fix is a base URL parameter plus RelativePath. Incremental refresh also refuses to fold with a hard-coded absolute URL, so this step doubles as the prerequisite for partitioning large endpoints.
Open the Advanced Editor and restructure the source step so the host is a parameter and the path segments are separate strings. Microsoft's Web.Contents reference supports RelativePath inside the options record, which resolves against the base URL. Keep the base in a query parameter or a Power Query parameter table so a single edit repoints every dependent query.
Set ManualStatusHandling to catch specific codes such as 404 or 429, and add an IsRetry field when the endpoint throttles. Leave Timeout alone unless the endpoint is documented as slow; the default is documented on the function reference page and changing it hides slow-response problems you should fix instead.
Common failure: query-string parameters typed directly into the URL bypass folding. Move them into the Query record field so the engine can push them down. If your refresh gets slower after adding parameters, that's usually why.
Step 3: Configure Authentication Without Breaking Refresh
Authentication is the step where "works on my machine" becomes "fails at 6 a.m. in the cloud." The credential dialog offers Anonymous, Windows, Basic, Web API key, and organizational account. Web API key corresponds to ApiKeyName in the formula, and the key value is stored in the credential cache, not in the M code. Never hard-code a key string in the query text — it travels with the file.
Organizational account uses OAuth and triggers a consent prompt the first time. Schedule refresh against a source that requires interactive sign-in and you'll get a credential error on the gateway unless the gateway administrator has enabled the right OAuth flow. Check that the connection type in dataset settings matches the scheme you chose in desktop; a mismatch is the most common post-publish 401.
For the Power BI service and a personal data gateway, Microsoft's gateway documentation states that the gateway must be reachable by the refresh engine and that credentials are stored per connection. That means the gateway administrator's credential store, not your desktop cache, is the one that matters at refresh time. Confirm the specific gateway in use before filing a ticket.
Failure case worth knowing: endpoints that issue short-lived tokens break scheduled refresh when the token expires faster than the refresh interval. Manual credential handling with a refresh token driven by a separate query is the documented workaround pattern, and it's fiddly enough that many teams version the token outside the model.
Step 4: Handle Pagination and API Limits in the Query
Endpoints that return 100 records at a time don't become one dataset because the navigator previewed a page. Pagination in M is a recursive function pattern: build a function that requests page N, checks the response for a next-page indicator, and stops when the indicator is absent. The response body shape controls the check, so Json.Document plus a field inspection is the norm.
Guard the recursion with a page cap. Microsoft's documentation and community guidance on pagination warn against unbounded loops; a cap of 200 pages and a maximum-row count prevents a misbehaving endpoint from spinning the refresh all night. Put the cap in a parameter so it's visible, not buried.
Rate limiting is a separate axis. When the endpoint returns 429, Web.Contents raises an error unless you list 429 in ManualStatusHandling and then retry after a computed delay. Build the delay from a parameter, not from a random number, so the behavior is auditable.
Then there's the refresh window. A query pulling 20,000 records at 100 per page needs 200 sequential requests; at a conservative 300 ms per round trip that's about 60 seconds of wall time before parsing overhead, and double it if the API takes a full second. Compute your own ceiling before scheduling and don't rely on the gateway default.
Step 5: Test Error Paths Before You Publish the Query
A query that only saw successful responses during development hasn't been configured, it's been exercised. Build three test variants: a deliberately wrong status code URL, a throttled endpoint, and an expired credential. Each should surface a clear error rather than a blank table.
Microsoft's documentation on handling errors shows the manual status check pattern: call Web.Contents with ManualStatusHandling listing the codes you want to inspect, then read the response status and branch. That branch is where you log a readable message. Power Query has no console, so the message has to live in a custom column or an error expression.
Also test the published path, not just desktop. Publish the model, open dataset settings, confirm the credentials are bound to the same source, and trigger a manual refresh. A passing desktop test and a failing service refresh is usually a credential scope issue, sometimes a firewall rule on the gateway host.
One edge scenario deserves a dedicated test: endpoints that return valid JSON with an error object inside it and an HTTP 200 status. That is not an HTTP error, so no status-code handling catches it. Inspect the body schema explicitly.
Step 6: Fold, Buffer, and Document What You Configured
Folding in Power Query isn't an all-or-nothing property for web sources the way it is for database sources, but relative paths and query records still decide whether incremental refresh can partition. If incremental refresh is the goal, keep the URL composition inside Web.Contents options and avoid transformations that break the chain above the source step.
Buffering trades memory for request count. When a query is referenced by several downstream queries, without a buffer each reference re-issues the HTTP call. Binary.Buffer or Table.Buffer around the response stops the duplicate calls but pins the data in memory; Microsoft's guidance on table buffering covers when it helps and when it causes memory pressure on constrained gateways.
Document the configuration where the next maintainer will look. That means a parameter table listing base URL, page cap, retry delay, and credential scheme, plus a comment block above the source step naming who owns the API key rotation. Undocumented configuration is the leading cause of "it worked last quarter" investigations.
Close the loop with a smoke refresh after every change. One manual refresh, one published refresh, one check of the gateway logs; three minutes that prevent a morning of stale dashboards.
Choosing Between Web v2, OData, and a Native Connector
Web v2 is the wrong answer when a native connector exists. OData feeds, SharePoint lists, and common SaaS APIs all have dedicated connectors that handle pagination, authentication, and folding better than a hand-built Web.Contents query. The comparison below is on the dimensions that decide an architecture, not on marketing labels.
| Dimension | Web v2 (Web.Contents) | OData connector | Native connector (e.g. a published app connector) |
|---|---|---|---|
| Pagination | Manual, recursive function | Automatic | Automatic |
| Authentication | Credential dialog plus ApiKeyName | OAuth or organizational account | Service-specific |
| Folding support | Limited, endpoint-dependent | Yes for OData operators | Connector-defined |
| Dataflow compatibility | Yes | Yes | Connector-defined |
| Maintenance owner | You | Microsoft | Microsoft |
Rule: use Web v2 when there's no native connector or when the endpoint returns a format the connector won't parse; use OData when the endpoint offers an OData feed; use the native connector whenever one exists and is maintained. The maintenance-owner row is the one that costs real money in developer hours, and custom Web v2 queries sit at the wrong end of it.
Performance and Credit Math for a v2 Query
Cost in Dataflows and Fabric turns on how the connector reports data. Microsoft's documentation on evaluating requests states that connectors returning data inside the response body, like Web.Contents, are evaluated differently from connectors returning a link to external data, and that this affects credit estimation. The practical number is your call volume.
Take an endpoint returning 5,000 records in pages of 500. That's 10 requests per refresh. Ten refreshes a day across five exercises gives 500 requests daily. Add a 20% buffer for retries and development refreshes, and plan for 600. If your API's documented rate limit is 60 requests per minute, that budget fits easily; if it's 10 per minute, you've built a bottleneck that scheduling won't fix.
Latency math matters just as much. At an average 400 ms round trip, 10 requests is about 4 seconds; at 500 records per request and 10,000 rows, 20 requests is about 8 seconds, plus parsing and type conversion. Multiply by refresh frequency and compare to the gateway's refresh timeout before you blame the connector.
Version-specific caution: capacity behavior for web sources has changed across Fabric releases since 2023, so treat any figure here as a planning estimate and confirm current credit treatment on the maker's documentation before you defend a budget.
FAQ
Does the Web v2 connector work in a dataflow?
Yes, when the generated code uses Web.Contents, but not when it uses Web.Page or Web.BrowserContents, which Microsoft's function reference excludes from dataflows. Check the Advanced Editor before building the flow; a legacy dialog will write Web.Page and fail at the first refresh. Rebuild the query through Get Data > From Web to get the supported shape.
Why does my v2 query refresh in Desktop but fail in the Power BI service?
The service refresh uses credentials stored in the dataset settings, not your desktop cache. Open Settings > Data source credentials and rebind them; a scheme mismatch (Basic in desktop, Anonymous in the service) is the usual culprit. If a personal gateway sits between the service and the endpoint, confirm the gateway host can reach it and that the gateway administrator entered the credentials.
Is Web v2 faster than the old Web.Page approach?
Not inherently — the speed difference comes from what you configure. Web.Contents with query records and relative paths lets the engine fold and cache, while a hand-sliced Web.Page table re-fetches the whole HTML document each time. Expect meaningful gains only when you move parameters into options and avoid repeated un-buffered calls.
Can I paginate with Web v2, or do I need a different connector?
Pagination is possible with Web.Contents, but you build it. The standard pattern is a recursive function that inspects the response for a next-page indicator and stops when absent, with a page cap and retry delay as parameters. Native connectors do this automatically, so use them when available.
Why does my API key show up in the query text?
Because it was typed into the URL or hard-coded in a header. Remove it, set ApiKeyName for services that document that pattern, and enter the value through the credential dialog. Keys in query text travel with the workbook and end up in version control.
What happens if the endpoint returns 429 during refresh?
Web.Contents raises an error unless 429 is listed in ManualStatusHandling. Add it, then branch on the status to wait a computed delay and retry, with a maximum attempt count. Without that handling, one throttle event fails the whole refresh.
Do I need to change anything for incremental refresh?
Incremental refresh needs a foldable source, so compose URLs from relative paths and query records inside Web.Contents rather than hard-coding an absolute URL. Native connectors fold more predictably; if the endpoint is large and refresh-critical, weigh a native connector before committing to a custom query.
Can the v2 connector read a JSON API, or is it HTML only?
It returns whatever the endpoint sends. Web.Contents hands back raw content, and Json.Document parses it; the navigator previews tables and HTML, which is why JSON endpoints sometimes look empty until you change the response type manually. Body-level errors returned with HTTP 200 need their own schema check.