Source: https://dinakar-rewind.docs.pageloop.ai/api-reference/collecting/getcollectingmediastats

# Physical media stats

GET `https://api.rewind.rest/v1/collecting/media/stats`

Aggregate statistics for the physical media collection by format, resolution, HDR, genre, and decade.

## Authorization

#### Authorization (header, string, required)

API key. Read keys (rw\_live\_...) access GET endpoints. Admin keys (rw\_admin\_...) access all endpoints.

## Response

#### 200

Media collection statistics

#### total\_items (number, required)

#### by\_format (object)

#### by\_resolution (object)

#### by\_hdr (object)

#### by\_genre (object)

#### by\_decade (object)

#### added\_this\_year (number, required)

#### 401

Unauthorized

#### error (string, required)

#### status (integer, required)

#### 500

Internal server error

#### error (string, required)

#### status (integer, required)

#### Request

```bash cURL
curl -X GET 'https://api.rewind.rest/v1/collecting/media/stats' \
  -H 'Authorization: Bearer <token>'
```

```javascript JavaScript
const res = await fetch('https://api.rewind.rest/v1/collecting/media/stats', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer <token>',
  },
});
const data = await res.json();
```

```python Python
import requests

res = requests.get(
    'https://api.rewind.rest/v1/collecting/media/stats',
    headers={'Authorization': 'Bearer <token>'}
)
data = res.json()
```

#### Response

```json 200
{
  "total_items": 0,
  "by_format": {},
  "by_resolution": {},
  "by_hdr": {},
  "by_genre": {},
  "by_decade": {},
  "added_this_year": 0
}
```

```json 401
{
  "error": "Not found",
  "status": 404
}
```

```json 500
{
  "error": "Not found",
  "status": 404
}
```
