npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

spotify-finder-nextgen

v1.1.0

Published

A Node.js/ts package for finding and retrieving Spotify tracks, audio, and images using various search methods.

Downloads

13

Readme

Spotify Finder Nextgen

A Node.js module for interacting with Spotify's API, providing functions to search for queries and fetch details about artists, songs, and playlists.

Installation

To install the module, run:

npm install spotify-finder-nextgen

Usage

Importing the Module

In a CommonJS environment:

const { search, artist, song, playlist } = require('spotify-finder-nextgen');

In an ES module environment:

import { search, artist, song, playlist } from 'spotify-finder-nextgen';

Functions

search(query: string): Promise<any>

Search for a query in Spotify. Returns search results.

Parameters:

  • query (string): The search query. Links are not allowed.

Example:

(async () => {
  try {
    const results = await search('Duvet');
    console.log(results);
  } catch (error) {
    console.error(error);
  }
})();

Result JSON:

{
  "songs": [
    {
      "title": "Faded (Raw)",
      "subtitle": "Song • Illest Morena",
      "imageUrl": "https://i.scdn.co/image/ab67616d00001e023fe0c03eeae2ff5e1dc1f26f",
      "url": "https://open.spotify.com/track/title-5AxEGHRwgBqFDZ20ilkCw6"
    }
    // More results...
  ],
  "artists": [
    {
      "title": "Illest Morena",
      "subtitle": "Artist",
      "imageUrl": "https://i.scdn.co/image/ab6761610000e5eb3b543ea28fd14957c84d03cb",
      "url": "https://open.spotify.com/artist/title-2zRoFfKfqM5jaUysSG9EUI"
    }
    // More results...
  ],
  "playlists": [
    {
      "title": "geng geng playlist",
      "subtitle": "Playlist",
      "imageUrl": "https://image-cdn-ak.spotifycdn.com/image/ab67706c0000da8423376c1b45353026e9155c9b",
      "url": "https://open.spotify.com/playlist/title-68m9Cno8OO81Y5OnlrtpEh"
    }
    // More results...
  ]
}

artist(link: string): Promise<any>

Fetch details about a specific artist.

Parameters:

  • link (string): The Spotify artist link.

Example:

(async () => {
  try {
    const artistDetails = await artist('https://open.spotify.com/artist/5jTtGLk1mGFMY5lQOvJYUj');
    console.log(artistDetails);
  } catch (error) {
    console.error(error);
  }
})();

Result JSON:

{
  "artistName": "bôa",
  "artistProfile": "https://i.scdn.co/image/ab67616100005174d699423e4d35ff7a7fb66b7d",
  "about": {
    "monthlyListeners": "8,008,828 monthly listeners",
    "description": "bôa is a British alt-rock band originally formed in London in 1992. ...",
    "socialMedia": [
      {
        "platform": "Facebook",
        "link": "https://facebook.com/...."
      },
      {
        "platform": "Instagram",
        "link": "https://instagram.com/...."
      }
    ]
  },
  "popularSongs": [
    {
      "title": "Duvet",
      "plays": "476,425,699",
      "image": "https://i.scdn.co/image/ab67616d000048519e030b804258dc2017ad859f"
    }
    // More results...
  ],
  "albums": [
    {
      "title": "Twilight",
      "year": "Album • 2010",
      "image": "https://i.scdn.co/image/ab67616d00001e029e030b804258dc2017ad859f",
      "link": "https://open.spotify.com/album/7sGYAV0xv7ZfAMzIpMl8m1"
    }
    // More results...
  ],
  "singlesAndEPs": [
    {
      "title": "Twilight",
      "year": "Album • 2010",
      "image": "https://i.scdn.co/image/ab67616d00001e029e030b804258dc2017ad859f",
      "link": "https://open.spotify.com/album/7sGYAV0xv7ZfAMzIpMl8m1"
    }
    // More results...
  ],
  "featuring": [
    {
      "title": "Twilight",
      "year": "Album • 2010",
      "image": "https://i.scdn.co/image/ab67616d00001e029e030b804258dc2017ad859f",
      "link": "https://open.spotify.com/album/7sGYAV0xv7ZfAMzIpMl8m1"
    }
    // More results...
  ],
  "onTour": [],
  "artistPlaylists": [
    {
      "title": "Twilight",
      "image": "https://i.scdn.co/image/ab67616d00001e029e030b804258dc2017ad859f",
      "link": "https://open.spotify.com/album/7sGYAV0xv7ZfAMzIpMl8m1"
    }
    // More results...
  ]
}

song(link: string): Promise<any>

Fetch details about a specific song.

Parameters:

  • link (string): The Spotify track link.

Example:

(async () => {
  try {
    const songDetails = await song('https://open.spotify.com/track/0wEeW8Bwr0fHXuS2zLiDXk');
    console.log(songDetails);
  } catch (error) {
    console.error(error);
  }
})();

Result JSON:

{
  "title": "Duvet - Sped Up Version",
  "artist": "bôa",
  "image": "https://i.scdn.co/image/ab67616d00001e02786d2ae38a7a469bf4218d4a",
  "duration": "3:02",
  "lyrics": "And you don't seem to understand ...",
  "audio": "http://puppeteer-scrape-production.up.railway.app/spotify/downloads/Duvet---Sped-Up-Version.mp3"
}

playlist(link: string): Promise<any>

Fetch details about a specific playlist.

Parameters:

  • link (string): The Spotify playlist link.

Example:

(async () => {
  try {
    const playlistDetails = await playlist('https://open.spotify.com/playlist/37i9dQZEVXbNBz9cRCSFkY');
    console.log(playlistDetails);
  } catch (error) {
    console.error(error);
  }
})();

Result JSON:

{
  "title": "Top 50 - Philippines",
  "image": "https://charts-images.scdn.co/assets/locale_en/regional/daily/region_ph_default.jpg",
  "description": "Your daily update of the most played tracks right now - Philippines.",
  "saves": "1,361,515 saves",
  "tracks": [
    {
      "title": "sining (feat. Jay R)",
      "artist": "Dionela, Jay R",
      "image": "https://i.scdn.co/image/ab67616d0000485119f16592da6f918a04ef6b7c"
    }
    // More tracks...
  ]
}

License

MIT License. See LICENSE for details.