Many Falcon API endpoints return paginated results to handle large datasets efficiently. PSFalcon provides automatic pagination support through the -All parameter, allowing you to retrieve complete result sets without manual page handling.
PSFalcon commands support various pagination parameters:
-Limit
Maximum number of results per request.
# Get first 100 hostsGet-FalconHost -Limit 100# Different endpoints have different max limits# From devices.ps1:165: Max is 5000 for Get-FalconHostGet-FalconHost -Limit 5000
When used with -All, sets the page size for each request.
-Offset
Position to begin retrieving results (zero-based).
From /home/daytona/workspace/source/private/Private.ps1:732-737, when using -All without -Limit:
# PSFalcon automatically sets Limit to the maximum allowed for the endpointGet-FalconHost -All# Equivalent to:Get-FalconHost -All -Limit 5000 # Max for this endpoint
This optimizes performance by reducing the number of API requests needed.
# Use -RawOutput to see full response including metadata$Response = Get-FalconHost -Limit 100 -RawOutput$Response.meta.pagination# total : 5000# offset : 0# limit : 100
The -RawOutput parameter is available on many commands to return the complete API response including metadata.
From /home/daytona/workspace/source/private/Private.ps1:635-638, PSFalcon automatically refreshes authentication tokens during long pagination operations:
# No action needed - tokens are refreshed automaticallyGet-FalconHost -All # May take several minutes for large datasets# PSFalcon checks token expiration before each request# If token expires in < 240 seconds, it's automatically refreshed
Some endpoints use scroll-based pagination with the after token:
# Scroll endpoints automatically use the 'after' tokenGet-FalconHost -All # Uses /devices/queries/devices-scroll/v1:get# PSFalcon detects and uses the 'after' token from the response# No manual handling required
From /home/daytona/workspace/source/private/Private.ps1:622-624, the after token is automatically detected and used.