Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

API Limitations using Get commands "TooManyRequests" Error

I've been unable to find documentation on the limits of GET requests from the Power BI REST API.  On the website they have details for POST listed, but not GET. See: https://docs.microsoft.com/en-us/power-bi/developer/automation/api-rest-api-limitations?redirectedfr...

 

I'm using Get-PowerBIReport along with Get-PowerBIWorkspace and looping through each workspace. Whenever I reach a certain number of workspaces, about halfway through, I get the "TooManyRequests" error. I've even tried adding Start-Sleep to slow the script down, but it fails regardless. Below is a snippet of my code and the error it provides in PowerShell. 

Does anyone know the limitations of Get in the Power BI REST API?

 

#################################
#            Reports            #
#################################
# Loops through each workspace and lists the reports in the workspace. 
$ReportsStartTime = $(get-date)
$ReportListExportPath = $exportPath + "ReportList" + $exportPathFileType

Write-Host ""
Write-Host "Starting Reports extract..." -ForegroundColor green 
$ReportsIncrementalCounter = 0 

$ReportList =
ForEach ($workspace in $Workspaces)
    {
    $ReportsIncrementalCounter ++
    Write-Host $ReportsIncrementalCounter " of " $Workspaces.Count " total workspaces. Fetching reports in workspace: " $workspace.Name
    #The script has to be paused to work around the API rate limitations error "too many requests". 
    Start-Sleep -m 500 
    ForEach ($report in (Get-PowerBIReport -Scope Organization -WorkspaceId $workspace.Id))
        {
        [pscustomobject]@{
            WorkspaceID     = $workspace.Id
            WorkspaceName   = $workspace.Name
            ReportID        = $report.Id
            ReportName      = $report.Name
            ReportURL       = $report.WebUrl
            ReportDatasetID = $report.DatasetId
            }
        }
    }
$ReportList
if ($?) {
    Write-Host "Successfully retrieved report variables." -ForegroundColor green  
    Write-Host "Exporting report information to .csv file." -ForegroundColor green
    $ReportList | Export-CSV $ReportListExportPath -NoTypeInformation -Encoding UTF8
        if ($?) {
            Write-Host "Successfully saved PowerBIReportList_$currentDate to C:\users\$env:USERNAME\Desktop" -ForegroundColor green             
            } 
            else {            
                write-host "Failed to save PowerBIReportList file to C:\users\$env:USERNAME\Desktop" -ForegroundColor yellow
    }           
}

khaledgraham_0-1619206740355.png

 

4 REPLIES 4
bertalan_ronai
Advocate I
Advocate I

Hi!  Thank you for this script. I could use it after I created a workspaces array to hold the workspaces.

Well, have you managed to find a good solution since this post?

I am currently experimenting with the Start-Sleep -seconds powershell script with 4 seconds between each call. The script above runs but then I run another one for the users with 1 call for each reportdataset and that fails. By the way I even had to use the Resolve-Error command to get the TooManyRequests error, because without it, I only get an aggregate error. Bertalan

Anonymous
Not applicable

 

Hello! Unfortunately I don't recall having a good solution for this issue. However, it appears I've made some changes to the script since I first asked for help. I believe I tinkered with the start-sleep time both inside and outside of the foreach loop and that seemed to have helped. 

 

#################################
#            Reports            #
#################################
# Loops through each workspace and lists the reports in the workspace. 
$ReportsStopWatch = New-Object -TypeName System.Diagnostics.Stopwatch
$ReportsStopWatch.Start()

$ReportListExportPath = $exportPath + "ReportList" + $exportPathFileType

Write-Host ""
Write-Host "Starting Reports extract..." -ForegroundColor green 
$ReportsIncrementalCounter = 0 
Start-Sleep -Seconds 300

$ReportList =
ForEach ($workspace in $Workspaces)
    {
    $ReportsIncrementalCounter ++
    Write-Host $ReportsIncrementalCounter " of " $Workspaces.Count " total workspaces. Fetching reports in workspace: " $workspace.Name
    #The script has to be paused to work around the API rate limitations error "too many requests". 
    Start-Sleep -Seconds 10 
    ForEach ($report in (Get-PowerBIReport -Scope Organization -WorkspaceId $workspace.Id))
        {
        [pscustomobject]@{
            WorkspaceID     = $workspace.Id
            WorkspaceName   = $workspace.Name
            ReportID        = $report.Id
            ReportName      = $report.Name
            ReportURL       = $report.WebUrl
            ReportDatasetID = $report.DatasetId
            }
        }
    }
$ReportList
if ($?) {
    Write-Host "Successfully retrieved report variables." -ForegroundColor green  
    Write-Host "Exporting report information to .csv file." -ForegroundColor green
    $ReportList | Export-CSV $ReportListExportPath -NoTypeInformation -Encoding UTF8
        if ($?) {
            Write-Host "Successfully saved PowerBIReportList_$currentDate to C:\users\$env:USERNAME\Desktop" -ForegroundColor green             
            } 
            else {            
                write-host "Failed to save PowerBIReportList file to C:\users\$env:USERNAME\Desktop" -ForegroundColor yellow
    }           
}

else {
    Write-Host "Failed to login to PowerBI. NOTE: Must have Global Admin, within Office 365 or Azure AD, or be a Power BI service administrator." -ForegroundColor yellow
    break
}
$ReportsElapsedTime = $ReportsStopWatch.Elapsed.Ticks
$ReportsStopWatch.Reset()

 

Thanks! Wow, that Stopwatch feature is really useful.

V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

There is no specific limitation,If you send too many requests you'll get this error.

https://github.com/MicrosoftDocs/powerbi-docs/issues/2601 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors