Skip to main content
Semgrep’s API endpoints use both offset-based pagination and cursor-based pagination.

Offset-based pagination

Offset-based pagination defines a limit to specify the number of entries fetched and offset to indicate where to start collecting data, which correspond to the page_size and page query parameters described in this section. The following API endpoints support offset-based pagination:

List all projects

List code or supply chain findings

For these endpoints, include the following query parameters to paginate through results:

Example

To request a list of Code or Supply Chain findings, specifically the second page where each page contains 100 items, make a cURL call as follows:

Cursor-based pagination

The List Secrets endpoint supports cursor-based pagination: For these endpoints, include the following query parameters to paginate through results.

Example

To request a list of Secrets, make a cURL call as follows:
The response includes the cursor attribute. Save the value returned with cursor, and provide it in subsequent calls to retrieve additional pages:
Repeat this process for additional pages.

Mixed pagination

The following API endpoints support mixed usages of page- and cursor-based pagination:

List repositories with dependencies

List lockfiles in a given repository with dependencies

List dependencies

Example

To request a list of repositories with dependencies, make a call to the following URL. Adjust page_size accordingly:
The API returns cursor as part of the response:
Add the cursor key-value pair to the JSON body of subsequent calls to obtain additional pages: