Skip to main content
Мы публикуем частые обновления нашей документации, и перевод этой страницы может все еще выполняться. Актуальные сведения см. в документации на английском языке.
REST API теперь имеет версию. Дополнительные сведения см. в разделе Сведения об управлении версиями API.

Метрики Community

Используйте REST API для получения сведений о профиле сообщества.

Get community profile metrics

Работа с GitHub Apps

Returns all community profile metrics for a repository. The repository cannot be a fork.

The returned metrics include an overall health score, the repository description, the presence of documentation, the detected code of conduct, the detected license, and the presence of ISSUE_TEMPLATE, PULL_REQUEST_TEMPLATE, README, and CONTRIBUTING files.

The health_percentage score is defined as a percentage of how many of these four documents are present: README, CONTRIBUTING, LICENSE, and CODE_OF_CONDUCT. For example, if all four documents are present, then the health_percentage is 100. If only one is present, then the health_percentage is 25.

content_reports_enabled is only returned for organization-owned repositories.

Параметры для "Get community profile metrics"

Имя, Тип, Описание
accept string

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

Параметры пути
Имя, Тип, Описание
owner string Обязательно

The account owner of the repository. The name is not case sensitive.

repo string Обязательно

The name of the repository. The name is not case sensitive.

Коды состояния HTTP-ответа для "Get community profile metrics"

Код состоянияОписание


Примеры кода для "Get community profile metrics"

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


Status: 200
{ "health_percentage": 100, "description": "My first repository on GitHub!", "documentation": null, "files": { "code_of_conduct": { "name": "Contributor Covenant", "key": "contributor_covenant", "url": "", "html_url": "" }, "code_of_conduct_file": { "url": "", "html_url": "" }, "contributing": { "url": "", "html_url": "" }, "issue_template": { "url": "", "html_url": "" }, "pull_request_template": { "url": "", "html_url": "" }, "license": { "name": "MIT License", "key": "mit", "spdx_id": "MIT", "url": "", "html_url": "", "node_id": "MDc6TGljZW5zZW1pdA==" }, "readme": { "url": "", "html_url": "" } }, "updated_at": "2017-02-28T19:09:29Z", "content_reports_enabled": true }