Batch download versions of a file/directory

Has anyone tried to download all the versions of a specific file/directory in a library? Could this be done with the API without messing with the library or is it required to restore the file/directory on the library to be able to download it?