-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more complete docs on the various catalog info methods
- Loading branch information
Showing
6 changed files
with
217 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Fetching Information About Albums | ||
|
||
There are a few methods for retrieving information about one or more albums from the Spotify catalog. For example, info about a albums's artist or all the tracks on an album. | ||
|
||
## Getting info about a single album | ||
|
||
```php | ||
$album = $api->getAlbum('ALBUM_ID'); | ||
|
||
echo '<b>' . $album->name . '</b>'; | ||
``` | ||
|
||
## Getting info about multiple albums | ||
|
||
```php | ||
$albums = $api->getAlbums([ | ||
'ALBUM_ID', | ||
'ALBUM_ID', | ||
]); | ||
|
||
foreach ($albums->albums as $album) { | ||
echo '<b>' . $album->name . '</b> <br>'; | ||
} | ||
``` | ||
|
||
## Getting all tracks on an album | ||
|
||
```php | ||
$tracks = $api->getAlbumTracks('ALBUM_ID'); | ||
|
||
foreach ($tracks->items as $track) { | ||
echo '<b>' . $track->name . '</b> <br>'; | ||
} | ||
``` | ||
|
||
Please see the [method reference](/docs/method-reference/SpotifyWebAPI.md) for more available options for each method. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Fetching Information About Artists | ||
|
||
There are a few methods for retrieving information about one or more albums from the Spotify catalog. For example, info about a single artist or an artist's top tracks in a country. | ||
|
||
## Getting info about a single artist | ||
|
||
```php | ||
$artist = $api->getArtist('ARTIST_ID'); | ||
|
||
echo '<b>' . $artist->name . '</b>'; | ||
``` | ||
|
||
## Getting info about multiple artists | ||
|
||
```php | ||
$artists = $api->getArtists([ | ||
'ARTIST_ID', | ||
'ARTIST_ID', | ||
]); | ||
|
||
foreach ($artists->artists as $artist) { | ||
echo '<b>' . $artist->name . '</b> <br>'; | ||
} | ||
``` | ||
|
||
## Getting an artist's albums | ||
|
||
```php | ||
$albums = $api->getArtistAlbums('ARTIST_ID'); | ||
|
||
foreach ($albums->items as $album) { | ||
echo '<b>' . $album->name . '</b> <br>'; | ||
} | ||
``` | ||
|
||
## Getting an artist's related artists | ||
|
||
```php | ||
$artists = $api->getArtistRelatedArtists('ARTIST_ID'); | ||
|
||
foreach ($artists->artists as $artist) { | ||
echo '<b>' . $artist->name . '</b> <br>'; | ||
} | ||
``` | ||
|
||
## Getting an artist’s top tracks in a country | ||
|
||
```php | ||
$tracks = $api->getArtistTopTracks('ARTIST_ID', [ | ||
'country' => 'se', | ||
]); | ||
|
||
foreach ($tracks->tracks as $track) { | ||
echo '<b>' . $track->name . '</b> <br>'; | ||
} | ||
``` | ||
|
||
## Getting recommendations based on artists | ||
|
||
```php | ||
$seedArtist = ['ARTIST_ID', 'ARTIST_ID']; | ||
|
||
$recommendations = $api->getRecommendations([ | ||
'seed_artists' => $seedArtist, | ||
]); | ||
|
||
print_r($recommendations); | ||
``` | ||
|
||
It's also possible to fetch recommendations based on genres and tracks, see the [Spotify docs](https://developer.spotify.com/documentation/web-api/reference/browse/get-recommendations/) for more info. | ||
|
||
Please see the [method reference](/docs/method-reference/SpotifyWebAPI.md) for more available options for each method. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Fetching Information About Podcasts | ||
|
||
There are a few methods for retrieving information about one or more podcasts from the Spotify catalog. For example, the description of a podcast or all of a podcast's episodes. | ||
|
||
## Getting info about a single podcast show | ||
|
||
```php | ||
$show = $api->getShow('SHOW_ID'); | ||
|
||
echo '<b>' . $show->name . '</b>'; | ||
``` | ||
|
||
## Getting info about multiple podcast shows | ||
|
||
```php | ||
$shows = $api->getShows([ | ||
'SHOW_ID', | ||
'SHOW_ID', | ||
]); | ||
|
||
foreach ($shows->shows as $show) { | ||
echo '<b>' . $show->name . '</b> <br>'; | ||
} | ||
``` | ||
|
||
## Getting info about a single podcast episode | ||
|
||
```php | ||
$episode = $api->getEpisode('EPISODE_ID'); | ||
|
||
echo '<b>' . $episode->name . '</b>'; | ||
``` | ||
|
||
## Getting info about multiple podcast episodes | ||
|
||
```php | ||
$episodes = $api->getEpisodeS([ | ||
'EPISODE_ID', | ||
'EPISODE_ID', | ||
]); | ||
|
||
foreach ($episodes->episodes as $episode) { | ||
echo '<b>' . $episode->name . '</b> <br>'; | ||
} | ||
``` | ||
|
||
## Getting a podcast show's episodes | ||
|
||
```php | ||
$episodes = $api->getShowEpisodes('SHOW_ID'); | ||
|
||
foreach ($episodes->items as $episode) { | ||
echo '<b>' . $episode->name . '</b> <br>'; | ||
} | ||
``` | ||
|
||
Please see the [method reference](/docs/method-reference/SpotifyWebAPI.md) for more available options for each method. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Fetching Information About Tracks | ||
|
||
There are a few methods for retrieving information about one or more albums from the Spotify catalog. For example, info about a track's artist or recommendations on similar tracks. | ||
|
||
## Getting info about a single track | ||
|
||
```php | ||
$track = $api->getTrack('TRACK_ID'); | ||
|
||
echo '<b>' . $track->name . '</b> by <b>' . $track->artists[0]->name . '</b>'; | ||
``` | ||
|
||
## Getting info about multiple tracks | ||
|
||
```php | ||
$tracks = $api->getTracks([ | ||
'TRACK_ID', | ||
'TRACK_ID', | ||
]); | ||
|
||
foreach ($tracks->tracks as $tracks) { | ||
echo '<b>' . $track->name . '</b> by <b>' . $track->artists[0]->name . '</b> <br>'; | ||
} | ||
``` | ||
|
||
## Getting the audio analysis of a track | ||
|
||
```php | ||
$analysis = $api->getAudioAnalysis('TRACK_ID'); | ||
|
||
print_r($analysis); | ||
``` | ||
|
||
## Getting recommendations based on tracks | ||
|
||
```php | ||
$seedTracks = ['TRACK_ID', 'TRACK_ID']; | ||
|
||
$recommendations = $api->getRecommendations([ | ||
'seed_tracks' => $seedTracks, | ||
]); | ||
|
||
print_r($recommendations); | ||
``` | ||
|
||
It's also possible to fetch recommendations based on genres and tracks, see the [Spotify docs](https://developer.spotify.com/documentation/web-api/reference/browse/get-recommendations/) for more info. | ||
|
||
Please see the [method reference](/docs/method-reference/SpotifyWebAPI.md) for more available options for each method. |