Codecov Coverage API

The Coverage API from Codecov — 5 operation(s) for coverage.

Operations 5

GET /{service}/{owner_username}/repos/{repo_name}/coverage/ Coverage trend #
GET /{service}/{owner_username}/repos/{repo_name}/file_report/{path}/ File coverage report #
GET /{service}/{owner_username}/repos/{repo_name}/report/ Commit coverage report #
GET /{service}/{owner_username}/repos/{repo_name}/report/tree Coverage report tree #
GET /{service}/{owner_username}/repos/{repo_name}/totals/ Commit coverage totals #

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/codecov:codecov-coverage-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

codecov-coverage-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Codecov Coverage API
  version: 2.0.0
  description: Public Codecov API
servers:
- url: https://api.codecov.io/api/v2/
tags:
- name: Coverage
paths:
  /{service}/{owner_username}/repos/{repo_name}/coverage/:
    get:
      operationId: repos_coverage_list
      description: 'Returns a paginated list of timeseries measurements aggregated by the specified

        `interval`. If there are no measurements on `start_date` then the response will include

        1 measurement older than `start_date` so that the coverage value can be carried forward

        if necessary.


        Optionally filterable by:

        * `branch`

        * `start_date`

        * `end_date`'
      summary: Coverage trend
      parameters:
      - in: query
        name: branch
        schema:
          type: string
        description: branch name
      - in: query
        name: end_date
        schema:
          type: string
          format: date-time
        description: end datetime (inclusive)
      - in: query
        name: interval
        schema:
          type: string
          enum:
          - 1d
          - 30d
          - 7d
        description: '* `1d` - 1 day

          * `7d` - 7 day

          * `30d` - 30 day'
        required: true
      - in: path
        name: owner_username
        schema:
          type: string
        description: username from service provider
        required: true
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - in: path
        name: repo_name
        schema:
          type: string
        description: repository name
        required: true
      - in: path
        name: service
        schema:
          type: string
          enum:
          - bitbucket
          - bitbucket_server
          - github
          - github_enterprise
          - gitlab
          - gitlab_enterprise
        description: Git hosting service provider
        required: true
      - in: query
        name: start_date
        schema:
          type: string
          format: date-time
        description: start datetime (inclusive)
      tags:
      - Coverage
      security:
      - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMeasurementList'
          description: ''
  /{service}/{owner_username}/repos/{repo_name}/file_report/{path}/:
    get:
      operationId: repos_file_report_retrieve
      description: 'Similar to the coverage report endpoint but only returns coverage info for a single

        file specified by `path`.


        By default that commit is the head of the default branch but can also be specified explictily by:

        * `sha` - return report for the commit with the given SHA

        * `branch` - return report for the head commit of the branch with the given name'
      summary: File coverage report
      parameters:
      - in: query
        name: branch
        schema:
          type: string
        description: branch name for which to return report (of head commit)
      - in: path
        name: owner_username
        schema:
          type: string
        description: username from service provider
        required: true
      - in: path
        name: path
        schema:
          type: string
        description: the file path for which to retrieve coverage info
        required: true
      - in: path
        name: repo_name
        schema:
          type: string
        description: repository name
        required: true
      - in: path
        name: service
        schema:
          type: string
          enum:
          - bitbucket
          - bitbucket_server
          - github
          - github_enterprise
          - gitlab
          - gitlab_enterprise
        description: Git hosting service provider
        required: true
      - in: query
        name: sha
        schema:
          type: string
        description: commit SHA for which to return report
      tags:
      - Coverage
      security:
      - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileReport'
          description: ''
  /{service}/{owner_username}/repos/{repo_name}/report/:
    get:
      operationId: repos_report_retrieve
      description: 'Similar to the coverage totals endpoint but also returns line-by-line

        coverage info (hit=0/miss=1/partial=2).


        By default that commit is the head of the default branch but can also be specified explictily by:

        * `sha` - return report for the commit with the given SHA

        * `branch` - return report for the head commit of the branch with the given name


        The report can be optionally filtered by specifying:

        * `path` - only show report info for pathnames that start with this value

        * `flag` - only show report info that applies to the specified flag name

        * `component_id` - only show report info that applies to the specified component'
      summary: Commit coverage report
      parameters:
      - in: query
        name: branch
        schema:
          type: string
        description: branch name for which to return report (of head commit)
      - in: query
        name: component_id
        schema:
          type: string
        description: filter report to only include info pertaining to given component id
      - in: query
        name: flag
        schema:
          type: string
        description: filter report to only include info pertaining to given flag name
      - in: path
        name: owner_username
        schema:
          type: string
        description: username from service provider
        required: true
      - in: query
        name: path
        schema:
          type: string
        description: filter report to only include file paths starting with this value
      - in: path
        name: repo_name
        schema:
          type: string
        description: repository name
        required: true
      - in: path
        name: service
        schema:
          type: string
          enum:
          - bitbucket
          - bitbucket_server
          - github
          - github_enterprise
          - gitlab
          - gitlab_enterprise
        description: Git hosting service provider
        required: true
      - in: query
        name: sha
        schema:
          type: string
        description: commit SHA for which to return report
      tags:
      - Coverage
      security:
      - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoverageReport'
          description: ''
  /{service}/{owner_username}/repos/{repo_name}/report/tree:
    get:
      operationId: repos_report_tree_retrieve
      description: 'Returns a hierarchical view of the report that matches the file structure of the covered files

        with coverage info rollups at each level.


        Returns only top-level data by default but the depth of the traversal can be controlled via

        the `depth` parameter.


        * `depth` - how deep in the tree to traverse (default=1)

        * `path` - path in the tree from which to start the traversal (default is the root)'
      summary: Coverage report tree
      parameters:
      - in: query
        name: branch
        schema:
          type: string
        description: branch name for which to return report (of head commit)
      - in: query
        name: component_id
        schema:
          type: string
        description: filter report to only include info pertaining to given component id
      - in: query
        name: depth
        schema:
          type: string
        description: depth of the traversal (default=1)
      - in: query
        name: flag
        schema:
          type: string
        description: filter report to only include info pertaining to given flag name
      - in: path
        name: owner_username
        schema:
          type: string
        description: username from service provider
        required: true
      - in: query
        name: path
        schema:
          type: string
        description: starting path of the traversal (default is root path)
      - in: path
        name: repo_name
        schema:
          type: string
        description: repository name
        required: true
      - in: path
        name: service
        schema:
          type: string
          enum:
          - bitbucket
          - bitbucket_server
          - github
          - github_enterprise
          - gitlab
          - gitlab_enterprise
        description: Git hosting service provider
        required: true
      - in: query
        name: sha
        schema:
          type: string
        description: commit SHA for which to return report
      tags:
      - Coverage
      security:
      - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tree'
          description: ''
  /{service}/{owner_username}/repos/{repo_name}/totals/:
    get:
      operationId: repos_totals_retrieve
      description: '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'
      summary: Commit coverage totals
      parameters:
      - in: query
        name: branch
        schema:
          type: string
        description: branch name for which to return report (of head commit)
      - in: query
        name: component_id
        schema:
          type: string
        description: filter report to only include info pertaining to given component id
      - in: query
        name: flag
        schema:
          type: string
        description: filter report to only include info pertaining to given flag name
      - in: path
        name: owner_username
        schema:
          type: string
        description: username from service provider
        required: true
      - in: query
        name: path
        schema:
          type: string
        description: filter report to only include file paths starting with this value
      - in: path
        name: repo_name
        schema:
          type: string
        description: repository name
        required: true
      - in: path
        name: service
        schema:
          type: string
          enum:
          - bitbucket
          - bitbucket_server
          - github
          - github_enterprise
          - gitlab
          - gitlab_enterprise
        description: Git hosting service provider
        required: true
      - in: query
        name: sha
        schema:
          type: string
        description: commit SHA for which to return report
      tags:
      - Coverage
      security:
      - tokenAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoverageReport'
          description: ''
