I have been trying to figure out how to convert a music streaming service link to all the other ones that are given. In the pool, I have Spotify, Apple Music, Amazon, YouTube, SoundCloud, Tidal, and YouTube Music. The user would input a link to a song from any streaming service (ex. https://open.spotify.com/track/4zfjkqJRJghGXUIq3Cosks?si=8f988d76f78941a6) and then the algorithm would spit out all the other links to the exact same song on the other platforms I listed above. This would be the exact same process and outcome similar to SongWhip. I have been trying to figure out how to implement this with ReactJS. Please help if you can! Thank you!

1

There are 1 best solutions below

0
On

You could try using Songlink's public API. It should do exactly what you're looking for, and includes all the major streaming services you mentioned.

Using the example song in your question, you would submit a GET request:

curl -X GET "https://api.song.link/v1-alpha.1/links?url=open.spotify.com%2Ftrack%2F4zfjkqJRJghGXUIq3Cosks%3Fsi%3D8f988d76f78941a6"

And Songlink will return a json file with all the matching links in other streaming platforms (if they exist):

{
  "entityUniqueId": "SPOTIFY_SONG::4zfjkqJRJghGXUIq3Cosks",
  "userCountry": "US",
  "pageUrl": "https://song.link/s/4zfjkqJRJghGXUIq3Cosks",
  "entitiesByUniqueId": {
    "DEEZER_SONG::1275807472": {
      "id": "1275807472",
      "type": "song",
      "title": "Inhaled",
      "artistName": "Ahmad Anonimis",
      "thumbnailUrl": "https://cdns-images.dzcdn.net/images/cover/48acc171cd7310d10047e6066d136586/500x500-000000-80-0-0.jpg",
      "thumbnailWidth": 500,
      "thumbnailHeight": 500,
      "apiProvider": "deezer",
      "platforms": [
        "deezer"
      ]
    },
    "NAPSTER_SONG::tra.566238115": {
      "id": "tra.566238115",
      "type": "song",
      "title": "Inhaled",
      "artistName": "Ahmad Anonimis",
      "thumbnailUrl": "https://direct.rhapsody.com/imageserver/images/alb.566238114/385x385.jpeg",
      "thumbnailWidth": 385,
      "thumbnailHeight": 385,
      "apiProvider": "napster",
      "platforms": [
        "napster"
      ]
    },
    "SOUNDCLOUD_SONG::1020531370": {
      "id": "1020531370",
      "type": "song",
      "title": "Inhaled (Prod. by Powers Pleasant)",
      "artistName": "Ahmad Anonimis",
      "thumbnailUrl": "https://i1.sndcdn.com/artworks-Mt2vlaVXZXzAosyy-1w1BOA-t500x500.jpg",
      "thumbnailWidth": 500,
      "thumbnailHeight": 500,
      "apiProvider": "soundcloud",
      "platforms": [
        "soundcloud"
      ]
    },
    "SPOTIFY_SONG::4zfjkqJRJghGXUIq3Cosks": {
      "id": "4zfjkqJRJghGXUIq3Cosks",
      "type": "song",
      "title": "Inhaled",
      "artistName": "Ahmad Anonimis",
      "thumbnailUrl": "https://i.scdn.co/image/ab67616d0000b2733ec2a571fa840e8a0a449107",
      "thumbnailWidth": 640,
      "thumbnailHeight": 640,
      "apiProvider": "spotify",
      "platforms": [
        "spotify"
      ]
    },
    "TIDAL_SONG::177197054": {
      "id": "177197054",
      "type": "song",
      "title": "Inhaled",
      "artistName": "Ahmad Anonimis",
      "thumbnailUrl": "https://resources.tidal.com/images/2fb4cbe7/b022/408e/b8d1/79a8bf7eefb5/640x640.jpg",
      "thumbnailWidth": 640,
      "thumbnailHeight": 640,
      "apiProvider": "tidal",
      "platforms": [
        "tidal"
      ]
    },
    "YOUTUBE_VIDEO::3p4RJHoosg8": {
      "id": "3p4RJHoosg8",
      "type": "song",
      "title": "Ahmad Anonimis - Inhaled (Official Music Video)",
      "artistName": "Ahmad Anonimis",
      "thumbnailUrl": "https://i.ytimg.com/vi/3p4RJHoosg8/hqdefault.jpg",
      "thumbnailWidth": 480,
      "thumbnailHeight": 360,
      "apiProvider": "youtube",
      "platforms": [
        "youtube",
        "youtubeMusic"
      ]
    }
  },
  "linksByPlatform": {
    "deezer": {
      "country": "US",
      "url": "https://www.deezer.com/track/1275807472",
      "entityUniqueId": "DEEZER_SONG::1275807472"
    },
    "napster": {
      "country": "US",
      "url": "https://napster.com/track/tra.566238115",
      "entityUniqueId": "NAPSTER_SONG::tra.566238115"
    },
    "soundcloud": {
      "country": "US",
      "url": "https://soundcloud.com/ahmadanonimis-official/inhaled-prod-by-powers-pleasant",
      "entityUniqueId": "SOUNDCLOUD_SONG::1020531370"
    },
    "spotify": {
      "country": "US",
      "url": "https://open.spotify.com/track/4zfjkqJRJghGXUIq3Cosks",
      "nativeAppUriDesktop": "spotify:track:4zfjkqJRJghGXUIq3Cosks",
      "entityUniqueId": "SPOTIFY_SONG::4zfjkqJRJghGXUIq3Cosks"
    },
    "tidal": {
      "country": "US",
      "url": "https://listen.tidal.com/track/177197054",
      "entityUniqueId": "TIDAL_SONG::177197054"
    },
    "youtube": {
      "country": "US",
      "url": "https://www.youtube.com/watch?v=3p4RJHoosg8",
      "entityUniqueId": "YOUTUBE_VIDEO::3p4RJHoosg8"
    },
    "youtubeMusic": {
      "country": "US",
      "url": "https://music.youtube.com/watch?v=3p4RJHoosg8",
      "entityUniqueId": "YOUTUBE_VIDEO::3p4RJHoosg8"
    }
  }
}

This works for both songs and albums.