Skip to main content
GET
/
gh
/
{ownerKeyOrId}
/
projects
/
{projectKeyOrId}
/
coverage
/
file
Get file coverage
curl --request GET \
  --url https://api.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/coverage/file \
  --header 'Authorization: Bearer <token>'
{
  "tags": [
    "unit",
    "integration"
  ],
  "files": [
    {
      "path": "src/index.ts",
      "hits": [
        1,
        0,
        1,
        1,
        0
      ],
      "tag": "unit",
      "coveredLines": 42,
      "missedLines": 8,
      "omitLines": 10,
      "totalLines": 60
    }
  ]
}

Authorizations

Authorization
string
header
required

Generate an API token at https://qlty.sh/user/settings/tokens

Path Parameters

ownerKeyOrId
string
required

Repository owner name (login) or workspace ID

Minimum string length: 3
Example:

"acme-corp"

projectKeyOrId
string
required

Repository name or project ID

Minimum string length: 3
Example:

"my-repo"

Query Parameters

reference
string
required

Git reference (refs/heads/branch, refs/tags/tag) or commit SHA

Minimum string length: 1
Example:

"refs/heads/main"

path
string
required

File path to get coverage for

Minimum string length: 1
Example:

"src/index.ts"

Response

Retrieve file coverage for the specified path

tags
string[]
required

Available coverage tags

Example:
["unit", "integration"]
files
object[]
required