There is no option of the FBX exporter as "export only visible." There is a setting to export only the selected, what you can do easily by script, selecting all visible. But...
There is a FBX exporter behavior, which forces exporting all object's hierarchy, if it's necessary for the specified object(skeleton animation or constraints for example). This means that in general you cannot export only the specified objects. Usually, during the pipeline of export/import, the "importing side" of the process decides which objects should be imported at the end.