Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Spotify Web Api Php Laravel Package

jwilsson/spotify-web-api-php

View on GitHub
Deep Wiki
Context7

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

$track = $api->getTrack('TRACK_ID');

echo '<b>' . $track->name . '</b> by <b>' . $track->artists[0]->name . '</b>';

Getting info about multiple tracks

Note: This method is only available to extended quota apps.

$tracks = $api->getTracks([
    'TRACK_ID',
    'TRACK_ID',
]);

foreach ($tracks->tracks as $track) {
    echo '<b>' . $track->name . '</b> by <b>' . $track->artists[0]->name . '</b> <br>';
}

Getting the audio analysis of a track

$analysis = $api->getAudioAnalysis('TRACK_ID');

print_r($analysis);

Getting the audio features of a track

$features = $api->getAudioFeatures('TRACK_ID');

print_r($features);

Getting the audio features of multiple tracks

$tracks = [
    'TRACK_ID',
    'TRACK_ID',
];

$features = $api->getMultipleAudioFeatures($tracks);

print_r($features);

Getting recommendations based on tracks

$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 artists, see the Spotify docs for more info.

Please see the method reference for more available options for each method.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views