components:
  schemas:
    FileReport:
      type: object
      properties:
        name:
          type: string
          title: file path
        totals:
          allOf:
          - $ref: '#/components/schemas/ReportTotals'
          title: coverage totals
        line_coverage:
          type: array
          items: {}
          readOnly: true
          title: line-by-line coverage values
        commit_sha:
          type: string
          readOnly: true
          title: commit SHA of the commit for which coverage info was found
        commit_file_url:
          type: string
          readOnly: true
          title: Codecov URL to see file coverage on commit.
      required:
      - commit_file_url
      - commit_sha
      - line_coverage
      - name
      - totals
    Tree:
      type: object
      properties:
        name:
          type: string
        full_path:
          type: string
        coverage:
          type: number
          format: double
        lines:
          type: integer
        hits:
          type: integer
        partials:
          type: integer
        misses:
          type: integer
      required:
      - coverage
      - full_path
      - hits
      - lines
      - misses
      - name
      - partials
    ReportTotals:
      type: object
      properties:
        files:
          type: integer
        lines:
          type: integer
        hits:
          type: integer
        misses:
          type: integer
        partials:
          type: integer
        coverage:
          type: number
          format: double
          readOnly: true
        branches:
          type: integer
        methods:
          type: integer
        messages:
          type: integer
        sessions:
          type: integer
        complexity:
          type: number
          format: double
        complexity_total:
          type: number
          format: double
        complexity_ratio:
          type: number
          format: double
          readOnly: true
        diff: {}
      required:
      - branches
      - complexity
      - complexity_ratio
      - complexity_total
      - coverage
      - diff
      - files
      - hits
      - lines
      - messages
      - methods
      - misses
      - partials
      - sessions
    Measurement:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
          title: timestamp at the start of the interval
        min:
          type: number
          format: double
          title: minimum value in the interval
        max:
          type: number
          format: double
          title: maximum value in the interval
        avg:
          type: number
          format: double
          title: average value in the interval
      required:
      - avg
      - max
      - min
      - timestamp
    PaginatedMeasurementList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type:
          - string
          - 'null'
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type:
          - string
          - 'null'
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/Measurement'
    CoverageReport:
      type: object
      properties:
        totals:
          allOf:
          - $ref: '#/components/schemas/ReportTotals'
          title: coverage totals
        files:
          allOf:
          - $ref: '#/components/schemas/ReportFile'
          readOnly: true
          title: file specific coverage totals
        commit_file_url:
          type: string
          title: Codecov url to see file coverage on commit. Can be unreliable with partial path names.
      required:
      - commit_file_url
      - files
      - totals
    ReportFile:
      type: object
      properties:
        name:
          type: string
          title: file path
        totals:
          allOf:
          - $ref: '#/components/schemas/ReportTotals'
          title: coverage totals
        line_coverage:
          type: array
          items: {}
          readOnly: true
          title: line-by-line coverage values
      required:
      - line_coverage
      - name
      - totals
  securitySchemes:
    tokenAuth:
      type: http
      scheme: bearer
