Skip to main content
이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

GitHub Marketplace에 대한 REST API 엔드포인트

REST API를 사용하여 GitHub Marketplace과(와) 상호 작용합니다

GitHub Marketplace

정보

GitHub Marketplace에 대한 자세한 정보는 "GitHub Marketplace"을(를) 참조하세요.

이러한 엔드포인트를 사용하면 가격 플랜을 사용하는 고객을 확인하고 고객의 구매 항목을 확인하며 계정에 활성 구독이 있는지 확인할 수 있습니다.

스텁 엔드포인트를 사용하여 테스트

스텁 데이터GitHub App를 테스트할 수 있습니다. 스텁 데이터는 실제 구독에 따라 변경되지 않는 하드 코딩된 가짜 데이터입니다.

스텁 데이터로 테스트하려면 프로덕션용 엔드포인트 대신 스텁 엔드포인트를 사용합니다. 이렇게 하면 GitHub Marketplace에 GitHub Apps를 나열하기 전에 API 논리가 성공하는지 테스트할 수 있습니다.

GitHub App를 배포하기 전에 스텁 엔드포인트를 프로덕션 엔드포인트로 교체해야 합니다.

Get a subscription plan for an account

Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a JWT to access this endpoint. OAuth apps must use basic authentication with their client ID and client secret to access this endpoint.

"Get a subscription plan for an account"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"Get a subscription plan for an account"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
account_id integer Required

account_id parameter

"Get a subscription plan for an account"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

401

Requires authentication

404

Not Found when the account has not purchased the listing

"Get a subscription plan for an account"에 대한 코드 샘플

요청 예제

