Hello Luca,
Currently with the API you would need to specify the column names when exporting, when as you mentioned you are not aware of the name(s) or number of columns it can be difficult.
There is an existing public feature request to have the table headers included in the export which can be viewed here[1]. There is no ETA nor a guarantee this feature request will be implemented in the future.
I suggest you to up vote the feature request (click on the plus 1 button), this will help the engineering team to know that there are more users interested in this feature request. You can also star the feature request in order to receive any updates should there be any posts.