x-provenance:
  method: searched
  source: https://docs.codecov.com/reference
  harvested: '2026-10-26'
  tool: harvest-readme-openapi.py
  note: Assembled verbatim from the OpenAPI definition ReadMe embeds in each operation page of the provider's developer portal; paths and components merged by API title, nothing authored.
  assembled_from:
  - https://docs.codecov.com/reference/repos_branches_list.md
  - https://docs.codecov.com/reference/repos_branches_retrieve.md
  - https://docs.codecov.com/reference/repos_commits_list.md
  - https://docs.codecov.com/reference/repos_commits_retrieve.md
  - https://docs.codecov.com/reference/repos_commits_uploads_list.md
  - https://docs.codecov.com/reference/repos_compare_components_retrieve.md
  - https://docs.codecov.com/reference/repos_compare_file_retrieve.md
  - https://docs.codecov.com/reference/repos_compare_flags_retrieve.md
  - https://docs.codecov.com/reference/repos_compare_impacted_files_retrieve.md
  - https://docs.codecov.com/reference/repos_compare_retrieve.md
  - https://docs.codecov.com/reference/repos_compare_segments_retrieve.md
  - https://docs.codecov.com/reference/repos_components_list.md
  - https://docs.codecov.com/reference/repos_config_retrieve.md
  - https://docs.codecov.com/reference/repos_coverage_list.md
  - https://docs.codecov.com/reference/repos_evals_compare_retrieve-1.md
  - https://docs.codecov.com/reference/repos_evals_summary_retrieve-1.md
  - https://docs.codecov.com/reference/repos_file_report_retrieve.md
  - https://docs.codecov.com/reference/repos_flags_coverage_list.md
  - https://docs.codecov.com/reference/repos_flags_list.md
  - https://docs.codecov.com/reference/repos_list.md
  - https://docs.codecov.com/reference/repos_pulls_list.md
  - https://docs.codecov.com/reference/repos_pulls_retrieve.md
  - https://docs.codecov.com/reference/repos_report_retrieve.md
  - https://docs.codecov.com/reference/repos_report_tree_retrieve.md
  - https://docs.codecov.com/reference/repos_retrieve.md
  - https://docs.codecov.com/reference/repos_test_analytics_list-1.md
  - https://docs.codecov.com/reference/repos_test_results_list.md
  - https://docs.codecov.com/reference/repos_test_results_retrieve.md
  - https://docs.codecov.com/reference/repos_totals_retrieve.md
  - https://docs.codecov.com/reference/root_list.md
  - https://docs.codecov.com/reference/root_retrieve.md
  - https://docs.codecov.com/reference/user_sessions_list.md
  - https://docs.codecov.com/reference/users_list.md
  - https://docs.codecov.com/reference/users_partial_update.md
  - https://docs.codecov.com/reference/users_retrieve.md
  merge:
    pages: 35
    deduped: 98
    conflicts_kept_first: 0