Playlist
Due to the nature of playlists, they take longer to convert and that requires running in the background. When you convert a playlist by hitting the /entity/convert
endpoint, you'll get a task_id
as part of your response which you will then poll at interval in order to get the final status.
While a playlist task is running, the status would be pending
and if there was an error, the status would be failed
. On success, the status would be success
and a payload
would also be returned.
Convert a playlist
Convert a playlist
POST
https://api.orchdio.dev/v1/entity/convert
Headers
x-orchdio-public-key*
String
Your app's public key
content-type
String
JSON content type
Request Body
url*
String
target_platform*
String
{
"data": {
"task_id": "af2f9670-196e-47ed-93b0-afe8b0955e53",
"payload": null,
"status": "pending"
},
"message": "Request Ok",
"status": 200
}
{
"error": "Bad Request",
"message": "Target platform or url not valid or passed.",
"status": 500
}
{
"error": "Internal error",
"message": "An internal error occured",
"status": 500
}
A response that looks like this is returned
// Some Code
{
"data":{
"task_id":"24b73c30-ffce-4857-abb7-93eaa8f97449",
"payload":null,
"status":"pending"
},
"message":"Request Ok",
"status":201
}
You can then poll the task id
at interval.
It is recommended that you set your polling interval to a minimum of 2 seconds in order not to rate-limit your app.
Fetch playlist conversion result
And finally, upon success, you get a response similar to this
// Some code
{
"data":{
"task_id":"305e9bc9-f561-437f-82d1-c161cb50f192",
"payload":{
"platforms":{
"deezer":{
"tracks":[
{
"url":"https://www.deezer.com/track/137726995",
"artists":[
"Post Malone"
],
"duration":"4:09",
"duration_milli":249000,
"explicit":true,
"title":"Hit This Hard",
"preview":"https://cdns-preview-9.dzcdn.net/stream/c-99f6286a257d323eff23efb6e86943d7-6.mp3",
"album":"Stoney (Deluxe)",
"id":"137726995",
"cover":"https://api.deezer.com/album/14781033/image"
},
{
"url":"https://www.deezer.com/track/137726979",
"artists":[
"Post Malone"
],
"duration":"3:14",
"duration_milli":194000,
"explicit":true,
"title":"Patient",
"preview":"https://cdns-preview-c.dzcdn.net/stream/c-c229a9814631189137c3e0d66c3bab6b-6.mp3",
"album":"Stoney (Deluxe)",
"id":"137726979",
"cover":"https://api.deezer.com/album/14781033/image"
},
{
"url":"https://www.deezer.com/track/137726981",
"artists":[
"Post Malone"
],
"duration":"2:59",
"duration_milli":179000,
"explicit":true,
"title":"Go Flex",
"preview":"https://cdns-preview-1.dzcdn.net/stream/c-18b6bfc0144508e563d5d76222d7c246-6.mp3",
"album":"Stoney (Deluxe)",
"id":"137726981",
"cover":"https://api.deezer.com/album/14781033/image"
},
{
"url":"https://www.deezer.com/track/137726975",
"artists":[
"Post Malone"
],
"duration":"4:16",
"duration_milli":256000,
"explicit":true,
"title":"White Iverson",
"preview":"https://cdns-preview-8.dzcdn.net/stream/c-8c56ed1f08dc434b30b6ca909863c153-6.mp3",
"album":"Stoney (Deluxe)",
"id":"137726975",
"cover":"https://api.deezer.com/album/14781033/image"
},
{
"url":"https://www.deezer.com/track/434211382",
"artists":[
"Miguel"
],
"duration":"4:19",
"duration_milli":259000,
"explicit":true,
"title":"Sky Walker (feat. Travis Scott)",
"preview":"https://cdns-preview-3.dzcdn.net/stream/c-3319fff4aa4cefd3ea75322c2cd40eee-7.mp3",
"album":"War & Leisure",
"id":"434211382",
"cover":"https://api.deezer.com/album/52416442/image"
},
{
"url":"https://www.deezer.com/track/365649481",
"artists":[
"Bryson Tiller"
],
"duration":"2:47",
"duration_milli":167000,
"explicit":true,
"title":"Self-Made",
"preview":"https://cdns-preview-a.dzcdn.net/stream/c-a57f2a5992ef9ee408ee8d171ad8d007-7.mp3",
"album":"True to Self",
"id":"365649481",
"cover":"https://api.deezer.com/album/42103741/image"
},
{
"url":"https://www.deezer.com/track/106713886",
"artists":[
"Travis Scott"
],
"duration":"4:22",
"duration_milli":262000,
"explicit":true,
"title":"Antidote",
"preview":"https://cdns-preview-c.dzcdn.net/stream/c-c06ade0addfe1e2ff1844166dffb4c8b-3.mp3",
"album":"Rodeo (Expanded Edition)",
"id":"106713886",
"cover":"https://api.deezer.com/album/11126554/image"
},
{
"url":"https://www.deezer.com/track/2265336117",
"artists":[
"Playboi Carti"
],
"duration":"3:01",
"duration_milli":181000,
"explicit":true,
"title":"Magnolia",
"preview":"https://cdns-preview-9.dzcdn.net/stream/c-97a68ff5e574ae6b317950d0fab6509f-7.mp3",
"album":"Taลczฤ teraz jak...",
"id":"2265336117",
"cover":"https://api.deezer.com/album/436711477/image"
},
{
"url":"https://www.deezer.com/track/374051801",
"artists":[
"2 Chainz"
],
"duration":"3:30",
"duration_milli":210000,
"explicit":true,
"title":"It's A Vibe",
"preview":"https://cdns-preview-f.dzcdn.net/stream/c-f0272483d34081a80aebfad3ed673096-7.mp3",
"album":"Pretty Girls Like Trap Music",
"id":"374051801",
"cover":"https://api.deezer.com/album/43240731/image"
},
{
"url":"https://www.deezer.com/track/1346769072",
"artists":[
"Son Kuma"
],
"duration":"3:35",
"duration_milli":215000,
"explicit":true,
"title":"Indica",
"preview":"https://cdns-preview-4.dzcdn.net/stream/c-4c8c4475106992c2b343268facbb51eb-2.mp3",
"album":"Indica",
"id":"1346769072",
"cover":"https://api.deezer.com/album/223654602/image"
}
],
"length":2172000
},
"spotify":{
"tracks":[
{
"url":"https://open.spotify.com/track/61jnrkPHpLumBf1kqGpRRt",
"artists":[
"Post Malone"
],
"release_date":"2016-12-09",
"duration":"4:09",
"duration_milli":249026,
"explicit":true,
"title":"Hit This Hard",
"preview":"",
"album":"Stoney (Deluxe)",
"id":"61jnrkPHpLumBf1kqGpRRt",
"cover":"https://i.scdn.co/image/ab67616d0000b27355404f712deb84d0650a4b41"
},
{
"url":"https://open.spotify.com/track/5DLTuH4A5VZB2HKpqHQR6t",
"artists":[
"Post Malone"
],
"release_date":"2016-12-09",
"duration":"3:14",
"duration_milli":194333,
"explicit":true,
"title":"Patient",
"preview":"",
"album":"Stoney (Deluxe)",
"id":"5DLTuH4A5VZB2HKpqHQR6t",
"cover":"https://i.scdn.co/image/ab67616d0000b27355404f712deb84d0650a4b41"
},
{
"url":"https://open.spotify.com/track/5yuShbu70mtHXY0yLzCQLQ",
"artists":[
"Post Malone"
],
"release_date":"2016-12-09",
"duration":"2:59",
"duration_milli":179613,
"explicit":true,
"title":"Go Flex",
"preview":"",
"album":"Stoney (Deluxe)",
"id":"5yuShbu70mtHXY0yLzCQLQ",
"cover":"https://i.scdn.co/image/ab67616d0000b27355404f712deb84d0650a4b41"
},
{
"url":"https://open.spotify.com/track/6eT7xZZlB2mwyzJ2sUKG6w",
"artists":[
"Post Malone"
],
"release_date":"2016-12-09",
"duration":"4:16",
"duration_milli":256533,
"explicit":true,
"title":"White Iverson",
"preview":"",
"album":"Stoney (Deluxe)",
"id":"6eT7xZZlB2mwyzJ2sUKG6w",
"cover":"https://i.scdn.co/image/ab67616d0000b27355404f712deb84d0650a4b41"
},
{
"url":"https://open.spotify.com/track/5WoaF1B5XIEnWfmb5NZikf",
"artists":[
"Miguel",
"Travis Scott"
],
"release_date":"2017-12-01",
"duration":"4:19",
"duration_milli":259333,
"explicit":true,
"title":"Sky Walker (feat. Travis Scott)",
"preview":"https://p.scdn.co/mp3-preview/c95b541168b5a8cb39c2d648060cee74cd68db7c?cid=8d367c0bbfe142d494bcbf1cf2e30f06",
"album":"War & Leisure",
"id":"5WoaF1B5XIEnWfmb5NZikf",
"cover":"https://i.scdn.co/image/ab67616d0000b2735e9dff10c31ac14c6c6c920d"
},
{
"url":"https://open.spotify.com/track/2rUwQj4SWaP2anuGDtNpYR",
"artists":[
"Bryson Tiller"
],
"release_date":"2017-05-26",
"duration":"2:47",
"duration_milli":167853,
"explicit":true,
"title":"Self-Made",
"preview":"https://p.scdn.co/mp3-preview/ef4f8070afef2e43cffaca22976d552e9d802a35?cid=8d367c0bbfe142d494bcbf1cf2e30f06",
"album":"True to Self",
"id":"2rUwQj4SWaP2anuGDtNpYR",
"cover":"https://i.scdn.co/image/ab67616d0000b273202e628665f6ae3789c998c1"
},
{
"url":"https://open.spotify.com/track/1wHZx0LgzFHyeIZkUydNXq",
"artists":[
"Travis Scott"
],
"release_date":"2015-09-04",
"duration":"4:22",
"duration_milli":262693,
"explicit":true,
"title":"Antidote",
"preview":"https://p.scdn.co/mp3-preview/acd5af9c79ae22c4a0ff7bd185193d9c6ef6cae2?cid=8d367c0bbfe142d494bcbf1cf2e30f06",
"album":"Rodeo (Expanded Edition)",
"id":"1wHZx0LgzFHyeIZkUydNXq",
"cover":"https://i.scdn.co/image/ab67616d0000b2737433176f037e0ba14190c34f"
},
{
"url":"https://open.spotify.com/track/1e1JKLEDKP7hEQzJfNAgPl",
"artists":[
"Playboi Carti"
],
"release_date":"2017-04-14",
"duration":"3:01",
"duration_milli":181812,
"explicit":true,
"title":"Magnolia",
"preview":"",
"album":"Playboi Carti",
"id":"1e1JKLEDKP7hEQzJfNAgPl",
"cover":"https://i.scdn.co/image/ab67616d0000b273e31a279d267f3b3d8912e6f1"
},
{
"url":"https://open.spotify.com/track/6H0AwSQ20mo62jGlPGB8S6",
"artists":[
"2 Chainz",
"Ty Dolla $ign",
"Trey Songz",
"Jhenรฉ Aiko"
],
"release_date":"2017-06-16",
"duration":"3:30",
"duration_milli":210200,
"explicit":true,
"title":"It's A Vibe",
"preview":"",
"album":"Pretty Girls Like Trap Music",
"id":"6H0AwSQ20mo62jGlPGB8S6",
"cover":"https://i.scdn.co/image/ab67616d0000b273c0c05243a846dda6c84607f9"
},
{
"url":"https://open.spotify.com/track/4FYLG933mzDRSvdBZmN1aX",
"artists":[
"Son Kuma"
],
"release_date":"2017-12-29",
"duration":"3:35",
"duration_milli":215526,
"explicit":true,
"title":"Indica",
"preview":"https://p.scdn.co/mp3-preview/aefacb768e08a086ae35d4c562d640d88060f56f?cid=8d367c0bbfe142d494bcbf1cf2e30f06",
"album":"Indica",
"id":"4FYLG933mzDRSvdBZmN1aX",
"cover":"https://i.scdn.co/image/ab67616d0000b2739046d07ab5467500ba871cc6"
}
],
"length":2176922
}
},
"meta":{
"length":"00:36:12",
"title":"SMOKING",
"owner":"",
"cover":"https://mosaic.scdn.co/640/ab67616d0000b273202e628665f6ae3789c998c1ab67616d0000b27355404f712deb84d0650a4b41ab67616d0000b2735e9dff10c31ac14c6c6c920dab67616d0000b2737433176f037e0ba14190c34f",
"entity":"playlist",
"url":"https://open.spotify.com/playlist/2D1MDEWVAimd7xVnSW6iqn",
"short_url":"k_DZIaGap"
}
},
"status":"completed"
},
"message":"Request Ok",
"status":200
}
In the case where the conversion could not be made, the status of the task is updated with the final status of the execution.
When you make a conversion request, it might fail or succeed. You can always make another request if the previous returns an error.
// Some code
{
"message":"Internal Error",
"status":200,
"error":{
"task_id":"d030c47e-1d5b-4269-86ab-671b000f1063",
"payload":{
"platform":"tidal",
"status":"failed",
"error":"ENOCREDENTIALS",
"message":"No tidal credentials found for this app."
},
"status":"failed"
}
}
Last updated