> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scanova.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 每日用量

> GET /console/usage/daily/

针对给定的密钥 environment，返回按天拆分的请求次数明细——便于渲染用量趋势图。位于**常规**的 Scanova API 主机（`qcg-api.scanova.io`）上，使用您的仪表盘 OAuth 访问令牌进行身份验证。

## 请求

```
GET https://qcg-api.scanova.io/console/usage/daily/
Authorization: Bearer <your_oauth_access_token>
```

<ParamField query="environment" type="string" required>
  `sandbox`、`live`、`zapier`、`mcp` 之一。选择要聚合哪些密钥的日志。
</ParamField>

<ParamField query="days" type="integer" default="30">
  要包含的过去天数，限定在 `1`–`365` 范围内。
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -G "https://qcg-api.scanova.io/console/usage/daily/" \
    -H "Authorization: Bearer <your_oauth_access_token>" \
    -d environment=live \
    -d days=7
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  [
    { "date": "2026-08-10", "count": 812, "success_count": 799, "error_count": 13 },
    { "date": "2026-08-11", "count": 640, "success_count": 640, "error_count": 0 },
    { "date": "2026-08-12", "count": 0,   "success_count": 0,   "error_count": 0 },
    { "date": "2026-08-13", "count": 705, "success_count": 690, "error_count": 15 },
    { "date": "2026-08-14", "count": 918, "success_count": 918, "error_count": 0 },
    { "date": "2026-08-15", "count": 733, "success_count": 733, "error_count": 0 },
    { "date": "2026-08-16", "count": 214, "success_count": 214, "error_count": 0 }
  ]
  ```
</ResponseExample>

### 响应字段

响应是一个恰好包含 `days` 个条目的数组，每个日历日一个条目，最早的日期排在最前。

<ResponseField name="date" type="string">
  ISO 8601 日期（`YYYY-MM-DD`）。
</ResponseField>

<ResponseField name="count" type="integer">
  当天记录的请求总数。
</ResponseField>

<ResponseField name="success_count" type="integer">
  返回状态码低于 `400` 的请求数。
</ResponseField>

<ResponseField name="error_count" type="integer">
  返回状态码为 `400` 或以上的请求数。
</ResponseField>

<Note>
  没有流量的日期会被填充为零，而不是被省略，因此数组长度始终恰好等于 `days`，可以直接用于绘图，无需在客户端补齐缺口。
</Note>

## 错误

`environment` 为必填项，校验规则与[用量统计](/zh/api-reference/management-api/tokens/usage-stats#errors)相同。非整数的 `days` 会返回：

```json 400 Bad Request theme={null}
{ "days": ["days must be an integer."] }
```

## 相关内容

* [用量统计](/zh/api-reference/management-api/tokens/usage-stats) —— 同样的请求总数，以单一的滚动时间窗口数字呈现，而不是按天的序列。
* [按端点统计用量](/zh/api-reference/management-api/tokens/usage-by-endpoint) —— 同样的流量数据，按路由和方法拆分，而不是按天。
* [Management API 概览](/zh/api-reference/management-api/overview) —— 本端点据以聚合的 `environment` 取值（`sandbox`、`live`、`zapier`、`mcp`）。


## OpenAPI

````yaml api-reference/openapi/management-api.json GET /console/usage/daily/
openapi: 3.1.0
info:
  title: Scanova Management API (v2)
  description: >-
    The complete Scanova Management API — every endpoint available at
    management.scanova.io (QR codes, folders, tags, leads, forms, analytics,
    plans, shared users & roles), plus the token-creation and usage-stats
    endpoints used to authenticate against it. Every path and request/response
    shape below was verified live against a real API key and the actual running
    backend (Phase 7, 2026-08-16) — not guessed from reading urls.py alone.
  version: 2.0.0
servers:
  - url: https://management.scanova.io
    description: Management API — QR/folder/tag/lead/form/analytics/plans endpoints
security:
  - apiKeyAuth: []
paths:
  /console/usage/daily/:
    get:
      summary: Daily usage
      operationId: getDailyUsage
      parameters:
        - name: environment
          in: query
          required: true
          schema:
            type: string
        - name: days
          in: query
          schema:
            type: integer
      responses:
        '200':
          description: Per-day usage
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Send your Management API key as the raw value of the Authorization
        header — no "Bearer " or "Token " prefix, and no other characters.
        Example: `Authorization: 401f7ac837da42b97f613d789819ff93537bee6a`. A
        header containing more than one space-separated part is rejected
        outright. Requests also require the request's Host header to be the
        management API host (e.g. management.scanova.io) — the same key sent to
        the regular API host will not authenticate.

````