spoti-rec
v2.0.0
Published
A Spotify API package that fetches track recommendations from Spotify
Downloads
18
Readme
🎵 Spotify Search API 🎧
Spotify Rec V2 is a Node.js package that allows you to search for songs by artist name or song title and provide related recommendations. Search results include Spotify links from the recommendations provided.
✨ Main Features
- 🔍 Search for Songs: Search for tracks based on artist name or song title.
- 🎶 Auto Recommendations: Get track recommendations based on search results.
- 🔗 Spotify Links: Returns direct links to recommended tracks on Spotify.
⚙️ Required
Before using this package, you need:
- Spotify Developer Account: Register on Spotify Developer Dashboard to get
client_id
andclient_secret
. - Node.js: Make sure Node.js is installed on your computer.
🚀 Installation
Install this package using npm:
npm install spoti-rec
🛠️ Usage
Here's a simple example of how to use Spotify Rec:
const SpotifyAuth = require('spoti-rec');
const clientId = 'YOUR_CLIENT_ID';
const clientSecret = 'YOUR_CLIENT_SECRET';
const spoti = new SpotifyAuth(clientId, clientSecret);
(async () => {
const query = `The Weeknd - Blinding Lights`; // Replace with your desired track title and artist
const reco = await spoti.getUrl(query);
console.log('Track:', [
`${reco[0]}`,
`${reco[1]}`,
`${reco[2]}`,
`${reco[3]}`,
`${reco[4]}`
]);
})();
📀 Results
The results obtained are in the form of a Spotify link from the recommended track:
Track: [
'https://open.spotify.com/track/xxxxxxxxxxxxxxxx',
'https://open.spotify.com/track/xxxxxxxxxxxxxxxx',
...
]
👋 Contributing
Feel free to open issues or submit pull requests for any improvements or bug fixes. Contributions are always welcome!.
🧑💻 Contributors
- Michxoo Primary Developers.
⚖️ License
Distribution of this project is licensed under the MIT license. See LICENSE for more information.