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

64 lines
2.0 KiB
Markdown
Raw Normal View History

2020-05-13 17:25:42 +01:00
---
id: tracks
title: Tracks
sidebar_label: Tracks
---
2019-08-16 23:40:04 +01:00
## GetSeveralTracks
2016-08-20 11:49:09 +01:00
> Get Spotify catalog information for multiple tracks 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 tracks. Maximum: 50 IDs. | `new List<String> {"6Y1CLPwYe7zvI8PJiWVz6T"}`
|market| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | `"DE"`
2019-08-16 23:40:04 +01:00
Returns a `SeveralTracks` object which has one property, `List<FullTrack> Tracks`
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 severalTracks = _spotify.GetSeveralTracks(new List<String> {"6Y1CLPwYe7zvI8PJiWVz6T"});
severalTracks.Tracks.ForEach(track => Console.WriteLine(track.Name));
```
---
2019-08-16 23:40:04 +01:00
## GetTrack
2016-08-20 11:49:09 +01:00
> Get Spotify catalog information for a single track identified by its 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 track. | `"6Y1CLPwYe7zvI8PJiWVz6T"`
|market| An ISO 3166-1 alpha-2 country code. Provide this parameter if you want to apply Track Relinking. | `"DE"`
Returns a [FullTrack](https://developer.spotify.com/web-api/object-model/#track-object-full)
2019-08-16 23:40:04 +01:00
**Usage**
```csharp
2016-08-20 11:49:09 +01:00
FullTrack track = _spotify.GetTrack("6Y1CLPwYe7zvI8PJiWVz6T");
Console.WriteLine(track.Name);
```
---
2019-08-16 23:40:04 +01:00
## GetAudioAnalysis
> Get a detailed audio analysis for a single track identified by its unique Spotify ID.
2019-08-16 23:40:04 +01:00
**Parameters**
|Name|Description|Example|
|--------------|-------------------------|-------------------------|
|id| The Spotify ID for the track. | `"6Y1CLPwYe7zvI8PJiWVz6T"`
Returns a AudioAnalysis. This object is currently lacking Spotify documentation but archived [EchoNest documentation](https://web.archive.org/web/20160528174915/http://developer.echonest.com/docs/v4/_static/AnalyzeDocumentation.pdf) is relevant.
2019-08-16 23:40:04 +01:00
**Usage**
```csharp
AudioAnalysis analysis = _spotify.GetAudioAnalysis("6Y1CLPwYe7zvI8PJiWVz6T");
Console.WriteLine(analysis.Meta.DetailedStatus);
```