---
title: "Commit coverage totals"
method: GET
path: "/{service}/{owner_username}/repos/{repo_name}/totals/"
tags: ["Coverage"]
---

# Commit coverage totals

`GET /{service}/{owner_username}/repos/{repo_name}/totals/`

Returns the coverage totals for a given commit and the
coverage totals broken down by file.

By default that commit is the head of the default branch but can also be specified explictily by:
* `sha` - return totals for the commit with the given SHA
* `branch` - return totals for the head commit of the branch with the given name

The totals can be optionally filtered by specifying:
* `path` - only show totals for pathnames that start with this value
* `flag` - only show totals that applies to the specified flag name
* `component_id` - only show totals that applies to the specified component

## Path parameters

- `owner_username` string, required
- `repo_name` string, required
- `service` 'bitbucket' | 'bitbucket_server' | 'github' | 'github_enterprise' | 'gitlab' | 'gitlab_enterprise', required

## Query parameters

- `branch` string
- `component_id` string
- `flag` string
- `path` string
- `sha` string

## Response `200`

- CoverageReport
  - `totals` ReportTotals, required
    - `files` integer, required
    - `lines` integer, required
    - `hits` integer, required
    - `misses` integer, required
    - `partials` integer, required
    - `coverage` number, double, required
    - `branches` integer, required
    - `methods` integer, required
    - `messages` integer, required
    - `sessions` integer, required
    - `complexity` number, double, required
    - `complexity_total` number, double, required
    - `complexity_ratio` number, double, required
    - `diff` unknown, required
  - `files` ReportFile, required
    - `name` string, required
    - `totals` ReportTotals, required
      - `files` integer, required
      - `lines` integer, required
      - `hits` integer, required
      - `misses` integer, required
      - `partials` integer, required
      - `coverage` number, double, required
      - `branches` integer, required
      - `methods` integer, required
      - `messages` integer, required
      - `sessions` integer, required
      - `complexity` number, double, required
      - `complexity_total` number, double, required
      - `complexity_ratio` number, double, required
      - `diff` unknown, required
    - `line_coverage` unknown[], required
      - unknown
  - `commit_file_url` string, required

---

[API](https://skmtc.net/codecov/apis/codecov-api.md) · [All operations](https://skmtc.net/codecov/apis/codecov-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/codecov/codecov-api/versions/aedc46e83ec6/schema)
