---
title: "git.insights@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/git.insights"
updated: null
---

# git.insights@1 · OpenVibe.Services

HTML: [git.insights@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/git.insights)

# GitInsights `git.insights@1`

Generated at 2026-11-13 06:25:48 UTC from [`openvibe-contracts v0.419.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.419.0) and [`openvibe-sdk v0.161.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.161.0).

- Version: 1.0.0
- Owner: git
- Visibility: public
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/git/insights.v1.json`](/docs/contracts/git.insights.json)

A repository's insights over a window: views, unique visitors, clones and stars per day, and commits per week. Public for a public repository, like GitHub's traffic but open. api/view/insights.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `repo` | string | yes |  | - `pattern ^[a-z0-9-]+/[a-z0-9][a-z0-9._-]{0,99}$` |
| `window_days` | integer | yes |  | - `minimum 1`<br>- `maximum 90` |
| `views` | integer | yes | Page views of the repository in the window. | - `minimum 0` |
| `unique_visitors` | integer | yes | Distinct visitors per day, summed over the window. | - `minimum 0` |
| `clones` | integer | yes | Successful git clones and fetches served in the window. | - `minimum 0` |
| `stars` | object | yes |  | - `no other fields` |
| `stars.total` | integer | yes |  | - `minimum 0` |
| `stars.in_window` | integer | yes |  | - `minimum 0` |
| `commits_per_week` | array of object | yes | The default branch's commits for each ISO week, oldest first. | - `items: no other fields` |
| `commits_per_week[].week` | string | yes | The week's Monday, YYYY-MM-DD. | - `format date` |
| `commits_per_week[].commits` | integer | yes |  | - `minimum 0` |
| `daily` | array of object | yes | One row per day of the window, oldest first. | - `items: no other fields` |
| `daily[].day` | string | yes |  | - `format date` |
| `daily[].views` | integer | yes |  | - `minimum 0` |
| `daily[].unique_visitors` | integer | yes |  | - `minimum 0` |
| `daily[].clones` | integer | yes |  | - `minimum 0` |
| `daily[].stars` | integer | yes |  | - `minimum 0` |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: full

~~~~
{
  "repo": "openvibers/openvibe.codes",
  "window_days": 30,
  "views": 2841,
  "unique_visitors": 412,
  "clones": 190,
  "stars": {
    "total": 12,
    "in_window": 3
  },
  "commits_per_week": [
    {
      "week": "2026-10-19",
      "commits": 18
    },
    {
      "week": "2026-10-26",
      "commits": 27
    },
    {
      "week": "2026-11-02",
      "commits": 31
    }
  ],
  "daily": [
    {
      "day": "2026-11-08",
      "views": 121,
      "unique_visitors": 18,
      "clones": 9,
      "stars": 1
    },
    {
      "day": "2026-11-09",
      "views": 96,
      "unique_visitors": 14,
      "clones": 7,
      "stars": 0
    }
  ]
}
~~~~

Rejected: window-and-negative

~~~~
{
  "repo": "openvibers/openvibe.codes",
  "window_days": 400,
  "views": -1,
  "unique_visitors": 0,
  "clones": 0,
  "stars": {
    "total": 0,
    "in_window": 0
  },
  "commits_per_week": [],
  "daily": [
    {
      "day": "2026-11-09",
      "views": 0,
      "unique_visitors": 0,
      "clones": 0,
      "stars": 0,
      "bots": 1
    }
  ]
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('git.insights@1', value);   // { valid, errors: [{ path, message }] }
~~~~
