It works, but the tracks api is limited to 100 max results, so you have to call it multiple times with offset for larger playlists [1].
[1] https://developer.spotify.com/documentation/web-api/referenc...
[1] https://developer.spotify.com/documentation/web-api/referenc...
It should be possible to script that out too.
I already did just to test it out, the results include a 'next' link that you can use :)