# pub.chive.admin.getMetricsOverview

> Published by [chive.pub](https://lexicon.garden/identity/did:plc:7natp5xae72bddaqlkef2t4e)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getMetricsOverview)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getMetricsOverview/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getMetricsOverview/examples)

## Definitions

### `pub.chive.admin.getMetricsOverview`

**Type**: `query`

Get metrics overview with trending eprints for a given period

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `days` | `integer` | No | Number of days to aggregate |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `period` | `ref` → `#periodInfo` | No | Period information |
| `trending` | `array` | No | Trending eprints in the period |

#### Errors

- **AuthenticationRequired**
- **AdminRequired**

### `pub.chive.admin.getMetricsOverview#periodInfo`

**Type**: `object`

Time period information

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `days` | `integer` | Yes | Number of days in the period |
| `endDate` | `string` (datetime) | Yes | Period end date |
| `startDate` | `string` (datetime) | Yes | Period start date |

### `pub.chive.admin.getMetricsOverview#trendingEprint`

**Type**: `object`

A trending eprint with engagement metrics

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | Yes | Eprint AT URI |
| `title` | `string` | Yes | Eprint title |
| `views` | `integer` | Yes | Total views in period |
| `velocity` | `integer` | No | Engagement velocity in milliunits |
| `authorDid` | `string` (did) | No | Author DID |
| `downloads` | `integer` | Yes | Total downloads in period |
| `authorHandle` | `string` | No | Author handle |

## Raw Schema

```json
{
  "id": "pub.chive.admin.getMetricsOverview",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "AdminRequired"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "properties": {
            "period": {
              "ref": "#periodInfo",
              "type": "ref",
              "description": "Period information"
            },
            "trending": {
              "type": "array",
              "items": {
                "ref": "#trendingEprint",
                "type": "ref"
              },
              "description": "Trending eprints in the period"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {
          "days": {
            "type": "integer",
            "default": 7,
            "maximum": 90,
            "minimum": 1,
            "description": "Number of days to aggregate"
          }
        }
      },
      "description": "Get metrics overview with trending eprints for a given period"
    },
    "periodInfo": {
      "type": "object",
      "required": [
        "days",
        "startDate",
        "endDate"
      ],
      "properties": {
        "days": {
          "type": "integer",
          "description": "Number of days in the period"
        },
        "endDate": {
          "type": "string",
          "format": "datetime",
          "description": "Period end date"
        },
        "startDate": {
          "type": "string",
          "format": "datetime",
          "description": "Period start date"
        }
      },
      "description": "Time period information"
    },
    "trendingEprint": {
      "type": "object",
      "required": [
        "uri",
        "title",
        "views",
        "downloads"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "format": "at-uri",
          "description": "Eprint AT URI"
        },
        "title": {
          "type": "string",
          "description": "Eprint title"
        },
        "views": {
          "type": "integer",
          "description": "Total views in period"
        },
        "velocity": {
          "type": "integer",
          "description": "Engagement velocity in milliunits"
        },
        "authorDid": {
          "type": "string",
          "format": "did",
          "description": "Author DID"
        },
        "downloads": {
          "type": "integer",
          "description": "Total downloads in period"
        },
        "authorHandle": {
          "type": "string",
          "description": "Author handle"
        }
      },
      "description": "A trending eprint with engagement metrics"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
