Metrics

Get project metric series

Retrieve each metric's history on a Project's default branch as a time series over the requested window. Returns one series per metric — covering maintainability, reliability, security, size, coverage, and quality indicators — each with the metric's descriptor and one value per interval; narrow the result with the metric and category query parameters. Available as JSON, newline-delimited JSON (application/x-ndjson), or CSV (text/csv) via the Accept header. Buckets are UTC-aligned and labeled with the inclusive end of each interval; a bucket with no measurement carries the most recent prior value forward, and the final bucket (the one containing to) may be labeled later than to — including the future for an interval still in progress — with its value reflecting only measurements within the window.

get/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/metrics/series

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

Query parameters

fromstring date-time

Window start (RFC 3339 date or date-time, inclusive). Defaults to six months before to.

Example:2026-01-01
tostring date-time

Window end (RFC 3339 date or date-time, inclusive). Defaults to the current time and is clamped to it.

Example:2026-06-01
interval'day' | 'week' | 'month'

Bucket size; buckets are UTC-aligned and weeks start Monday

MetricKey[]
OR
'CMPLX' | 'DUP' | 'MNT' | 'SEC' | 'SIZE' | 'ISS' | 'SECI' | 'SECIH' | 'SECIM' | 'SECIL' | 'TDR' | 'FILES' | 'LOC' | 'COV' | 'LCOV' | 'COVLINES' | 'MISSLINES'

Each metric key, with its name and what it measures:

  • CMPLX (Cognitive Complexity): Total cognitive complexity across all functions
  • DUP (Code Duplication): Percentage of duplicated lines
  • MNT (Maintainability Rating): Letter grade based on technical debt ratio
  • SEC (Security Rating): Overall security rating based on security vulnerabilities
  • SIZE (Project Size): Overall project size classification
  • ISS (Total Issues): Total number of code quality issues detected
  • SECI (Security Issues): Total number of security issues detected
  • SECIH (High-Severity Security Issues): Number of high-severity security issues detected
  • SECIM (Medium-Severity Security Issues): Number of medium-severity security issues detected
  • SECIL (Low-Severity Security Issues): Number of low-severity security issues detected
  • TDR (Technical Debt Ratio): Ratio of technical debt to total development cost
  • FILES (Files): Total number of files in the project
  • LOC (Lines of Code): Total number of lines of code
  • COV (Coverage Rating): Letter grade based on test coverage
  • LCOV (Line Coverage): Percentage of lines covered by tests
  • COVLINES (Covered Lines): Number of executable lines run by tests. Line Coverage is 100 × Covered Lines ÷ (Covered Lines + Missed Lines), or 100 when both are 0, reported to two decimal places. A percentage computed from these counts is more precise than Line Coverage.
  • MISSLINES (Missed Lines): Number of executable lines not run by tests. Lines the coverage report marks as not executable count as neither covered nor missed.
string[]
OR
'maintainability' | 'reliability' | 'security' | 'size' | 'coverage' | 'quality'

Response

Retrieve metric time series for the project

Example response

{
  "data": [
    {
      "metric": {
        "key": "CMPLX",
        "name": "Cognitive Complexity",
        "description": "Measures how hard the code is to understand",
        "category": "maintainability",
        "inverted": true,
        "valueType": "number"
      },
      "points": [
        {
          "timestamp": "2026-01-11T23:59:59Z"
        }
      ]
    }
  ],
  "meta": {
    "from": "2025-12-01T00:00:00Z",
    "to": "2026-06-01T00:00:00Z",
    "interval": "week"
  }
}

Changes

No recorded changes to this operation across all 8 revisions of this API.