Source: https://dinakar-rewind.docs.pageloop.ai/api-reference/listening/getlisteningyearinreview

# Year in review

GET `https://api.rewind.rest/v1/listening/year/{year}`

Returns year-in-review listening data. Optionally pass ?month=N to scope to a single month.

## Authorization

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

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

## Path Parameters

#### year (path, string, required)

## Query Parameters

#### month (query, integer)

Optional month (1-12) to scope results to a single month

#### include\_sparklines (query, boolean)

When true, attach a `sparkline` object to each item in `top_artists`, `top_albums`, and `top_tracks`. Without `month`, returns 12 monthly buckets for the year. With `month`, returns daily buckets within that month (28-31 points).

## Response

#### 200

Year in review data

#### year (number, required)

#### month (number)

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

#### unique\_artists (number, required)

#### unique\_albums (number, required)

#### unique\_tracks (number, required)

#### top\_artists (array of object, required)

#### properties

#### id (number, required)

#### name (string, required)

#### scrobbles (number, required)

#### apple\_music\_url (string, required)

#### image (object)

#### sparkline (object)

#### top\_albums (array of object, required)

#### properties

#### id (number, required)

#### name (string, required)

#### artist (string, required)

#### scrobbles (number, required)

#### apple\_music\_url (string, required)

#### image (object)

#### sparkline (object)

#### top\_tracks (array of object, required)

#### properties

#### id (number, required)

#### name (string, required)

#### artist (string, required)

#### scrobbles (number, required)

#### apple\_music\_url (string, required)

#### preview\_url (string, required)

#### sparkline (object)

#### monthly (array of object, required)

#### properties

#### month (string, required)

#### scrobbles (number, required)

#### unique\_artists (number, required)

#### unique\_albums (number, required)

#### 400

Bad request

#### error (string, required)

#### status (integer, required)

#### 401

Unauthorized

#### error (string, required)

#### status (integer, required)

#### Request

```bash cURL
curl -X GET 'https://api.rewind.rest/v1/listening/year/{year}' \
  -H 'Authorization: Bearer <token>'
```

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

```python Python
import requests

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

#### Response

```json 200
{
  "year": 0,
  "month": 0,
  "total_scrobbles": 0,
  "unique_artists": 0,
  "unique_albums": 0,
  "unique_tracks": 0,
  "top_artists": [
    {
      "id": 0,
      "name": "string",
      "scrobbles": 0,
      "apple_music_url": "string",
      "image": {},
      "sparkline": {
        "granularity": "\u2026",
        "points": "\u2026"
      }
    }
  ],
  "top_albums": [
    {
      "id": 0,
      "name": "string",
      "artist": "string",
      "scrobbles": 0,
      "apple_music_url": "string",
      "image": {},
      "sparkline": {
        "granularity": "\u2026",
        "points": "\u2026"
      }
    }
  ],
  "top_tracks": [
    {
      "id": 0,
      "name": "string",
      "artist": "string",
      "scrobbles": 0,
      "apple_music_url": "string",
      "preview_url": "string",
      "sparkline": {
        "granularity": "\u2026",
        "points": "\u2026"
      }
    }
  ],
  "monthly": [
    {
      "month": "string",
      "scrobbles": 0,
      "unique_artists": 0,
      "unique_albums": 0
    }
  ]
}
```

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

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