get/marketplace_listing/accounts/{account_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/marketplace_listing/accounts/ACCOUNT_ID

Response

Status: 200
{ "url": "https://api.github.com/orgs/github", "type": "Organization", "id": 4, "login": "github", "organization_billing_email": "billing@github.com", "email": "billing@github.com", "marketplace_pending_change": { "effective_date": "2017-11-11T00:00:00Z", "unit_count": null, "id": 77, "plan": { "url": "https://api.github.com/marketplace_listing/plans/1111", "accounts_url": "https://api.github.com/marketplace_listing/plans/1111/accounts", "id": 1111, "number": 2, "name": "Startup", "description": "A professional-grade CI solution", "monthly_price_in_cents": 699, "yearly_price_in_cents": 7870, "price_model": "FLAT_RATE", "has_free_trial": true, "state": "published", "unit_name": null, "bullets": [ "Up to 10 private repositories", "3 concurrent builds" ] } }, "marketplace_purchase": { "billing_cycle": "monthly", "next_billing_date": "2017-11-11T00:00:00Z", "unit_count": null, "on_free_trial": true, "free_trial_ends_on": "2017-11-11T00:00:00Z", "updated_at": "2017-11-02T01:12:12Z", "plan": { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } } }

List plans

Lists all plans that are part of your GitHub Marketplace listing.

GitHub Apps must use a JWT to access this endpoint. OAuth apps must use basic authentication with their client ID and client secret to access this endpoint.

"List plans"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"List plans"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

쿼리 매개 변수
속성, 형식, 설명
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

기본값: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

기본값: 1

"List plans"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

401

Requires authentication

404

Resource not found

"List plans"에 대한 코드 샘플

요청 예제

get/marketplace_listing/plans
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/marketplace_listing/plans

Response

Status: 200
[ { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } ]

List accounts for a plan

Returns user and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a JWT to access this endpoint. OAuth apps must use basic authentication with their client ID and client secret to access this endpoint.

"List accounts for a plan"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"List accounts for a plan"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
plan_id integer Required

The unique identifier of the plan.

쿼리 매개 변수
속성, 형식, 설명
sort string

The property to sort the results by.

기본값: created

다음 중 하나일 수 있습니다.: created, updated

direction string

To return the oldest accounts first, set to asc. Ignored without the sort parameter.

다음 중 하나일 수 있습니다.: asc, desc

per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

기본값: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

기본값: 1

"List accounts for a plan"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

401

Requires authentication

404

Resource not found

422

Validation failed, or the endpoint has been spammed.

"List accounts for a plan"에 대한 코드 샘플

요청 예제

get/marketplace_listing/plans/{plan_id}/accounts
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/marketplace_listing/plans/PLAN_ID/accounts

Response

Status: 200
[ { "url": "https://api.github.com/orgs/github", "type": "Organization", "id": 4, "login": "github", "organization_billing_email": "billing@github.com", "marketplace_pending_change": { "effective_date": "2017-11-11T00:00:00Z", "unit_count": null, "id": 77, "plan": { "url": "https://api.github.com/marketplace_listing/plans/1111", "accounts_url": "https://api.github.com/marketplace_listing/plans/1111/accounts", "id": 1111, "number": 2, "name": "Startup", "description": "A professional-grade CI solution", "monthly_price_in_cents": 699, "yearly_price_in_cents": 7870, "price_model": "FLAT_RATE", "has_free_trial": true, "state": "published", "unit_name": null, "bullets": [ "Up to 10 private repositories", "3 concurrent builds" ] } }, "marketplace_purchase": { "billing_cycle": "monthly", "next_billing_date": "2017-11-11T00:00:00Z", "unit_count": null, "on_free_trial": true, "free_trial_ends_on": "2017-11-11T00:00:00Z", "updated_at": "2017-11-02T01:12:12Z", "plan": { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } } } ]

Get a subscription plan for an account (stubbed)

Shows whether the user or organization account actively subscribes to a plan listed by the authenticated GitHub App. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a JWT to access this endpoint. OAuth apps must use basic authentication with their client ID and client secret to access this endpoint.

"Get a subscription plan for an account (stubbed)"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"Get a subscription plan for an account (stubbed)"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
account_id integer Required

account_id parameter

"Get a subscription plan for an account (stubbed)"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

401

Requires authentication

404

Not Found when the account has not purchased the listing

"Get a subscription plan for an account (stubbed)"에 대한 코드 샘플

요청 예제

get/marketplace_listing/stubbed/accounts/{account_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/marketplace_listing/stubbed/accounts/ACCOUNT_ID

Response

Status: 200
{ "url": "https://api.github.com/orgs/github", "type": "Organization", "id": 4, "login": "github", "organization_billing_email": "billing@github.com", "email": "billing@github.com", "marketplace_pending_change": { "effective_date": "2017-11-11T00:00:00Z", "unit_count": null, "id": 77, "plan": { "url": "https://api.github.com/marketplace_listing/plans/1111", "accounts_url": "https://api.github.com/marketplace_listing/plans/1111/accounts", "id": 1111, "number": 2, "name": "Startup", "description": "A professional-grade CI solution", "monthly_price_in_cents": 699, "yearly_price_in_cents": 7870, "price_model": "FLAT_RATE", "has_free_trial": true, "state": "published", "unit_name": null, "bullets": [ "Up to 10 private repositories", "3 concurrent builds" ] } }, "marketplace_purchase": { "billing_cycle": "monthly", "next_billing_date": "2017-11-11T00:00:00Z", "unit_count": null, "on_free_trial": true, "free_trial_ends_on": "2017-11-11T00:00:00Z", "updated_at": "2017-11-02T01:12:12Z", "plan": { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } } }

List plans (stubbed)

Lists all plans that are part of your GitHub Marketplace listing.

GitHub Apps must use a JWT to access this endpoint. OAuth apps must use basic authentication with their client ID and client secret to access this endpoint.

"List plans (stubbed)"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"List plans (stubbed)"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

쿼리 매개 변수
속성, 형식, 설명
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

기본값: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

기본값: 1

"List plans (stubbed)"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

401

Requires authentication

"List plans (stubbed)"에 대한 코드 샘플

요청 예제

get/marketplace_listing/stubbed/plans
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/marketplace_listing/stubbed/plans

Response

Status: 200
[ { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } ]

List accounts for a plan (stubbed)

Returns repository and organization accounts associated with the specified plan, including free plans. For per-seat pricing, you see the list of accounts that have purchased the plan, including the number of seats purchased. When someone submits a plan change that won't be processed until the end of their billing cycle, you will also see the upcoming pending change.

GitHub Apps must use a JWT to access this endpoint. OAuth apps must use basic authentication with their client ID and client secret to access this endpoint.

"List accounts for a plan (stubbed)"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"List accounts for a plan (stubbed)"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
plan_id integer Required

The unique identifier of the plan.

쿼리 매개 변수
속성, 형식, 설명
sort string

The property to sort the results by.

기본값: created

다음 중 하나일 수 있습니다.: created, updated

direction string

To return the oldest accounts first, set to asc. Ignored without the sort parameter.

다음 중 하나일 수 있습니다.: asc, desc

per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

기본값: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

기본값: 1

"List accounts for a plan (stubbed)"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

401

Requires authentication

"List accounts for a plan (stubbed)"에 대한 코드 샘플

요청 예제

get/marketplace_listing/stubbed/plans/{plan_id}/accounts
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/marketplace_listing/stubbed/plans/PLAN_ID/accounts

Response

Status: 200
[ { "url": "https://api.github.com/orgs/github", "type": "Organization", "id": 4, "login": "github", "organization_billing_email": "billing@github.com", "marketplace_pending_change": { "effective_date": "2017-11-11T00:00:00Z", "unit_count": null, "id": 77, "plan": { "url": "https://api.github.com/marketplace_listing/plans/1111", "accounts_url": "https://api.github.com/marketplace_listing/plans/1111/accounts", "id": 1111, "number": 2, "name": "Startup", "description": "A professional-grade CI solution", "monthly_price_in_cents": 699, "yearly_price_in_cents": 7870, "price_model": "FLAT_RATE", "has_free_trial": true, "state": "published", "unit_name": null, "bullets": [ "Up to 10 private repositories", "3 concurrent builds" ] } }, "marketplace_purchase": { "billing_cycle": "monthly", "next_billing_date": "2017-11-11T00:00:00Z", "unit_count": null, "on_free_trial": true, "free_trial_ends_on": "2017-11-11T00:00:00Z", "updated_at": "2017-11-02T01:12:12Z", "plan": { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } } } ]

List subscriptions for the authenticated user

Lists the active subscriptions for the authenticated user.

"List subscriptions for the authenticated user"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 어떤 권한도 필요하지 않습니다.

"List subscriptions for the authenticated user"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

쿼리 매개 변수
속성, 형식, 설명
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

기본값: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

기본값: 1

"List subscriptions for the authenticated user"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

304

Not modified

401

Requires authentication

404

Resource not found

"List subscriptions for the authenticated user"에 대한 코드 샘플

요청 예제

get/user/marketplace_purchases
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/user/marketplace_purchases

Response

Status: 200
[ { "billing_cycle": "monthly", "next_billing_date": "2017-11-11T00:00:00Z", "unit_count": null, "on_free_trial": true, "free_trial_ends_on": "2017-11-11T00:00:00Z", "updated_at": "2017-11-02T01:12:12Z", "account": { "login": "github", "id": 4, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "email": null, "organization_billing_email": "billing@github.com", "type": "Organization" }, "plan": { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } } ]

List subscriptions for the authenticated user (stubbed)

Lists the active subscriptions for the authenticated user.

"List subscriptions for the authenticated user (stubbed)"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 어떤 권한도 필요하지 않습니다.

"List subscriptions for the authenticated user (stubbed)"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

쿼리 매개 변수
속성, 형식, 설명
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

기본값: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

기본값: 1

"List subscriptions for the authenticated user (stubbed)"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

304

Not modified

401

Requires authentication

"List subscriptions for the authenticated user (stubbed)"에 대한 코드 샘플

요청 예제

get/user/marketplace_purchases/stubbed
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/user/marketplace_purchases/stubbed

Response

Status: 200
[ { "billing_cycle": "monthly", "next_billing_date": "2017-11-11T00:00:00Z", "unit_count": null, "on_free_trial": true, "free_trial_ends_on": "2017-11-11T00:00:00Z", "updated_at": "2017-11-02T01:12:12Z", "account": { "login": "github", "id": 4, "node_id": "MDEyOk9yZ2FuaXphdGlvbjE=", "url": "https://api.github.com/orgs/github", "email": null, "organization_billing_email": "billing@github.com", "type": "Organization" }, "plan": { "url": "https://api.github.com/marketplace_listing/plans/1313", "accounts_url": "https://api.github.com/marketplace_listing/plans/1313/accounts", "id": 1313, "number": 3, "name": "Pro", "description": "A professional-grade CI solution", "monthly_price_in_cents": 1099, "yearly_price_in_cents": 11870, "price_model": "FLAT_RATE", "has_free_trial": true, "unit_name": null, "state": "published", "bullets": [ "Up to 25 private repositories", "11 concurrent builds" ] } } ]