Use the REST API to interact with dependency changes.
You can use the REST API to view dependency changes, and the security impact of these changes, before you add them to your environment. You can view the diff of dependencies between two commits of a repository, including vulnerability data for any version updates with known vulnerabilities. For more information about dependency review, see Dependency review.
Note
Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.
GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}
Gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
basehead (string) (required)
The base and head Git revisions to compare. The Git revisions will be resolved to commit SHAs. Named revisions will be resolved to their corresponding HEAD commits, and an appropriate merge base will be determined. This parameter expects the format {base}...{head}.
name (string)
The full path, relative to the repository root, of the dependency manifest file.
200 - OK
400 - Bad Request
403 - Response for a private repository when GitHub Advanced Security is not enabled, or if used against a fork
404 - Resource not found
500 - Internal Error
503 - Service unavailable
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/dependency-graph/compare/BASEHEAD
Response schema (Status: 200):
Array of objects:
change_type: required, string, enum: added, removedmanifest: required, stringecosystem: required, stringname: required, stringversion: required, stringpackage_url: required, string or nulllicense: required, string or nullsource_repository_url: required, string or nullvulnerabilities: required, array of objects:
severity: required, stringadvisory_ghsa_id: required, stringadvisory_summary: required, stringadvisory_url: required, stringscope: required, string, enum: unknown, runtime, development