Semgrep’s API endpoints use both offset-based pagination and cursor-based pagination.Documentation Index
Fetch the complete documentation index at: https://docs.semgrep.dev/llms.txt
Use this file to discover all available pages before exploring further.
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 thepage_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
| Query parameter | Type | Description |
|---|---|---|
page | integer | The page of results to return. Page numbering begins at 0. Default: 0 |
page_size | integer | The maximum number of records returned per page. Default: 100. |
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.| Query parameter | Type | Description |
|---|---|---|
cursor | string | Cursor to paginate through the results. Provide the cursor value from the response to retrieve the next or previous page. |
limit | integer | Page size to paginate through the results. |
Example
To request a list of Secrets, make a cURL call as follows:cursor attribute. Save the value returned with cursor, and provide it in subsequent calls to retrieve 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. Adjustpage_size accordingly:
cursor as part of the response:
cursor key-value pair to the JSON body of subsequent calls to obtain additional pages: