Forum Discussion
Power BI scanner API
Until mid-2024, the Scanner API primarily returned metadata about workspaces, datasets, tables, columns, measures, mashup queries, etc.
Now (in Enhanced version), Microsoft has extended it to include report schema — meaning you can extract:
Which reports exist in each workspace
What pages they contain
What visuals exist on each page
What fields/measures each visual references
But I will not found any Microsoft documention on that - could you please suggest your ideas
Hi ,Short answer: there isn’t (yet) a Microsoft Scanner API doc that says “we now return full report schema (pages → visuals → fields)”. The public, official docs still describe Scanner as tenant/workspace inventory + semantic-model “sub-artifact” metadata (tables, columns, measures, M/expressions, lineage, RLS, refresh, etc.).
What is documented today is a workable combo:
Use Scanner for inventory & dataset/lineage details
Set up metadata scanning and run
GetModifiedWorkspaces →PostWorkspaceInfo →GetScanStatus →GetScanResult.This returns workspaces, reports (IDs, names, types, ownership), datasets (tables/columns/measures, DAX/M, RLS, data sources), and more—assuming the Admin portal → “Enhance admin APIs responses with detailed metadata” switch is enabled. GitHub+3Microsoft Learn+3Microsoft Learn+3
Use the regular Reports REST/JS APIs for report schema
There are two places Microsoft documents page/visual info:REST (Reports) → list pages in a report (
GET /reports/{reportId}/pages). Microsoft LearnPower BI JavaScript (embedded/authoring APIs) → enumerate pages and visuals (
report.getPages(), thenpage.getVisuals()), get visual descriptors, export visual data, and even inspect/assign data fields via the authoring APIs. Microsoft Learn+3Microsoft Learn+3Microsoft Learn+3So if your goal is “Which reports → which pages → which visuals → which fields/measures each visual uses?”, the supported pattern today is:
Discover scope with Scanner (workspaces, report IDs, dataset lineage). Microsoft Learn+1
For each report ID, call Reports REST for pages. Microsoft Learn
For each page, use JavaScript client to get visuals and their data fields (authoring APIs).
Why this split?
-
The Scanner API is an admin/tenant-governance surface designed to scale and expose content inventory and model metadata. It has been enhanced over time (RLS, refresh, more dataset sub-artifacts), but Microsoft hasn’t published docs saying it returns full report layout/schema (pages/visuals/field bindings). Microsoft Learn+1
-
The Reports and Embedded/Authoring APIs are the documented way to traverse pages/visuals and read or manipulate data fields. Microsoft Learn+1
Practical blueprint (works today)
-
Run Scanner across your tenant; store report↔dataset mapping. Microsoft Learn
-
Iterate reports; call
GET /reports/{id}/pages. Microsoft Learn -
For each page, in a headless/automation context where you can use the JS client, call
page.getVisuals(); then use authoring APIs to read data fields/targets per visual. (You can alsovisual.exportData() if you need the summarized rows behind a visual.) Microsoft Learn+2Microsoft Learn+2If you specifically need “fields/measures each visual references” in a pure REST/admin flow (no JS), that’s not documented as available via Scanner today. The closest admin surfaces remain dataset-level sub-artifacts (measures, columns, M queries) and lineage; per-visual bindings are in the embedded/authoring layer.
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! tejaswi_464
-
-
2 Replies
- johnbasha33Super User
Hi ,Short answer: there isn’t (yet) a Microsoft Scanner API doc that says “we now return full report schema (pages → visuals → fields)”. The public, official docs still describe Scanner as tenant/workspace inventory + semantic-model “sub-artifact” metadata (tables, columns, measures, M/expressions, lineage, RLS, refresh, etc.).
What is documented today is a workable combo:
Use Scanner for inventory & dataset/lineage details
Set up metadata scanning and run
GetModifiedWorkspaces →PostWorkspaceInfo →GetScanStatus →GetScanResult.This returns workspaces, reports (IDs, names, types, ownership), datasets (tables/columns/measures, DAX/M, RLS, data sources), and more—assuming the Admin portal → “Enhance admin APIs responses with detailed metadata” switch is enabled. GitHub+3Microsoft Learn+3Microsoft Learn+3
Use the regular Reports REST/JS APIs for report schema
There are two places Microsoft documents page/visual info:REST (Reports) → list pages in a report (
GET /reports/{reportId}/pages). Microsoft LearnPower BI JavaScript (embedded/authoring APIs) → enumerate pages and visuals (
report.getPages(), thenpage.getVisuals()), get visual descriptors, export visual data, and even inspect/assign data fields via the authoring APIs. Microsoft Learn+3Microsoft Learn+3Microsoft Learn+3So if your goal is “Which reports → which pages → which visuals → which fields/measures each visual uses?”, the supported pattern today is:
Discover scope with Scanner (workspaces, report IDs, dataset lineage). Microsoft Learn+1
For each report ID, call Reports REST for pages. Microsoft Learn
For each page, use JavaScript client to get visuals and their data fields (authoring APIs).
Why this split?
-
The Scanner API is an admin/tenant-governance surface designed to scale and expose content inventory and model metadata. It has been enhanced over time (RLS, refresh, more dataset sub-artifacts), but Microsoft hasn’t published docs saying it returns full report layout/schema (pages/visuals/field bindings). Microsoft Learn+1
-
The Reports and Embedded/Authoring APIs are the documented way to traverse pages/visuals and read or manipulate data fields. Microsoft Learn+1
Practical blueprint (works today)
-
Run Scanner across your tenant; store report↔dataset mapping. Microsoft Learn
-
Iterate reports; call
GET /reports/{id}/pages. Microsoft Learn -
For each page, in a headless/automation context where you can use the JS client, call
page.getVisuals(); then use authoring APIs to read data fields/targets per visual. (You can alsovisual.exportData() if you need the summarized rows behind a visual.) Microsoft Learn+2Microsoft Learn+2If you specifically need “fields/measures each visual references” in a pure REST/admin flow (no JS), that’s not documented as available via Scanner today. The closest admin surfaces remain dataset-level sub-artifacts (measures, columns, M queries) and lineage; per-visual bindings are in the embedded/authoring layer.
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! tejaswi_464
-
-
- tejaswi_464Frequent Visitor
Thank you so much for your valuable suggestions