Copy components between files

Can I copy a component from one file and paste it to another file by the API (for instance to an empty file I’ve made in advance)?

Yes, but since a plugin only works within the limits of one file, you’ll need to open the plugin in one file to copy, then go to another file and open the plugin to paste.