# 라이선스에 대한 REST API 엔드포인트

REST API를 사용하여 인기 있는 open source 라이선스 및 특정 프로젝트의 라이선스 파일에 대한 정보를 검색합니다.

## 라이선스 정보

GitHub는 프로젝트의 라이선스 식별을 위해 [오픈 소스 Ruby Gem Licensee](https://github.com/benbalter/licensee) 를 활용합니다. 라이선스 실시권자는 프로젝트의 `LICENSE` 파일(있는 경우)의 콘텐츠를 알려진 라이선스의 짧은 목록과 비교합니다. 따라서 API는 프로젝트 종속성의 라이선스 또는 설명서의 라이선스 이름에 대한 참조와 같은 프로젝트 라이선스를 문서화하는 다른 방법을 고려하지 않습니다.

라이선스가 일치하는 경우 반환되는 라이선스 키와 이름은 [SPDX 사양](https://spdx.org/)을 준수합니다.

**참고:** 다음과 같은 엔드포인트는 리포지토리의 라이선스 정보도 반환합니다.

* [리포지토리 가져오기](/ko/enterprise-server@3.22/rest/repos/repos#get-a-repository)
* [사용자를 위한 리포지토리 나열](/ko/enterprise-server@3.22/rest/repos/repos#list-repositories-for-a-user)
* [조직 리포지토리 나열](/ko/enterprise-server@3.22/rest/repos/repos#list-organization-repositories)
* [포크 목록](/ko/enterprise-server@3.22/rest/repos/forks#list-forks)
* [사용자가 보는 리포지토리 나열](/ko/enterprise-server@3.22/rest/activity/watching#list-repositories-watched-by-a-user)
* [팀 리포지토리 나열](/ko/enterprise-server@3.22/rest/teams/teams#list-team-repositories)

> \[!WARNING]
> GitHub 많은 것들이지만 법률 회사가 아닙니다. 따라서 GitHub은(는) 법률 자문을 제공하지 않습니다. API를 사용하거나 이에 대한 메일을 보내는 것은 법률 자문을 구성하지 않으며 변호사와 클라이언트 관계를 만들지 않습니다. 특정 라이선스로 수행할 수 있는 작업과 수행할 수 없는 사항에 대한 질문이 있는 경우 진행하기 전에 자신의 법률 고문과 상의해야 합니다. 법적 파급 효과가 있거나 법적 권리에 영향을 미칠 수 있는 결정을 내리기 전에 항상 자신의 변호사와 상의해야 합니다.
>
> GitHub 사용자가 open source 라이선스 및 해당 라이선스를 사용하는 프로젝트에 대한 정보를 얻을 수 있도록 이러한 엔드포인트를 만들었습니다. 그것이 도움이 되기를 바라지만 당사는 변호사가 아니며(적어도 우리 대부분은 그렇지 않음) 모든 사람들과 같이 실수할 수 있다는 것을 명심하시기 바랍니다. 해당 이유로 GitHub은(는) “있는 그대로” API를 제공하고 이를 통하거나 이에 제공된 정보 또는 라이선스에 대한 보증을 하지 않으며 API 사용으로 인한 손해에 대한 책임을 부인합니다.

> \[!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 all commonly used licenses

```
GET /licenses
```

Lists the most commonly used licenses on GitHub. For more information, see "Licensing a repository ."

### Parameters

#### Headers

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

#### Path and query parameters

* **`featured`** (boolean)

* **`per_page`** (integer)
  The number of results per page (max 100). For more information, see "Using pagination in the REST API."
  Default: `30`

* **`page`** (integer)
  The page number of the results to fetch. For more information, see "Using pagination in the REST API."
  Default: `1`

### HTTP response status codes

* **200** - OK

* **304** - Not modified

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  http(s)://HOSTNAME/api/v3/licenses
```

**Response schema (Status: 200):**

Array of `License Simple`:

* `key`: required, string
* `name`: required, string
* `url`: required, string or null, format: uri
* `spdx_id`: required, string or null
* `node_id`: required, string
* `html_url`: string, format: uri

## Get a license

```
GET /licenses/{license}
```

Gets information about a specific license. For more information, see "Licensing a repository ."

### Parameters

#### Headers

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

#### Path and query parameters

* **`license`** (string) (required)

### HTTP response status codes

* **200** - OK

* **304** - Not modified

* **403** - Forbidden

* **404** - Resource not found

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  http(s)://HOSTNAME/api/v3/licenses/LICENSE
```

**Response schema (Status: 200):**

* `key`: required, string
* `name`: required, string
* `spdx_id`: required, string or null
* `url`: required, string or null, format: uri
* `node_id`: required, string
* `html_url`: required, string, format: uri
* `description`: required, string
* `implementation`: required, string
* `permissions`: required, array of string
* `conditions`: required, array of string
* `limitations`: required, array of string
* `body`: required, string
* `featured`: required, boolean

## Get the license for a repository

```
GET /repos/{owner}/{repo}/license
```

This method returns the contents of the repository's license file, if one is detected.
This endpoint supports the following custom media types. For more information, see "Media types."

application/vnd.github.raw+json: Returns the raw contents of the license.
application/vnd.github.html+json: Returns the license contents in HTML. Markup languages are rendered to HTML using GitHub's open-source Markup library.

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

* **`ref`** (string)
  The Git reference for the results you want to list. The ref for a branch can be formatted either as refs/heads/<branch name> or simply <branch name>. To reference a pull request use refs/pull/<number>/merge.

### HTTP response status codes

* **200** - OK

* **404** - Resource not found

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/license
```

**Response schema (Status: 200):**

* `name`: required, string
* `path`: required, string
* `sha`: required, string
* `size`: required, integer
* `url`: required, string, format: uri
* `html_url`: required, string or null, format: uri
* `git_url`: required, string or null, format: uri
* `download_url`: required, string or null, format: uri
* `type`: required, string
* `content`: required, string
* `encoding`: required, string
* `_links`: required, object:
  * `git`: required, string or null, format: uri
  * `html`: required, string or null, format: uri
  * `self`: required, string, format: uri
* `license`: required, any of:
  * **null**
  * **License Simple**
    * `key`: required, string
    * `name`: required, string
    * `url`: required, string or null, format: uri
    * `spdx_id`: required, string or null
    * `node_id`: required, string
    * `html_url`: string, format: uri