Spotify.NET/SpotifyAPI.Docs/versioned_docs/version-5.1.1/web/artists.md

103 lines
3.7 KiB
Markdown
Raw Normal View History

2020-05-13 17:25:42 +01:00
---
id: artists
title: Artists
sidebar_label: Artists
---
2019-08-16 23:40:04 +01:00
## GetArtist
2016-08-20 11:49:09 +01:00
> Get Spotify catalog information for a single artist identified by their unique Spotify ID.
2019-08-16 23:40:04 +01:00
**Parameters**
2016-08-20 11:49:09 +01:00
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|id| The Spotify ID for the artist. | `"1KpCi9BOfviCVhmpI4G2sY"`
Returns a [FullArtist](https://developer.spotify.com/web-api/object-model/#artist-object-full)
2019-08-16 23:40:04 +01:00
**Usage**
```csharp
2016-08-20 11:49:09 +01:00
FullArtist artist = _spotify.GetArtist("1KpCi9BOfviCVhmpI4G2sY");
Console.WriteLine()
```
---
2019-08-16 23:40:04 +01:00
## GetRelatedArtists
2016-08-20 11:49:09 +01:00
> Get Spotify catalog information about artists similar to a given artist. Similarity is based on analysis of the Spotify community's listening history.
2019-08-16 23:40:04 +01:00
**Parameters**
2016-08-20 11:49:09 +01:00
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|id| The Spotify ID for the artist. | `"1KpCi9BOfviCVhmpI4G2sY"`
2019-08-16 23:40:04 +01:00
Returns a `SeveralArtists` object which contains the property `List<FullArtist> Artists` ([FullArtist](https://developer.spotify.com/web-api/object-model/#artist-object-full))
2016-08-20 11:49:09 +01:00
2019-08-16 23:40:04 +01:00
**Usage**
```csharp
2016-08-20 11:49:09 +01:00
SeveralArtists artists = _spotify.GetRelatedArtists("1KpCi9BOfviCVhmpI4G2sY");
Console.WriteLine(artists.Artists[0].Name);
```
---
2019-08-16 23:40:04 +01:00
## GetArtistsTopTracks
2016-08-20 11:49:09 +01:00
> Get Spotify catalog information about an artist's top tracks by country.
2019-08-16 23:40:04 +01:00
**Parameters**
2016-08-20 11:49:09 +01:00
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|id| The Spotify ID for the artist. | `"1KpCi9BOfviCVhmpI4G2sY"`
|country| The country: an ISO 3166-1 alpha-2 country code. | `"DE"`
2019-08-16 23:40:04 +01:00
Returns a `SeveralTracks` object which contains the property `List<FullTrack> Tracks` ([FullTrack](https://developer.spotify.com/web-api/object-model/#track-object-full))
2016-08-20 11:49:09 +01:00
2019-08-16 23:40:04 +01:00
**Usage**
```csharp
2016-08-20 11:49:09 +01:00
SeveralTracks tracks = _spotify.GetArtistsTopTracks("1KpCi9BOfviCVhmpI4G2sY", "DE");
Console.WriteLine(tracks.Tracks.Count); //How many tracks did we get?
```
---
2019-08-16 23:40:04 +01:00
## GetArtistsAlbums
2016-08-20 11:49:09 +01:00
> Get Spotify catalog information about an artist's albums. Optional parameters can be specified in the query string to filter and sort the response.
2019-08-16 23:40:04 +01:00
**Parameters**
2016-08-20 11:49:09 +01:00
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|id| The Spotify ID for the artist. | `"1KpCi9BOfviCVhmpI4G2sY"`
|[type]| A list of keywords that will be used to filter the response. If not supplied, all album types will be returned | `AlbumType.All`
|[limit]| The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. | `20`
|[offset]| The index of the first album to return. Default: 0 | `0`
|[market]| An ISO 3166-1 alpha-2 country code. Supply this parameter to limit the response to one particular geographical market | `"DE"`
Returns a [SimpleAlbum](https://developer.spotify.com/web-api/object-model/#album-object-simplified) wrapped inside a [Paging-object](https://developer.spotify.com/web-api/object-model/#paging-object)
2019-08-16 23:40:04 +01:00
**Usage**
```csharp
2016-08-20 11:49:09 +01:00
Paging<SimpleAlbum> albums = _spotify.GetArtistsAlbums("1KpCi9BOfviCVhmpI4G2sY", AlbumType.All);
albums.Items.ForEach(album => Console.WriteLine(album.Name));
```
---
2019-08-16 23:40:04 +01:00
## GetSeveralArtists
2016-08-20 11:49:09 +01:00
> Get Spotify catalog information for several artists based on their Spotify IDs.
2019-08-16 23:40:04 +01:00
**Parameters**
2016-08-20 11:49:09 +01:00
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|ids| A list of the Spotify IDs for the artists. Maximum: 50 IDs. | `new List<String>() { "1KpCi9BOfviCVhmpI4G2sY" } `
2019-08-16 23:40:04 +01:00
Returns a `SeveralArtists` object which contains the property `List<FullArtist> Artists` ([FullArtist](https://developer.spotify.com/web-api/object-model/#artist-object-full))
2016-08-20 11:49:09 +01:00
2019-08-16 23:40:04 +01:00
**Usage**
```csharp
2016-08-20 11:49:09 +01:00
SeveralArtists artists = _spotify.GetSeveralArtists(new List<String>() {"1KpCi9BOfviCVhmpI4G2sY"});
artists.Artists.ForEach(artist => Console.WriteLine(artist.Name));
```
---