Spotify

A list of Spotify APIs

baseURL: wv2h4to5qa.execute-api.us-east-2.amazonaws.com/dev/spotify

To obtain x-api-key please contact the team. You can find more information at the "Connect With Us" section


Authentication

All requests require a valid API key to be included in the x-api-key header.

Fetch Played Tracks by Spotify Id

GET https://<baseURL>/played-tracks

Fetches the played tracks of the authenticated Spotify user

This endpoint will only work if the user has connected their Spotify account to the platform.

Query Parameters

{
  "isError": boolean,
  "data": [
    {
      "track": {
        "album": {
          "album_type": string,
          "artists": [
            {
              "external_urls": {
                "spotify": string
              },
              "href": string,
              "id": string,
              "name": string,
              "type": string,
              "uri": string
            }
          ],
          "available_markets": [string],
          "external_urls": {
            "spotify": string
          },
          "href": string,
          "id": string,
          "images": [
            {
              "height": number,
              "url": string,
              "width": number
            }
          ],
          "name": string,
          "release_date": string,
          "release_date_precision": string,
          "total_tracks": number,
          "type": string,
          "uri": string
        },
        "artists": [
          {
            "external_urls": {
              "spotify": string
            },
            "href": string,
            "id": string,
            "name": string,
            "type": string,
            "uri": string
          }
        ],
        "available_markets": [string],
        "disc_number": number,
        "duration_ms": number,
        "explicit": boolean,
        "external_ids": {
          "isrc": string
        },
        "external_urls": {
          "spotify": string
        },
        "href": string,
        "id": string,
        "is_local": boolean,
        "name": string,
        "popularity": number,
        "preview_url": string,
        "track_number": number,
        "type": string,
        "uri": string
      },
      "played_at": string,
      "context": {
        "type": string,
        "href": string,
        "external_urls": {
          "spotify": string
        },
        "uri": string
      }
    }
  ],
  "message": string
}
curl --location 'https://wv2h4to5qa.execute-api.us-east-2.amazonaws.com/dev/spotify/played-tracks?spotifyId=kemarikun' \
--header 'x-api-key: <apiKey>'

Fetch Saved Tracks by Spotify Id

GET https://<baseURL>/saved-tracks

Fetches the saved tracks of the authenticated Spotify user

This endpoint will only work if the user has connected their Spotify account to the platform.

Query Parameters

*** same format as played-tracks above

curl --location 'https://wv2h4to5qa.execute-api.us-east-2.amazonaws.com/dev/spotify/save-tracks?spotifyId=kemarikun' \
--header 'x-api-key: <apiKey>'

Fetch Saved Albums by Spotify Id

GET https://<baseURL>/saved-albums

Fetches the saved albums of the authenticated Spotify user

This endpoint will only work if the user has connected their Spotify account to the platform.

Query Parameters

{
  "isError": boolean,
  "data": [
    {
      "albumId": string,
      "albumName": string,
      "albumTotalTracks": number,
      "albumPopularity": string,
      "albumImages": [
        {
          "url": string,
          "height": number,
          "width": number
        }
      ],
      "albumType": string,
      "albumAvailableMarkets": string,
      "albumExternalUrls": {
        "spotify": string
      },
      "albumHref": string,
      "albumReleaseDate": string,
      "albumReleaseDatePrecision": string,
      "albumUri": string,
      "albumExternalIds": string,
      "albumGenres": string,
      "albumLabel": string
    }
  ],
  "message": string
}
curl --location 'https://wv2h4to5qa.execute-api.us-east-2.amazonaws.com/dev/spotify/save-albums?spotifyId=kemarikun' \
--header 'x-api-key: <apiKey>'

Fetch Saved Playlists by Spotify Id

GET https://<baseURL>/saved-playlists

Fetches the saved playlists of the authenticated Spotify user

This endpoint will only work if the user has connected their Spotify account to the platform.

Query Parameters

