Use the REST API to export the software bill of materials (SBOM) for a repository.
If you have at least read access to the repository, you can export the dependency graph for the repository as an SPDX-compatible, Software Bill of Materials (SBOM), via the GitHub UI or GitHub REST API. For more information, see Exporting a software bill of materials for your repository.
This article gives details about the REST API endpoint.
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/sbom
Warning
Closing down notice: This operation is closing down and will not be accessible after November 13, 2026. Please migrate to the asynchronous flow. Use "Request generation of a software bill of materials (SBOM) for a repository" to trigger the report, then "Fetch a software bill of materials (SBOM) for a repository" to retrieve it. For more information, see the changelog.
Exports the software bill of materials (SBOM) for a repository in SPDX JSON format.
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.
200 - OK
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/dependency-graph/sbom
Response schema (Status: 200):
sbom: required, object:
SPDXID: required, stringspdxVersion: required, stringcomment: stringcreationInfo: required, object:
created: required, stringcreators: required, array of stringname: required, stringdataLicense: required, stringdocumentNamespace: required, stringpackages: required, array of objects:
SPDXID: stringname: stringversionInfo: stringdownloadLocation: stringfilesAnalyzed: booleanlicenseConcluded: stringlicenseDeclared: stringsupplier: stringcopyrightText: stringexternalRefs: array of objects:
referenceCategory: required, stringreferenceLocator: required, stringreferenceType: required, stringrelationships: array of objects:
relationshipType: stringspdxElementId: stringrelatedSpdxElement: stringGET /repos/{owner}/{repo}/dependency-graph/sbom/fetch-report/{sbom_uuid}
Fetches a previously generated software bill of materials (SBOM) for a repository.
When the SBOM is ready, the response is a 302 redirect to a temporary download URL for the SBOM in SPDX JSON format.
The generated SBOM report may be retained for up to one week from the original request.
The temporary download URL returned by this endpoint expires separately, and its expiry is set when the fetch request is made.
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.
sbom_uuid (string) (required)
The unique identifier of the SBOM export.
202 - SBOM is still being processed, no content is returned.
302 - Redirects to a temporary download URL for the completed SBOM.
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/dependency-graph/sbom/fetch-report/SBOM_UUID
Response schema (Status: 202):
GET /repos/{owner}/{repo}/dependency-graph/sbom/generate-report
Triggers a job to generate a software bill of materials (SBOM) for a repository in SPDX JSON format.
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.
201 - Created
403 - Forbidden
404 - Resource not found
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/dependency-graph/sbom/generate-report
Response schema (Status: 201):
sbom_url: string