> ## 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/

يعيد إجماليات عدد الطلبات لبيئة مفتاح معينة ضمن نافذة زمنية متحركة. مثل بقية نقاط نهاية `console/`، تقع هذه على مضيف Scanova API **العادي** (‏`qcg-api.scanova.io`)، مصادَقًا عليها برمز وصول OAuth الخاص بلوحة التحكم.

<Note>
  الأرقام مُجمَّعة **عبر كل مفتاح يشارك `environment` المحددة** في حسابك، وليس لمفتاح واحد. إذا أردت الإجمالي مدى الحياة لمفتاح واحد، فهذا هو حقل `usage_count` الذي تعيده [`GET /console/token/`](/ar/api-reference/management-api/tokens/create#listing-existing-tokens).
</Note>

## الطلب

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

<ParamField query="environment" type="string" required>
  واحد من `sandbox`، `live`، `zapier`، `mcp`. يحدد سجلات أي المفاتيح تُجمَّع.
</ParamField>

<ParamField query="period" type="string" default="week">
  واحد من `day`، `week`، `month`، `year`. النافذة الزمنية المتحركة المنتهية الآن التي تُحصى الطلبات ضمنها.
</ParamField>

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

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "total_requests": 4820,
    "successful_requests": 4761,
    "failed_requests": 59
  }
  ```
</ResponseExample>

### حقول الاستجابة

<ResponseField name="total_requests" type="integer">
  إجمالي الطلبات المسجَّلة للمفاتيح في هذه البيئة ضمن النافذة الزمنية.
</ResponseField>

<ResponseField name="successful_requests" type="integer">
  الطلبات التي أعادت رمز حالة أقل من `400`.
</ResponseField>

<ResponseField name="failed_requests" type="integer">
  الطلبات التي أعادت رمز حالة `400` أو أعلى.
</ResponseField>

## الأخطاء

`environment` مطلوبة — حذفها، أو تمرير قيمة خارج القيم الأربع المذكورة أعلاه، يعيد:

```json 400 Bad Request theme={null}
{ "environment": ["A valid environment is required."] }
```

قيمة `period` غير صالحة تعيد:

```json 400 Bad Request theme={null}
{ "period": ["period must be one of day, week, month, year."] }
```

<Note>
  لا توجد حاليًا أي حدود معدل (rate limits) مفروضة على Management API — نقاط نهاية الاستخدام هذه موجودة لأغراض الرؤية فقط، لا لفرض حصة. راجع [الاستخدام اليومي](/ar/api-reference/management-api/tokens/usage-daily) للاطلاع على اتجاه يومي و[الاستخدام حسب نقطة النهاية](/ar/api-reference/management-api/tokens/usage-by-endpoint) للاطلاع على تفصيل حسب المسار.
</Note>

## ذات صلة

* [الاستخدام اليومي](/ar/api-reference/management-api/tokens/usage-daily) — نفس الأرقام، مُفصَّلة حسب اليوم التقويمي.
* [الاستخدام حسب نقطة النهاية](/ar/api-reference/management-api/tokens/usage-by-endpoint) — نفس الأرقام، مُفصَّلة حسب المسار والطريقة.
* [إنشاء رمز API](/ar/api-reference/management-api/tokens/create) — من أين يأتي حقل `usage_count` مدى الحياة لكل مفتاح (يختلف عن هذه الإجماليات على مستوى البيئة).


## OpenAPI

````yaml api-reference/openapi/management-api.json GET /console/usage/
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/:
    get:
      summary: Usage statistics
      operationId: getUsageStats
      parameters:
        - name: environment
          in: query
          required: true
          schema:
            type: string
        - name: period
          in: query
          schema:
            type: string
            enum:
              - day
              - week
              - month
              - year
      responses:
        '200':
          description: Usage stats
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.

````