{
  "isError": boolean,
  "data": [
    {
      "playlistId": string,
      "playlistName": string,
      "playlistDescription": string,
      "playlistImages": [
        {
          "height": number,
          "url": string,
          "width": number
        }
      ],
      "playlistExternalUrls": {
        "spotify": string
      },
      "playlistHref": string,
      "playlistType": string,
      "playlistUri": string,
      "playlistCollaborative": boolean,
      "playlistFollowers": number,
      "playlistSnapshotId": string
    }
  ],
  "message": string
}
curl --location 'https://wv2h4to5qa.execute-api.us-east-2.amazonaws.com/dev/spotify/save-playlists?spotifyId=kemarikun' \
--header 'x-api-key: <apiKey>'

Fetch Playlists Tracks by Spotify Id

GET https://<baseURL>/playlist/tracks

Fetches the playlists tracks of the authenticated Spotify user with the specified playlist

This endpoint will only work if the user has connected their Spotify account to the platform.

Query Parameters

NameTypeDescription

spotifyId*

string

playlistId*

string

The playlistId of the playlist

{
  "isError": boolean,
  "data": {
    "id": string,
    "name": string,
    "description": string,
    "images": [
      {
        "height": number,
        "url": string,
        "width": number
      }
    ],
    "owner": {
      "id": string,
      "displayName": string
    },
    "tracks": [
      {
        "id": string,
        "name": string,
        "album": string,
        "artists": [string]
      }
    ],
    "externalUrls": {
      "spotify": string
    }
  },
  "message": string
}
curl --location 'https://wv2h4to5qa.execute-api.us-east-2.amazonaws.com/dev/spotify/playlist/tracks?spotifyId=kemarikun&playlistId=5nizWu5c54NkpA2Eu6Y2S0' \
--header 'x-api-key: <apiKey>'

Fetch Album Tracks by Spotify Id

GET https://<baseURL>/album/tracks

Fetches the playlists tracks of the authenticated Spotify user with the specified playlist

This endpoint will only work if the user has connected their Spotify account to the platform.

Query Parameters

NameTypeDescription

spotifyId*

string

albumId*

string

The albumId of the album

{
    "isError": boolean,
    "data": {
        "id": string,
        "name": string,
        "images": [
            {
                "url": string,
                "height": number,
                "width": number
            }
        ],
        "artists": [
            {
                "id": string,
                "name": string
            }
        ],
        "releaseDate": string,
        "totalTracks": number,
        "externalUrls": {
            "spotify": string
        }
    },
    "message": string
}
curl --location 'https://wv2h4to5qa.execute-api.us-east-2.amazonaws.com/dev/spotify/album/tracks?spotifyId=b3fl33vskh6j2vfmtym7pqzuu&albumId=0aC3Wk3HT8ot5nBQdcqqGJ' \
--header 'x-api-key: <apiKey>'

Fetch Spotify User by Wallet Address

GET https://<baseURL>/wallet-spotify-data

Fetches the details of a Spotify user by their wallet address

Query Parameters

NameTypeDescription

walletAddress*

string

The registered wallet address of the user

{
    "isError": boolean,
    "data": {
        "spotifyUser": {
            "id": string,
            "display_name": string,
            "external_urls": string,
            "href": string,
            "images": [],
            "type": string,
            "uri": string,
            "followers": number,
            "lastSynced": string,
            "createdAt": string,
            "updatedAt": string
        },
        "tracks": (same as the one in played-tracks endpoint) 
    },
    "message": string
}
curl --location 'https://wv2h4to5qa.execute-api.us-east-2.amazonaws.com/dev/spotify/wallet-spotify-data?walletAddress=0xAc842FB63f6ACf603EA6f088e53A1a210617133b' \
--header 'x-api-key: <apiKey>'

Fetch Top Artists and Genres by Spotify User

GET https://<baseURL>/top

Fetches the names of top artists in mentioned time period and also their respective genres given the Spotify user

Query Parameters

NameTypeDescription

spotifyId*

string

time_range

string

optional, string. Can only pass in 3 values, 'long_term', 'medium_term', 'short_term'. If this param is not passed, execution defaults to 'long_term'

{
    "isError": false,
    "data": {
        "names": [
            "Ed Sheeran",
            ....
   
        ],
        "genres": [
            "pop",
            ....           
        ]
    },
    "message": ""
}
curl --location 'https://wv2h4to5qa.execute-api.us-east-2.amazonaws.com/dev/spotify/top' \
--header 'x-api-key: <apiKey>'

Last updated