Description | Some FortiGate API endpoints return a limited number of results per request (typically up to 1000 entries). This article explains how to use pagination to retrieve the full dataset using multiple API calls. |
Scope | REST API, FortiGate. |
Solution |
This article describes how to use pagination for some FortiGate API calls to retrieve all the entries in the case the number of results exceeds the default limit for single response, using the entrypoint /api/v2/monitor/firewall/internet-service-details as an example.
When querying the FortiGate API endpoint, the number of returned entries items is limited to 1000 per request. A script querying the API with, (for example, GET /api/v2/monitor/firewall/internet-service-details?id=<service_id>) returns only the first 1000 entries, even if some Internet Services (e.g. Microsoft-Azure) contain a lot more (e.g. 44936). The API limit enforces a maximum number of 1000 retrieved entries in a single call. To retrieve all entries, it is first important to determine the total number of entries using the summary_only=1 parameter:
GET /api/v2/monitor/firewall/internet-service-details?id=<service_id>&summary_only=1
GET /api/v2/monitor/firewall/internet-service-details?id=327786&count=1000&start=0&vdom=root |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.