|
| 1 | +## GetUsersTopTracks |
| 2 | + |
| 3 | +> Get the current user’s top tracks based on calculated affinity. |
| 4 | +
|
| 5 | +**Parameters** |
| 6 | + |
| 7 | +|Name|Description|Example| |
| 8 | +|--------------|-------------------------|-------------------------| |
| 9 | +|[timeRange]| Over what time frame the affinities are compute. | `TimeRangeType.MediumTerm` |
| 10 | +|[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20` |
| 11 | +|[offset]| The index of the first entity to return. Default: 0 (i.e., the first track). Use with limit to get the next set of entities. | `0` |
| 12 | + |
| 13 | +Returns a [FullTrack](https://developer.spotify.com/web-api/object-model/#track-object-full) wrapped inside a [Paging-object](https://developer.spotify.com/web-api/object-model/#paging-object) |
| 14 | + |
| 15 | +**Usage** |
| 16 | + |
| 17 | +``` |
| 18 | +Paging<FullTrack> tracks = _spotify.GetUsersTopTracks(); |
| 19 | +tracks.Items.ForEach(item => Console.WriteLine(item.Name)); //Display all fetched Track-Names (max 20) |
| 20 | +Console.WriteLine(tracks.Total.ToString()) //Display total album track count |
| 21 | +``` |
| 22 | + |
| 23 | +--- |
| 24 | +## GetUsersTopArtists |
| 25 | +> Get the current user’s top artists based on calculated affinity. |
| 26 | +
|
| 27 | +**Parameters** |
| 28 | + |
| 29 | +|Name|Description|Example| |
| 30 | +|--------------|-------------------------|-------------------------| |
| 31 | +|[timeRange]| Over what time frame the affinities are compute. | `TimeRangeType.MediumTerm` |
| 32 | +|[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20` |
| 33 | +|[offset]| The index of the first entity to return. Default: 0 (i.e., the first track). Use with limit to get the next set of entities. | `0` |
| 34 | + |
| 35 | +Returns a [FullArtist](https://developer.spotify.com/web-api/object-model/#artist-object-full) wrapped inside a [Paging-object](https://developer.spotify.com/web-api/object-model/#paging-object) |
| 36 | + |
| 37 | +**Usage** |
| 38 | +``` |
| 39 | +Paging<FullArtist> artists = _spotify.GetUsersTopArtists(); |
| 40 | +artists.Items.ForEach(item => Console.WriteLine(item.Name)); //Display all fetched Artist-Names (max 20) |
| 41 | +``` |
| 42 | + |
| 43 | +--- |
| 44 | +## GetUsersRecentlyPlayedTracks |
| 45 | +> Get tracks from the current user’s recent play history. |
| 46 | +
|
| 47 | +**Parameters** |
| 48 | + |
| 49 | +|Name|Description|Example| |
| 50 | +|--------------|-------------------------|-------------------------| |
| 51 | +|[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20` |
| 52 | +|[after]| Returns all items after (but not including) this cursor position. | `DateTime.Now.AddDays(-1)` |
| 53 | +|[before]| Returns all items before (but not including) this cursor position. | `DateTime.Now.AddDays(-1)` |
| 54 | + |
| 55 | +Returns a `PlayHistory` wrapped inside a [CursorPaging-object](https://developer.spotify.com/web-api/object-model/#cursor-based-paging-object) |
| 56 | + |
| 57 | +**Usage** |
| 58 | +``` |
| 59 | +CursorPaging<PlayHistory> histories = _spotify.GetUsersRecentlyPlayedTracks(); |
| 60 | +histories.Items.ForEach(item => Console.WriteLine(item.Track.Name)); |
| 61 | +``` |
| 62 | + |
| 63 | +--- |
0 commit comments