# pub.chive.admin.getViewDownloadTimeSeries

> 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.getViewDownloadTimeSeries)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getViewDownloadTimeSeries/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7natp5xae72bddaqlkef2t4e/pub.chive.admin.getViewDownloadTimeSeries/examples)

## Definitions

### `pub.chive.admin.getViewDownloadTimeSeries`

**Type**: `query`

Get view and download time series data

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `uri` | `string` (at-uri) | No | Specific eprint URI (aggregate if omitted) |
| `granularity` | `string` | No | Time bucket granularity |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `buckets` | `array` | Yes | Time series data buckets |
| `timestamp` | `string` (datetime) | Yes | Query timestamp |

#### Errors

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

### `pub.chive.admin.getViewDownloadTimeSeries#timeSeriesBucket`

**Type**: `object`

A time series data point for views and downloads

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `views` | `integer` | Yes | View count in this bucket |
| `downloads` | `integer` | Yes | Download count in this bucket |
| `timestamp` | `string` (datetime) | Yes | Bucket timestamp |

## Raw Schema

```json
{
  "id": "pub.chive.admin.getViewDownloadTimeSeries",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "AuthenticationRequired"
        },
        {
          "name": "AdminRequired"
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "buckets",
            "timestamp"
          ],
          "properties": {
            "buckets": {
              "type": "array",
              "items": {
                "ref": "#timeSeriesBucket",
                "type": "ref"
              },
              "description": "Time series data buckets"
            },
            "timestamp": {
              "type": "string",
              "format": "datetime",
              "description": "Query timestamp"
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "properties": {
          "uri": {
            "type": "string",
            "format": "at-uri",
            "description": "Specific eprint URI (aggregate if omitted)"
          },
          "granularity": {
            "type": "string",
            "description": "Time bucket granularity",
            "knownValues": [
              "hour",
              "day",
              "week"
            ]
          }
        }
      },
      "description": "Get view and download time series data"
    },
    "timeSeriesBucket": {
      "type": "object",
      "required": [
        "timestamp",
        "views",
        "downloads"
      ],
      "properties": {
        "views": {
          "type": "integer",
          "description": "View count in this bucket"
        },
        "downloads": {
          "type": "integer",
          "description": "Download count in this bucket"
        },
        "timestamp": {
          "type": "string",
          "format": "datetime",
          "description": "Bucket timestamp"
        }
      },
      "description": "A time series data point for views and downloads"
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "revision": 1
}
```
