Metrics

Get component metrics

Changed on

Retrieve the latest value of every metric for a specific Component on the Project's default branch, covering maintainability, reliability, security, size, coverage, and quality indicators. meta says when the analysis and the coverage upload behind those values happened.

get/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/components/{componentIdOrName}/metrics

Request

  • Base URL
    https://api.qlty.sh
  • Auth
    HTTP bearer

Path parameters

ownerKeyOrIdstring required

Repository owner name (login) or workspace ID

Example:acme-corp
projectKeyOrIdstring required

Repository name or project ID

Example:my-repo
componentIdOrNamestring required

Component ID or name

Example:backend-api

Response

Retrieve metrics for a component

Example response

{
  "data": [
    {
      "key": "CMPLX",
      "name": "Cognitive Complexity",
      "description": "Measures how hard the code is to understand",
      "category": "maintainability",
      "inverted": true,
      "valueType": "number"
    }
  ],
  "meta": {
    "analyzedAt": "2026-01-09T12:00:00Z",
    "coverageUploadedAt": "2026-01-09T12:04:31Z"
  }
}

Changes