Forum Discussion

tejaswi_464's avatar
tejaswi_464
Frequent Visitor
9 months ago
Solved

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 includ...
  • johnbasha33's avatar
    9 months ago

    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 Learn

    Power BI JavaScript (embedded/authoring APIs) → enumerate pages and visuals (report.getPages(), then page.getVisuals()), get visual descriptors, export visual data, and even inspect/assign data fields via the authoring APIs. Microsoft Learn+3Microsoft Learn+3Microsoft Learn+3

    So 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)

      1. Run Scanner across your tenant; store report↔dataset mapping. Microsoft Learn

      2. Iterate reports; call GET /reports/{id}/pages. Microsoft Learn

      3. 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 also visual.exportData() if you need the summarized rows behind a visual.) Microsoft Learn+2Microsoft Learn+2

        If 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