# 依存関係レビュー用の REST API エンドポイント

この REST API を使って依存関係の変更を操作します。

## 依存関係の確認について

この REST API を使い、依存関係の変更やこの変更がセキュリティに及ぼす影響を把握したうえで、この変更を環境に追加できます。 既知の脆弱性を含むすべてのバージョン アップデートの脆弱性データを含め、リポジトリの 2 つのコミット間の依存関係の差分を確認することができます。 依存関係レビューの詳細については、「[依存関係の確認](/ja/enterprise-cloud@latest/code-security/concepts/supply-chain-security/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 a diff of the dependencies between commits

```
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.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`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.

### HTTP response status codes

* **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

### Code examples

#### Example

**Request:**

```curl
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`, `removed`
* `manifest`: required, string
* `ecosystem`: required, string
* `name`: required, string
* `version`: required, string
* `package_url`: required, string or null
* `license`: required, string or null
* `source_repository_url`: required, string or null
* `vulnerabilities`: required, array of objects:
  * `severity`: required, string
  * `advisory_ghsa_id`: required, string
  * `advisory_summary`: required, string
  * `advisory_url`: required, string
* `scope`: required, string, enum: `unknown`, `runtime`, `development`