Socket
Socket
Sign inDemoInstall

spotify-search-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spotify-search-wrapper

Spotify Search is a package to search for Spotify tracks and playlists without the need for a token, totally transparent to the user and that uses the official Spotify Web API.


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source
GitHub Release Publish

OverviewInstallationUsage

Overview

Spotify Search is a package to search for Spotify tracks and playlists without the need for a token, totally transparent to the user and that uses the official Spotify Web API.

Installation

Package install with with npm

npm install spotify-search

Usage

Searching track's
const spotifySearch = require("spotify-search");

(async () => {
	const tracks = await spotifySearch.searchTrack("Never Gonna Give You Up");

	console.log(tracks[0].id); // 4PTG3Z6ehGkBFwjybzWkR8
	console.log(tracks[0].name); // Never Gonna Give You Up
	console.log(tracks[0].href); // https://api.spotify.com/v1/tracks/4PTG3Z6ehGkBFwjybzWkR8
	console.log(tracks[0].artists[0].name); // Rick Astley
})();
Searching playlist's
const spotifySearch = require("spotify-search");

(async () => {
	const playlists = await spotifySearch.searchPlaylist("Top 50 - Global");

	console.log(playlists[0].id); // 37i9dQZEVXbMDoHDwVN2tF
	console.log(playlists[0].name); // Top 50 - Global
	console.log(playlists[0].href); // https://api.spotify.com/v1/playlists/37i9dQZEVXbMDoHDwVN2tF
	console.log(playlists[0].owner.id); // spotify
})();
Get Track info
const spotifySearch = require("spotify-search");

(async () => {
	const track = await spotifySearch.getTrackInfoById("4PTG3Z6ehGkBFwjybzWkR8");

	console.log(track.id); // 4PTG3Z6ehGkBFwjybzWkR8
	console.log(track.name); // Never Gonna Give You Up
	console.log(track.href); // https://api.spotify.com/v1/tracks/4PTG3Z6ehGkBFwjybzWkR8
	console.log(track.artists[0].name); // Rick Astley
})();
Get Playlist info
const spotifySearch = require("spotify-search");

(async () => {
	const playlist = await spotifySearch.getPlaylist("37i9dQZEVXbMDoHDwVN2tF");

	console.log(playlist.id); // 37i9dQZEVXbMDoHDwVN2tF
	console.log(playlist.name); // Top 50 - Global
	console.log(playlist.href); // https://api.spotify.com/v1/playlists/37i9dQZEVXbMDoHDwVN2tF
	console.log(playlist.owner.id); // spotify
})();

Tools

Validate Spotify id
const spotifySearch = require("spotify-search");

console.log(spotifySearch.validateTrackID("4PTG3Z6eh")); // Output: true
console.log(spotifySearch.validateTrackID("")); // Output: false
console.log(spotifySearch.validateTrackID("hello")); // Output: false

Keywords

FAQs

Package last updated on 20 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc