351.md 1.2 KB
Newer Older
Lab机器人's avatar
readme  
Lab机器人 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
# Project statistics API

> 原文:[https://docs.gitlab.com/ee/api/project_statistics.html](https://docs.gitlab.com/ee/api/project_statistics.html)

*   [Get the statistics of the last 30 days](#get-the-statistics-of-the-last-30-days)

# Project statistics API[](#project-statistics-api "Permalink")

每个对[项目](../user/project/index.html)统计信息的 API 调用都必须经过验证.

## Get the statistics of the last 30 days[](#get-the-statistics-of-the-last-30-days "Permalink")

检索统计信息需要对存储库的写权限. 当前仅返回 HTTP 提取统计信息. 提取统计信息包括克隆和提取计数,并且仅用于 HTTP,不包括 SSH 提取.

```
GET /projects/:id/statistics 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | 整数/字符串 | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |

响应示例:

```
{  "fetches":  {  "total":  50,  "days":  [  {  "count":  10,  "date":  "2018-01-10"  },  {  "count":  10,  "date":  "2018-01-09"  },  {  "count":  10,  "date":  "2018-01-08"  },  {  "count":  10,  "date":  "2018-01-07"  },  {  "count":  10,  "date":  "2018-01-06"  }  ]  }  } 
```