<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic API Limitations using Get commands &amp;quot;TooManyRequests&amp;quot; Error in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/API-Limitations-using-Get-commands-quot-TooManyRequests-quot/m-p/1803359#M29153</link>
    <description>&lt;P&gt;I've been unable to find documentation on the limits of GET requests from the Power BI REST API.&amp;nbsp; On the website they have details for POST listed, but not GET. See: &lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/automation/api-rest-api-limitations?redirectedfrom=MSDN" target="_blank"&gt;https://docs.microsoft.com/en-us/power-bi/developer/automation/api-rest-api-limitations?redirectedfrom=MSDN&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Does anyone know the limitations of Get in the Power BI REST API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#################################
#            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
    }           
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="khaledgraham_0-1619206740355.png" style="width: 594px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/501059i391785E3986EEF88/image-dimensions/594x306?v=v2" width="594" height="306" role="button" title="khaledgraham_0-1619206740355.png" alt="khaledgraham_0-1619206740355.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Apr 2021 19:43:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-04-23T19:43:37Z</dc:date>
    <item>
      <title>API Limitations using Get commands "TooManyRequests" Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-Limitations-using-Get-commands-quot-TooManyRequests-quot/m-p/1803359#M29153</link>
      <description>&lt;P&gt;I've been unable to find documentation on the limits of GET requests from the Power BI REST API.&amp;nbsp; On the website they have details for POST listed, but not GET. See: &lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/automation/api-rest-api-limitations?redirectedfrom=MSDN" target="_blank"&gt;https://docs.microsoft.com/en-us/power-bi/developer/automation/api-rest-api-limitations?redirectedfrom=MSDN&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Does anyone know the limitations of Get in the Power BI REST API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#################################
#            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
    }           
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="khaledgraham_0-1619206740355.png" style="width: 594px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/501059i391785E3986EEF88/image-dimensions/594x306?v=v2" width="594" height="306" role="button" title="khaledgraham_0-1619206740355.png" alt="khaledgraham_0-1619206740355.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 19:43:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-Limitations-using-Get-commands-quot-TooManyRequests-quot/m-p/1803359#M29153</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-23T19:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: API Limitations using Get commands "TooManyRequests" Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-Limitations-using-Get-commands-quot-TooManyRequests-quot/m-p/1804703#M29159</link>
      <description>&lt;P&gt;Hi @Anonymous&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no specific limitation,&lt;SPAN&gt;If you send too many requests you'll get this error.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/MicrosoftDocs/powerbi-docs/issues/2601" target="_self"&gt;https://github.com/MicrosoftDocs/powerbi-docs/issues/2601&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Liang &lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 02:21:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-Limitations-using-Get-commands-quot-TooManyRequests-quot/m-p/1804703#M29159</guid>
      <dc:creator>V-lianl-msft</dc:creator>
      <dc:date>2021-04-26T02:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: API Limitations using Get commands "TooManyRequests" Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-Limitations-using-Get-commands-quot-TooManyRequests-quot/m-p/2301742#M34063</link>
      <description>&lt;P&gt;Hi!&amp;nbsp; Thank you for this script. I could use it after I created a workspaces array to hold the workspaces.&lt;/P&gt;&lt;P&gt;Well, have you managed to find a good solution since this post?&lt;/P&gt;&lt;P&gt;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&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 18:57:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-Limitations-using-Get-commands-quot-TooManyRequests-quot/m-p/2301742#M34063</guid>
      <dc:creator>bertalan_ronai</dc:creator>
      <dc:date>2022-01-25T18:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: API Limitations using Get commands "TooManyRequests" Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-Limitations-using-Get-commands-quot-TooManyRequests-quot/m-p/2301765#M34064</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#################################
#            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()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 19:19:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-Limitations-using-Get-commands-quot-TooManyRequests-quot/m-p/2301765#M34064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-25T19:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: API Limitations using Get commands "TooManyRequests" Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/API-Limitations-using-Get-commands-quot-TooManyRequests-quot/m-p/2301773#M34065</link>
      <description>&lt;P&gt;Thanks! Wow, that Stopwatch feature is really useful.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 19:24:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/API-Limitations-using-Get-commands-quot-TooManyRequests-quot/m-p/2301773#M34065</guid>
      <dc:creator>bertalan_ronai</dc:creator>
      <dc:date>2022-01-25T19:24:54Z</dc:date>
    </item>
  </channel>
</rss>

