Enqueuing Spotify tracks

Although our library of Spotify tracks is constantly growing, it can happen that a specific track you are looking for has not been analyzed yet. In this case, you may want to manually enqueue it in order to be able to query similar Spotify tracks for this track or get it returned in the search results.

Below you can see different results for the operation:

In case the track was already analyzed, SpotifyTrackEnqueueAnalysisResultSuccess object will be returned. To get more information we query the status field on the Spotify track object. In this case, we can see the track analysis has the status FINISHED.

{
"data": {
"spotifyTrackEnqueueAnalysis": {
"__typename": "SpotifyTrackEnqueueAnalysisResultSuccess",
"spotifyTrackAnalysis": {
"status": "FINISHED"
}
}
}
}

If the track hasn't been analyzed yet SpotifyTrackEnqueueAnalysisResultSuccess object will be returned as well. The difference now is that we see the track analysis has the status PROCESSING which means it's being currently analyzed.

{
"data": {
"spotifyTrackEnqueueAnalysis": {
"__typename": "SpotifyTrackEnqueueAnalysisResultSuccess",
"spotifyTrackAnalysis": {
"status": "PROCESSING"
}
}
}
}

If you set up your webhook properly, you should also be notified when the enqueued track analysis is finished. You will receive a webhook with the following body:

{
"type": "SPOTIFY_TRACK_ANALYSIS_FINISHED",
"data": { "spotifyTrackId": "7iQM9DQUFKUSNjVt8GQZV2" }
}

If you by accident send an incorrect Spotify ID within the query, the following response will be returned.

{
"data": {
"spotifyTrackEnqueueAnalysis": {
"__typename": "SpotifyTrackNotFoundError",
"message": "It seems like this track does not exist on Spotify."
}
}
}